zoj 2286 Sum of Divisors】的更多相关文章

// f(n)表示 n的约数和 不包括自己// 给你一个m 求1 到 100万里面 f(n)<=m 的个数// 那么首先要用筛选求出所有出 f(n)// 然后就好办了 // 写好后 看见别人好快 去百度了下 发现有用二分的 用了下 快了 100Ms 不过 数据越大 二分优势越明显#include <iostream> #include <math.h> #include <map> #include <stack> #include <queue…
Sum of divisors Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2063    Accepted Submission(s): 718 Problem Description mmm is learning division, she's so proud of herself that she can figure o…
涉及知识点: 1. 进制转换. 2. 找因子时注意可以降低复杂度. Sum of divisors Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4837    Accepted Submission(s): 1589 Problem Description mmm is learning division, she's so prou…
Problem Description mmm is learning division, she's so proud of herself that she can figure out the sum of all the divisors of numbers no larger than 100 within one day!But her teacher said "What if I ask you to give not only the sum but the square-s…
题目链接: POJ:id=3132">http://poj.org/problem?id=3132 ZOJ:http://acm.zju.edu.cn/onlinejudge/showProblem.do? problemCode=2822 Description A positive integer may be expressed as a sum of different prime numbers (primes), in one way or another. Given two…
题目链接:http://poj.org/problem?id=1564 题目大意:给定一个整数t,和n个元素组成的集合.求能否用该集合中的元素和表示该整数,如果可以输出所有可行解.1<=n<=12 Sample Input 4 6 4 3 2 2 1 1 5 3 2 1 1 400 12 50 50 50 50 50 50 25 25 25 25 25 25 0 0 Sample Output Sums of 4: 4 3+1 2+2 2+1+1 Sums of 5: NONE Sums of…
题目链接: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 +…
我想我是和Segmentation Fault有仇,我一直以为是空间开大的问题,然后一直减少空间,还是SF,谁让n没有给范围了,qwq. 教训:以后注意输入范围和开的空间大小. #include<cstdio> #include<cstdlib> #include<cmath> #include<iostream> using namespace std; int a[3400010]; int ans[1000011]; int sum[3400010];…
题意:给定 n,m,把 n 的所有因数转 m 进制,再把各都平方,求和. 析:按它的要求做就好,注意的是,是因数,不可能有重复的...比如4的因数只有一个2,还有就是输出10进制以上的,要用AB.. 但我用的是ab..又没读好题....活该WA了好几次. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #includ…
三个小函数 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…