Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.
ContestId |
Name |
Phase |
Frozen |
Duration (Seconds) |
Relative Time |
Start Time |
---|---|---|---|---|---|---|
1000 | Educational Codeforces Round 46 (Rated for Div. 2) | FINISHED | False | 7200 | 201713099 | June 27, 2018, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 5882 ) | B | Light It Up | PROGRAMMING | greedy | 1600 |
B'Recently, you bought a brand new smart lamp with programming features. At first, you set up a schedule to the lamp. Every day it will turn power on at moment 0 and turn power off at moment M . Moreover, the lamp allows you to set a program of switching its state (states are "lights on" and "lights off"). Unfortunately, some program is already installed into the lamp. The lamp allows only good programs. Good program can be represented as a non-empty array a , where 0 < a_1 < a_2 < ... < a_{|a|} < M . All a_i must be integers. Of course, preinstalled program is a good program. The lamp follows program a in next manner: at moment 0 turns power and light on. Then at moment a_i the lamp flips its state to opposite (if it was lit, it turns off, and vice versa). The state of the lamp flips instantly: for example, if you turn the light off at moment 1 and then do nothing, the total time when the lamp is lit will be 1 . Finally, at moment M the lamp is turning its power off regardless of its state. Since you are not among those people who read instructions, and you don 't understand the language it 's written in, you realize (after some testing) the only possible way to alter the preinstalled program. You can insert at most one element into the program a , so it still should be a good program after alteration. Insertion can be done between any pair of consecutive elements of a , or even at the begining or at the end of a . Find such a way to alter the program that the total time when the lamp is lit is maximum possible. Maybe you should leave program untouched. If the lamp is lit from x till moment y , then its lit for y - x units of time. Segments of time when the lamp is lit are summed up. First line contains two space separated integers n and M ( 1 <= n <= 10^5 , 2 <= M <= 10^9 ) -- the length of program a and the moment when power turns '... |
60288 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
39714559 | forlfs | B | June 27, 2018, 3:39 p.m. | OK | GNU C | TESTS | 39 | 31 | 819200 | 1600 | |
39712962 | C1ariS | B | June 27, 2018, 3:27 p.m. | OK | GNU C | TESTS | 39 | 31 | 1228800 | 1600 | |
39718289 | aniket.shrimal | B | June 27, 2018, 4:10 p.m. | OK | GNU C | TESTS | 39 | 31 | 1638400 | 1600 | |
39716403 | orzzzzzz | B | June 27, 2018, 3:53 p.m. | OK | GNU C | TESTS | 39 | 46 | 819200 | 1600 | |
39709471 | l1ll5 | B | June 27, 2018, 3:04 p.m. | OK | GNU C++ | TESTS | 39 | 30 | 819200 | 1600 | |
39714484 | SovietPower | B | June 27, 2018, 3:38 p.m. | OK | GNU C++ | TESTS | 39 | 30 | 2252800 | 1600 | |
39717012 | yuanmaoheng | B | June 27, 2018, 3:59 p.m. | OK | GNU C++ | TESTS | 39 | 31 | 409600 | 1600 | |
39713332 | Izayoi_Sakuya | B | June 27, 2018, 3:29 p.m. | OK | GNU C++ | TESTS | 39 | 31 | 512000 | 1600 | |
39709788 | Jiangkangping | B | June 27, 2018, 3:06 p.m. | OK | GNU C++ | TESTS | 39 | 31 | 614400 | 1600 | |
39712916 | VisJiao | B | June 27, 2018, 3:26 p.m. | OK | GNU C++ | TESTS | 39 | 31 | 716800 | 1600 | |
39715709 | hazeone | B | June 27, 2018, 3:48 p.m. | OK | GNU C++ | TESTS | 39 | 31 | 819200 | 1600 | |
39714004 | Monkey-King | B | June 27, 2018, 3:34 p.m. | OK | GNU C++ | TESTS | 39 | 31 | 819200 | 1600 | |
39709451 | ppppaidy | B | June 27, 2018, 3:04 p.m. | OK | GNU C++ | TESTS | 39 | 31 | 819200 | 1600 | |
39709052 | ToErr | B | June 27, 2018, 3:01 p.m. | OK | GNU C++ | TESTS | 39 | 31 | 819200 | 1600 | |
39710506 | yah01 | B | June 27, 2018, 3:10 p.m. | OK | GNU C++11 | TESTS | 39 | 30 | 24064000 | 1600 | |
39710572 | zghh | B | June 27, 2018, 3:11 p.m. | OK | GNU C++11 | TESTS | 39 | 31 | 614400 | 1600 | |
39718138 | xuzonghao | B | June 27, 2018, 4:09 p.m. | OK | GNU C++11 | TESTS | 39 | 31 | 819200 | 1600 | |
39712545 | Plurm | B | June 27, 2018, 3:24 p.m. | OK | GNU C++11 | TESTS | 39 | 31 | 819200 | 1600 | |
39712537 | deadmoroz | B | June 27, 2018, 3:24 p.m. | OK | GNU C++11 | TESTS | 39 | 31 | 819200 | 1600 | |
39711698 | PumpkinYing | B | June 27, 2018, 3:18 p.m. | OK | GNU C++11 | TESTS | 39 | 31 | 819200 | 1600 | |
39715334 | Codefocres | B | June 27, 2018, 3:45 p.m. | OK | GNU C++11 | TESTS | 39 | 31 | 1024000 | 1600 | |
39721514 | Zerpro | B | June 27, 2018, 4:34 p.m. | OK | GNU C++11 | TESTS | 39 | 31 | 1228800 | 1600 | |
39718142 | prophet_ov_darkness | B | June 27, 2018, 4:09 p.m. | OK | GNU C++11 | TESTS | 39 | 31 | 1228800 | 1600 | |
39714701 | ryultwo | B | June 27, 2018, 3:40 p.m. | OK | GNU C++11 | TESTS | 39 | 31 | 1228800 | 1600 | |
39713753 | dragonsoul | B | June 27, 2018, 3:33 p.m. | OK | GNU C++14 | TESTS | 39 | 31 | 409600 | 1600 | |
39712671 | IIeJlMeHb | B | June 27, 2018, 3:25 p.m. | OK | GNU C++14 | TESTS | 39 | 31 | 409600 | 1600 | |
39719763 | dbtlswkdrnss | B | June 27, 2018, 4:23 p.m. | OK | GNU C++14 | TESTS | 39 | 31 | 819200 | 1600 | |
39709365 | ArshiaDadras | B | June 27, 2018, 3:03 p.m. | OK | GNU C++14 | TESTS | 39 | 31 | 819200 | 1600 | |
39709178 | donentseto | B | June 27, 2018, 3:02 p.m. | OK | GNU C++14 | TESTS | 39 | 31 | 819200 | 1600 | |
39710245 | natsugiri | B | June 27, 2018, 3:09 p.m. | OK | GNU C++14 | TESTS | 39 | 31 | 1228800 | 1600 | |
39707944 | jinyo | B | June 27, 2018, 2:56 p.m. | OK | GNU C++14 | TESTS | 39 | 31 | 2457600 | 1600 | |
39707390 | aditya1701 | B | June 27, 2018, 2:53 p.m. | OK | GNU C++14 | TESTS | 39 | 31 | 5632000 | 1600 | |
39707049 | traxex | B | June 27, 2018, 2:51 p.m. | OK | GNU C++14 | TESTS | 39 | 46 | 0 | 1600 | |
39721554 | tiliguzov | B | June 27, 2018, 4:34 p.m. | OK | GNU C++14 | TESTS | 39 | 46 | 409600 | 1600 |
Back to search problems