摘要:
int l; char a[1100]; int tmp[1100]; bool div(int k) { int j=0; int y=0; for(int i=0;i<l;i++) { int sum=a[i]+y*10; int x=sum/k; y=sum%k; ... 阅读全文
摘要:
You have got a cylindrical cup. Its bottom diameter is 2 units and its height is 2 units as well. The height of liquid level in the cup is d (0 ≤ d ≤ 阅读全文
摘要:
Now there are nn gems, each of which has its own value. Alice and Bob play a game with these nn gems. They place the gems in a row and decide to take 阅读全文
摘要:
Apple Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 806 Accepted Submission(s): 267 Problem Des 阅读全文
摘要:
It's said that Aladdin had to solve seven mysteries before getting the Magical Lamp which summons a powerful Genie. Here we are concerned about the fi 阅读全文
摘要:
Bamboo Pole-vault is a massively popular sport in Xzhiland. And Master Phi-shoe is a very popular coach for his success. He needs some bamboos for his 阅读全文
摘要:
Josephus Problem The historian Flavius Josephus relates how, in the Romano-Jewish conflict of 67 A.D., the Romans took the town of Jotapata which he w 阅读全文
摘要:
欧几里得算法 欧几里德算法又称辗转相除法,用于计算两个整数a,b的最大公约数。基本算法:设a=qb+r,其中a,b,q,r都是整数,则gcd(a,b)=gcd(b,r),即gcd(a,b)=gcd(b,a%b)。 证明略去了。 基本代码实现: 扩展欧几里得算法 扩展欧几里德算法是欧几里得算法的扩展。 阅读全文