1297. Palindrome Time limit: 1.0 second Memory limit: 64 MB The “U.S. Robots” HQ has just received a rather alarming anonymous letter. It states that the agent from the competing «Robots Unli
1149. Sinus Dances Time limit: 1.0 second Memory limit: 64 MB Let An = sin(1–sin(2+sin(3–sin(4+…sin( n))…) Let Sn = (…( A 1+ n) A 2+ n–1) A 3+…+2) An+1 For given N print SN Input One
1820. Ural Steaks Time limit: 0.5 second Memory limit: 64 MB After the personal contest, happy but hungry programmers dropped into the restaurant “Ural Steaks” and ordered n specialty steaks
1017. Staircases Time limit: 1.0 second Memory limit: 64 MB One curious child has a set of N little bricks (5 ≤ N ≤ 500). From these bricks he builds different staircases. Staircase consist
1026. Questions and Answers Time limit: 2.0 second Memory limit: 64 MB Background The database of the Pentagon contains a top-secret information. We don’t know what the information is — you
1014. Product of Digits Time limit: 1.0 second Memory limit: 64 MB Your task is to find the minimal positive integer number Q so that the product of digits of Q is exactly equal to N. Inpu
1297. Palindrome Time Limit: 1.0 second Memory Limit: 16 MB The “U.S. Robots” HQ has just received a rather alarming anonymous letter. It states that the agent from the competing «Robots Unlim
本来是写的DFS求最长路的,结果WA at test #2 ,后来发现是因为 图不一定要是连通图。然后就好麻烦了……写了个多次的DFS,没过。 写了个先连成连通图 ,再一次DFS,结果连接成连通图的过程中有错误,WA at test #5 。 最后发现这题是求 拓扑排序,从头写起,终于过了。 每次删除入度最小的顶点,并输出这个顶点的编号。我写的有点复杂……