描述 Consider two natural numbers A and B. Let S be the sum of all natural divisors of A^B. Determine S modulo 9901 (the rest of the division of S by 9901). 输入 The only line contains the two natural numbers A and B, (0 <= A,B <= 50000000)separated by…
GCD and LCM Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 3379 Accepted Submission(s): 1482 Problem Description Given two positive integers G and L, could you tell me how many solutions of…
其实一道公式题: n!中素数i的幂为: [n/i]+[n/i^2]+[n/i^3]+[n/i^4]+...... #include <iostream> #include <cstdio> #include <algorithm> using namespace std; long long n; int main(){ long long two,five; int t; scanf("%d",&t); while(t--){ scanf(…
Sigma Function (LightOJ - 1336)[简单数论][算术基本定理][思维] 标签: 入门讲座题解 数论 题目描述 Sigma function is an interesting function in Number Theory. It is denoted by the Greek letter Sigma (σ). This function actually denotes the sum of all divisors of a number. For exam…
ID Origin Title 111 / 423 Problem A LightOJ 1370 Bi-shoe and Phi-shoe 21 / 74 Problem B LightOJ 1356 Prime Independence 61 / 332 Problem C LightOJ 1341 Aladdin and the Flying Carpet 54 / 82 Problem D LightOJ 1336 Sigma Function 66 /…
那天的题挺简单的 下面来看下 No1 If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000. //project euler num1 #include <stdio.h> #inc…
今天是钟皓曦大佬讲课,先来膜一波 %%%%% •数论 数论是这次培训的一个重点,那么什么是数论呢? 数论是研究整数性质的东西,所以理论上day2不会涉及小数QwQ (切入正题) •整除性: 设a,b ∈ Z,如果 c ∈ Z 并且 a = b * c,则称 b | a 称: b为a的因子 b能整除a a能被b整除 / /好像很简单的样子 •质数: 只有1和自身作为因子的数叫做质数 以 π(x)表示不超过x的素数个数,可以证明出以下结论(1): lim π(x) * ln x / x =…
POJ1845:http://poj.org/problem?id=1845 思路: AB可以表示成多个质数的幂相乘的形式:AB=(a1n1)*(a2n2)* ...*(amnm) 根据算数基本定理可以得约数之和sum=(1+a1+a12+...+a1n1)*(1+a2+a22+...+a2n2)*...*(1+am+am2+...+amnm) mod 9901 对于每个(1+ai+ai2+...+aini) mod 9901=(ai(ni+1)-1)/(ai-1) mod 9901 (等比数列…