摘要:
The harmonic value of the permutation p1,p2,⋯pn is ∑i=1n−1gcd(pi.pi+1) Mr. Frog is wondering about the permutation whose harmonic value is the strictl 阅读全文
摘要:
题目很简单,就是求表达式(P/D)的结果是不是整数。其中P是一个整系数的多项式,D是一个正整数。 把1-k(最高次)+1都试一次就好了。结论可以总结归纳得到。(k取 0, 1, 2 .... 的情况推一次,可以推出结论)。 阅读全文
摘要:
题目大意是: 在一个m行n列的矩形网格中放置k个相同的石子,问有多少种方法?每个格子最多放一个石子,所有石子都要用完,并且第一行、最后一行、第一列、最后一列都要有石子。 容斥原理。如果只是n * m放石子,那么最后的结果,就是C(n*m,k).我们设A为第一行不放石头的总数,B为最后一行不放石子的总 阅读全文
摘要:
Given a decimal integer number you will have to find out how many trailing zeros will be there in itsfactorial in a given number system and also you w 阅读全文
摘要:
frog is now a editor to censor so-called sensitive words (敏感词). She has a long text (p). Her job is relatively simple -- just to find the first occure 阅读全文
摘要:
Before ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irrever 阅读全文
摘要:
Ignatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the ho 阅读全文
摘要:
ACM (ACMers' Chatting Messenger) is a famous instant messaging software developed by Marjar Technology Company. To attract more users, Edward, the bos 阅读全文
摘要:
Now I think you have got an AC in Ignatius.L's "Max Sum" problem. To be a brave ACMer, we always challenge ourselves to more difficult problems. Now y 阅读全文
摘要:
As we all know, Coach Gao is a talented chef, because he is able to cook M dishes in the same time. Tonight he is going to have a hearty dinner with h 阅读全文
摘要:
N (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a programming contest. As we all know, some cows code better than others. Each 阅读全文
摘要:
Several currency exchange points are working in our city. Let us suppose that each point specializes in two particular currencies and performs exchang 阅读全文
摘要:
Problems involving the computation of exact values of very large magnitude and precision are common. For example, the computation of the national debt 阅读全文
摘要:
An encoding of a set of symbols is said to be immediately decodable if no code for one symbol is the prefix of a code for another symbol. We will assu 阅读全文
摘要:
Joe works in a maze. Unfortunately, portions of the maze have caught on fire, and the owner of the maze neglected to create a fire escape plan. Help J 阅读全文