摘要:
The cows are having a picnic! Each of Farmer John's K (1 ≤ K ≤ 100) cows is grazing in one of N (1 ≤ N ≤ 1,000) pastures, conveniently numbered 1...N. 阅读全文
摘要:
The GNU Compiler Collection (usually shortened to GCC) is a compiler system produced by the GNU Project supporting various programming languages. But 阅读全文
摘要:
The greatest common divisor GCD(a,b) of two positive integers a and b,sometimes written (a,b),is the largest divisor common to a and b,For example,(1, 阅读全文
摘要:
我知道部分同学最近在看中国剩余定理,就这个定理本身,还是比较简单的: 假设m1,m2,…,mk两两互素,则下面同余方程组: x≡a1(mod m1) x≡a2(mod m2) … x≡ak(mod mk) 在0<=<m1m2…mk内有唯一解。 记Mi=M/mi(1<=i<=k),因为(Mi,mi)= 阅读全文
摘要:
求在小于等于N的正整数中有多少个X满足:X mod a[0] = b[0], X mod a[1] = b[1], X mod a[2] = b[2], …, X mod a[i] = b[i], … (0 < a[i] <= 10)。 Input输入数据的第一行为一个正整数T,表示有T组测试数据。 阅读全文
摘要:
Assume that f(0) = 1 and 0^0=1. f(n) = (n%10)^f(n/10) for all n bigger than zero. Please calculate f(n)%m. (2 ≤ n , m ≤ 10^9, x^y means the y th power 阅读全文
摘要:
OO has got a array A of size n ,defined a function f(l,r) represent the number of i (l<=i<=r) , that there's no j(l<=j<=r,j<>i) satisfy a i mod a j=0, 阅读全文
摘要:
Fermat's theorem states that for any prime number p and for any integer a > 1, ap = a (mod p). That is, if we raise a to the pth power and divide by p 阅读全文
摘要:
Description People are different. Some secretly read magazines full of interesting girls' pictures, others create an A-bomb in their cellar, others li 阅读全文
摘要:
A computer programmer lives in a street with houses numbered consecutively (from 1) down one side of the street. Every evening she walks her dog by le 阅读全文