B. Mushroom Scientists time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output As you very well know, the whole Universe traditionally uses three-dimensional Cartesian system of coordinates. In th…
这个题目题意简单,但是TLE得哭哭的... 输入 a b w x c五个数,最终要使得c<=a, 每一秒可以进行一个操作,如果b>=x,则 b=b-x,同时 c--;如果b<x,则a--,c--,b=w-(x-b),最终求满足c<=a时候已经走过的秒数. 我们可以看到,x ,w是里面的定量,b相当于一个控制开关,它的量决定了要进行哪种操作,c在任意一秒都会递减,而a只会在b<x的时候递减,换句话说,b>=x的时候,c和a才差距减少1,我一开始的优化是,分别对于两个条件,…
Toy Sum CodeForces - 405D Little Chris is very keen on his toy blocks. His teacher, however, wants Chris to solve more problems, so he decided to play a trick on Chris. There are exactly s blocks in Chris's set, each block has a unique number from 1…
A. Watching a movie time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You have decided to watch the best moments of some movie. There are two buttons on your player: Watch the current minute…
H. Bots Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/575/problem/H Description Sasha and Ira are two best friends. But they aren’t just friends, they are software engineers and experts in artificial intelligence. They are…
C. Plus and Square Root time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) an…
Codeforces 1091D New Year and the Permutation Concatenation https://codeforces.com/contest/1091/problem/D 题目: Let n be an integer. Consider all permutations on integers 1 to n in lexicographic order, and concatenate them into one big sequence p. For…
C. Zero-One 题目连接: http://codeforces.com/contest/135/problem/C Description Little Petya very much likes playing with little Masha. Recently he has received a game called "Zero-One" as a gift from his mother. Petya immediately offered Masha to pla…
B. Chloe and the sequence 题目链接 http://codeforces.com/contest/743/problem/B 题面 Chloe, the same as Vladik, is a competitive programmer. She didn't have any problems to get to the olympiad like Vladik, but she was confused by the task proposed on the ol…
C. Gerald's Hexagon Time Limit: 2 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/559/problem/A Description Gerald got a very curious hexagon for his birthday. The boy found out that all the angles of the hexagon are equal to . Then he me…