摘要:Count Pairs You are given a prime number pp, nn integers a1,a2,…,ana1,a2,…,an, and an integer kk. Find the number of pairs of indexes (i,j)(i,j) (1≤i<
阅读全文
摘要:Recursive sequence Farmer John likes to play mathematics games with his N cows. Recently, they are attracted by recursive sequences. In each turn, the
阅读全文
摘要:Find a path Frog fell into a maze. This maze is a rectangle containing NN rows and MM columns. Each grid in this maze contains a number, which is call
阅读全文
摘要:Do you know what is called ``Coprime Sequence''? That is a sequence consists of nnpositive integers, and the GCD (Greatest Common Divisor) of them is
阅读全文
摘要:Harmonic Number In mathematics, the nth harmonic number is the sum of the reciprocals of the first n natural numbers: In this problem, you are given n
阅读全文
摘要:I Count Two Three 31.1% 1000ms 32768K I will show you the most popular board game in the Shanghai Ingress Resistance Team. It all started several mont
阅读全文
摘要:Covering Covering Bob's school has a big playground, boys and girls always play games here after school. To protect boys and girls from getting hurt w
阅读全文
摘要:Permutation Counting Given a permutation a1, a2, … aN of {1, 2, …, N}, we define its E-value as the amount of elements where ai > i. For example, the
阅读全文
摘要:Sum Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 3980 Accepted Submission(s): 1620 Problem D
阅读全文
摘要:A Trivial Problem Mr. Santa asks all the great programmers of the world to solve a trivial problem. He gives them an integer m and asks for the number
阅读全文