hdu4432 Sum of divisors(数论)】的更多相关文章

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…
题目链接: https://projecteuler.net/problem=501 题意: \(f(n)\) be the count of numbers not exceeding \(n\) with exactly eight divisors. 就是找少于等于 \(n\)中只有8个因子的个数. You are given \(f(100) = 10, f(1000) = 180\) and \(f(10^6) = 224427\). Find \(f(10^{12})\) 题解: 我…
E. Sum of Remainders time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Calculate the value of the sum: n mod 1 + n mod 2 + n mod 3 + ... + n mod m. As the result can be very large, you shoul…
// f(n)表示 n的约数和 不包括自己// 给你一个m 求1 到 100万里面 f(n)<=m 的个数// 那么首先要用筛选求出所有出 f(n)// 然后就好办了 // 写好后 看见别人好快 去百度了下 发现有用二分的 用了下 快了 100Ms 不过 数据越大 二分优势越明显#include <iostream> #include <math.h> #include <map> #include <stack> #include <queue…
题目链接: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 +…
题目链接:Codeforces 396B On Sum of Fractions 题解来自:http://blog.csdn.net/keshuai19940722/article/details/20076297 题目大意:给出一个n,ans = ∑(2≤i≤n)1/(v(i)*u(i)), v(i)为不大于i的最大素数,u(i)为大于i的最小素数, 求ans,输出以分式形式. 解题思路:一開始看到这道题1e9,暴力是不可能了,没什么思路,后来在纸上列了几项,突然想到高中时候求等差数列时候用到…
GCD SUM Time Limit: 8000/4000MS (Java/Others) Memory Limit: 128000/64000KB (Java/Others) SubmitStatus Problem Description 给出N,M执行如下程序:long long  ans = 0,ansx = 0,ansy = 0;for(int i = 1; i <= N; i ++)   for(int j = 1; j <= M; j ++)       if(gcd(i,j)…
我想我是和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];…