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…
题目链接: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];…
ZOJ 2562 More Divisors(高合成数) ACM 题目地址:ZOJ 2562 More Divisors 题意: 求小于n的最大的高合成数,高合成数指一类整数,不论什么比它小的自然数的因子数目均比这个数的因子数目少. 分析: 网上都叫它反素数,事实上我查了一下,翻素数应该是正着写倒着写都是素数的素数.这个应该叫高合成数,见Wikipedia: Highly composite number 高合成数有下面特征: where p1<p2<⋯<pk are prime,…
/* Sum of divisors Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1996 Accepted Submission(s): 679 Problem Description mmm is learning division, she's so proud of herself that she can figure out…