acm

POJ1182

Written by  on December 13, 2016

POJ1182 食物链 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 66244 Accepted: 19522 Description 动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。

[Read more...]

Codeforces #733 D

Written by  on November 2, 2016

733D D. Kostya the Sculptor time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output Kostya is a genial sculptor, he has an idea: to carve a marble sculpture in the shape of a sphere. Kostya has a friend Zahar who works at a career. Zahar knows about Kostya’s idea and wants to present him a rectangular parallelepiped of marble from which he can carve the sphere.

[Read more...]

Codeforces #719 C

Written by  on October 26, 2016

719C C. Efim and Strange Grade time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output

[Read more...]

POJ1458

Written by  on February 1, 2016

POJ1458 Common Subsequence Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 44778 Accepted: 18346 Description A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = < x1, x2, …, xm > another sequence Z = < z1, z2, …, zk > is a subsequence of X if there exists a strictly increasing sequence < i1, i2, …, ik > of indices of X such that for all j = 1,2,…,k, xij = zj. For example, Z = < a, b, f, c > is a subsequence of X = < a, b, c, f, b, c > with index sequence < 1, 2, 4, 6 >. Given two sequences X and Y the problem is to find the length of the maximum-length common subsequence of X and Y.

[Read more...]

POJ3760

Written by  on November 13, 2015

POJ3760 魔兽世界(修订版) Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 1882 Accepted: 448 Description 魔兽世界的西面是红魔军的司令部,东面是蓝魔军的司令部。两个司令部之间是依次排列的若干城市,城市从西向东依次编号为1,2,3 …. N ( N <= 20)。

[Read more...]

并查集

Written by  on October 27, 2015

一直以来对于并查集的定义都感觉很模糊,看见网上的资料都是一知半解,今天认真地研究了一下,然后经孟海同志点拨了一下。。。才发现自己真的很愚蠢——居然连并查集都没有搞懂。

[Read more...]

POJ1661

Written by  on October 13, 2015

POJ1661 Help Jimmy Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 9644 Accepted: 3131 Description “Help Jimmy” 是在下图所示的场景上完成的游戏。

[Read more...]

POJ1961

Written by  on October 7, 2015

POJ1961 Period Time Limit: 3000MS Memory Limit: 30000K Total Submissions: 15006 Accepted: 7158 Description For each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the prefix is a periodic string. That is, for each i (2 <= i <= N) we want to know the largest K > 1 (if there is one) such that the prefix of S with length i can be written as AK ,that is A concatenated K times, for some string A. Of course, we also want to know the period K.

[Read more...]

POJ1686

Written by  on September 29, 2015

POJ1686 Lazy Math Instructor Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 3766 Accepted: 1307 Description A math instructor is too lazy to grade a question in the exam papers in which students are supposed to produce a complicated formula for the question asked. Students may write correct answers in different forms which makes grading very hard. So, the instructor needs help from computer programmers and you can help.

[Read more...]

POJ2663

Written by  on March 27, 2015

POJ2663 Tri Tiling Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8737 Accepted: 4554 Description In how many ways can you tile a 3xn rectangle with 2×1 dominoes?

[Read more...]