摘要: Find the MarbleTime Limit: 2 Seconds Memory Limit: 65536 KBAlice and Bob are playing a game. This game is played with several identical pots and one marble. When the game starts, Alice puts the p... 阅读全文
posted @ 2013-08-02 18:38 码代码的猿猿 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 求A,B的最大公约数,并求出X,Y A*X+B*Y=gcd(A,B)int ex_gcd(int a,int b,int &x,int &y){ if(b==0) { x=1;y=0; return a; } else { int r=gcd(b,a&b,y,x); y-=x*(a/b)... 阅读全文
posted @ 2013-08-02 08:06 码代码的猿猿 阅读(101) 评论(0) 推荐(0) 编辑
摘要: Modular InverseTime Limit: 2 Seconds Memory Limit: 65536 KBThe modular modular multiplicative inverse of an integer a modulo m is an integer x such that a-1≡x (mod m). This is equivalent to ax≡1 ... 阅读全文
posted @ 2013-08-02 07:17 码代码的猿猿 阅读(226) 评论(0) 推荐(0) 编辑
摘要: Draw Something CheatTime Limit: 2 Seconds Memory Limit: 65536 KBHave you played Draw Something? It's currently one of the hottest social drawing games on Apple iOS and Android Devices! In this ga... 阅读全文
posted @ 2013-08-02 04:10 码代码的猿猿 阅读(402) 评论(0) 推荐(0) 编辑