acm

Codeforces #459 A

Written by  on August 16, 2014

昨天刚回学校, 晚上就和孟海一起打了一场, 结果得了个鸭蛋, 身残志坚, 我还能再战. Codeforces #459 A A. Pashmak and Garden

[Read more...]

Factorial

Written by  on August 4, 2014

《算法竞赛入门经典》(刘汝佳) 5.2.2 阶乘的精确值:输入不超过1000的正整数n。输出n!=1234...n的精确结果。 这个代码粗略地介绍了一下大数运算的实现,主要是用数组来存储位数,估计gmp函数库原理跟这个差不多。

[Read more...]

POJ2234

Written by  on July 29, 2014

POJ2234 Matches Game Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 9306 Accepted: 5372 Description Here is a simple game. In this game, there are several piles of matches and two players. The two player play in turn. In each turn, one can choose a pile and take away arbitrary number of matches from the pile (Of course the number of matches, which is taken away, cannot be zero and cannot be larger than the number of matches in the chosen pile). If after a player’s turn, there is no match left, the player is the winner. Suppose that the two players are all very clear. Your job is to tell whether the player who plays first can win the game or not.

[Read more...]

POJ3295

Written by  on July 22, 2014

POJ3295 Tautology Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 10897 Accepted: 4136 Description WFF ‘N PROOF is a logic game played with dice. Each die has six faces representing some subset of the possible symbols K, A, N, C, E, p, q, r, s, t. A Well-formed formula (WFF) is any string of these symbols obeying the following rules:

[Read more...]

POJ1328

Written by  on July 10, 2014

今天期末考试成绩出来了,在认认真真地看完自己的各科成绩、GPA、排名过后,心里只是有一种说不出来的无奈感,果然,这个学期还是个学渣么,看着镜子里的自己,感觉什么也说不出来,也没什么好说的,只能继续刷POJ,刷完了到点就去健身,然后回来晚饭,晚饭完了继续刷POJ,最后总算是把POJ1328 給AC了。

[Read more...]

POJ2965

Written by  on June 17, 2014

原题POJ2965 The Pilots Brothers’ refrigerator Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 21431 Accepted: 8274 Special Judge

[Read more...]

POJ1753

Written by  on June 17, 2014

原题POJ1753 Flip Game Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 36003 Accepted: 15706 Description Flip game is played on a rectangular 4×4 field with two-sided pieces placed on each of its 16 squares. One side of each piece is white and the other one is black and each piece is lying either it’s black or white side up. Each round you flip 3 to 5 pieces, thus changing the color of their upper side from black to white and vice versa. The pieces to be flipped are chosen every round according to the following rules:

[Read more...]