摘要:
FSF has programmed a game. In this game, players need to divide a rectangle into several same squares. The length and width of rectangles are integer, 阅读全文
摘要:
Chinese people think of '8' as the lucky digit. Bob also likes digit '8'. Moreover, Bob has his own lucky number L. Now he wants to construct his luck 阅读全文
摘要:
The branch of mathematics called number theory is about properties of numbers. One of the areas that has captured the interest of number theoreticians 阅读全文
摘要:
The math department has been having problems lately. Due to immense amount of unsolicited automated programs which were crawling across their pages, t 阅读全文
摘要:
#include #include #include #include #include #define LL long long using namespace std; const int S=20;//随机算法判定次数,S越大,判错概率越小 LL ans; //给定一个数,判断是否是素数(常用long long大数) LL mult_mod(LL a,LL b,LL mod) //(a*... 阅读全文
摘要:
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) 阅读全文
摘要:
__int64 sum(__int64 p,__int64 n) //递归二分求 (1 + p + p^2 + p^3 +...+ p^n)%mod{ //奇数二分式 (1 + p + p^2 +...+ p^(n/2)) * (1 + p^(n/2+1)) if(n==0) //偶数二分式 (1 阅读全文
摘要:
Given a positive integer N, your task is to calculate the sum of the positive integers less than N which are not coprime to N. A is said to be coprime 阅读全文
摘要:
Consider a positive integer X,and let S be the sum of all positive integer divisors of 2004^X. Your job is to determine S modulo 29 (the rest of the d 阅读全文
摘要:
We say that x is a perfect square if, for some integer b, x = b 2. Similarly, x is a perfect cube if, for some integer b, x = b 3. More generally, x i 阅读全文