HDU 4432 Sum of divisors (进制模拟)】的更多相关文章

三个小函数 getdiv();        求因子 getsum();     求平方和 change();     转换成该进制 #include <cstdio> #include <iostream> #include <cmath> #include <cstring> #include <algorithm> using namespace std; int n,m,cnt,ans,num; int di[555555]; char…
题意:给定 n,m,把 n 的所有因数转 m 进制,再把各都平方,求和. 析:按它的要求做就好,注意的是,是因数,不可能有重复的...比如4的因数只有一个2,还有就是输出10进制以上的,要用AB.. 但我用的是ab..又没读好题....活该WA了好几次. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #includ…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4432 代码: #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; int sum; int n,k; int tranfer(int num) { ; ) { int a = num%k; num = num/k; ret +…
Faulty Odometer Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=4278 Description You are given a car odometer which displays the miles traveled as an integer. The odometer has a defect, however: it proceeds from…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1335 Problem Description The Really Neato Calculator Company, Inc. has recently hired your team to help design their Super Neato Model I calculator. As a computer scientist you suggested to the company t…
传送门: Sky数 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 28761    Accepted Submission(s): 16168 Problem Description Sky从小喜欢奇特的东西,而且天生对数字特别敏感,一次偶然的机会,他发现了一个有趣的四位数2992,这个数,它的十进制数表示,其四位数字之和为2+9+9+…
Problem Description Many classmates said to me that A+B is must needs. If you can't AC this problem, you would invite me for night meal. ^_^ Input Input may contain multiple test cases. Each case contains A and B in one line. A, B are hexadecimal num…
Lovekey Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10680    Accepted Submission(s): 3470 Problem Description XYZ-26进制数是一个每位都是大写字母的数字. A.B.C.….X.Y.Z 分别依次代表一个0 ~ 25 的数字,一个 n 位的26进制数转化成是10进制的规…
Sky数 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 23808    Accepted Submission(s): 13510 Problem Description Sky从小喜欢奇特的东西,而且天生对数字特别敏感,一次偶然的机会,他发现了一个有趣的四位数2992,这个数,它的十进制数表示,其四位数字之和为2+9+9+2=22,…
十进制转八进制的变形: #include<stdio.h> int main() { int n; while(scanf("%d",&n)!=EOF&&n) { ; int m=n; ,x; while(n) { x=n%; )x--; )x--; sum+=ret*x; ret*=; n/=; } printf("%d: %d\n",m,sum); } ; }…