摘要:
Description 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 阅读全文
2017年7月19日
摘要:
Description There are so many different religions in the world today that it is difficult to keep track of them all. You are interested in finding out 阅读全文
摘要:
小明自从告别了ACM/ICPC之后,就开始潜心研究数学问题了,一则可以为接下来的考研做准备,再者可以借此机会帮助一些同学,尤其是漂亮的师妹。这不,班里唯一的女生又拿一道数学题来请教小明,小明当然很高兴的就接受了。不过等他仔细读题以后,发现自己也不会做,这下小明囧了:如果回复说自己不懂... 阅读全文
摘要:
Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M #include #include #include #include... 阅读全文
摘要:
Given a set of sticks of various lengths, is it possible to join them end-to-end to form a square? Input The first line of input contains N, ... 阅读全文
摘要:
A friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of knight moves that vi... 阅读全文
摘要:
小K手中有n张牌,每张牌上有一个一位数的数,这个字数不是0就是5。小K从这些牌在抽出任意张(不能抽0张),排成一行这样就组成了一个数。使得这个数尽可能大,而且可以被90整除。注意:1.这个数没有前导0,2.小K不需要使用所有的牌。Input 每个测试数据输入共2行。 第一行给出一个... 阅读全文
2017年7月15日
摘要:
裸题O(nlogn):#include #include #include using namespace std;typedef long long ll;const int maxn=3000000+100;int phi[maxn];void init() { for(i... 阅读全文
2017年7月13日
摘要:
In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive ... 阅读全文
摘要:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 20404 Accepted Submission(s): 1223... 阅读全文