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 |
---|---|---|---|---|---|---|
713 | Codeforces Round 371 (Div. 1) | FINISHED | False | 7200 | 258038699 | Sept. 13, 2016, 4:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 352 ) | E | Sonya Partymaker | PROGRAMMING | binary search dp | 3100 |
B"Owl Sonya decided to become a partymaker. To train for this role she gather all her owl friends in the country house. There are m chairs located in a circle and consequently numbered with integers from 1 to m. Thus, chairs i and i xe2 x80 x89+ xe2 x80 x891 are neighbouring for all i from 1 to m xe2 x80 x89- xe2 x80 x891. Chairs 1 and m are also neighbouring. Some chairs are occupied by her friends. There are n friends in total. No two friends occupy the same chair. Rules are the following: Owls are very busy and want to get rid of the game as soon as possible. They cooperate to pick the direction. Your goal is to find the minimum number o moves required to finish the game. The first line of the input contains a single integer m (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109) -- the length of the circle. The second line contains a single integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89100 xe2 x80 x89000) -- the number of friends. Last line contains an increasing sequence of n integers ai (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89m) -- initial positions of all owls. Print the minimum number of move required to finish the game. Note, that 0 also may be an answer. In the first sample, it's possible if all owls will move clockwise, i.e. in the direction of increasing indices. In the sample, first owl has to move clockwise, while the second -- counterclockwise. In the third sample, the first and the fourth owls should move counterclockwise, while the third and the sixth -- clockwise. The second and the firth may move in any direction. "... |
Codeforces Round #371 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
20642817 | MohanLau | E | Sept. 15, 2016, 2:58 p.m. | OK | GNU C++ | TESTS | 88 | 30 | 2457600 | 3100 | |
20651305 | liujunhao | E | Sept. 16, 2016, 2:25 a.m. | OK | GNU C++ | TESTS | 88 | 31 | 1433600 | 3100 | |
26402522 | jiyutian | E | April 16, 2017, 3:27 a.m. | OK | GNU C++ | TESTS | 88 | 31 | 3072000 | 3100 | |
20758432 | munaiyi | E | Sept. 19, 2016, 2:50 p.m. | OK | GNU C++ | TESTS | 88 | 46 | 819200 | 3100 | |
21112470 | tankche1 | E | Oct. 2, 2016, 11 a.m. | OK | GNU C++ | TESTS | 88 | 46 | 1228800 | 3100 | |
21006835 | WuHongxun | E | Sept. 30, 2016, 4:33 a.m. | OK | GNU C++ | TESTS | 88 | 46 | 1228800 | 3100 | |
20654346 | Totoro | E | Sept. 16, 2016, 7:04 a.m. | OK | GNU C++ | TESTS | 88 | 46 | 1228800 | 3100 | |
40983726 | ReaLNero1 | E | July 30, 2018, 7 p.m. | OK | GNU C++ | TESTS | 88 | 46 | 1433600 | 3100 | |
20812169 | luoyuchu | E | Sept. 22, 2016, 7:53 a.m. | OK | GNU C++ | TESTS | 88 | 46 | 1536000 | 3100 | |
20832582 | AkaneSasu | E | Sept. 23, 2016, 8:05 a.m. | OK | GNU C++ | TESTS | 88 | 46 | 1843200 | 3100 | |
27012843 | RNS_CUS | E | May 11, 2017, 12:39 p.m. | OK | GNU C++11 | TESTS | 88 | 31 | 409600 | 3100 | |
27011756 | RNS_CUS | E | May 11, 2017, 12:07 p.m. | OK | GNU C++11 | TESTS | 88 | 31 | 819200 | 3100 | |
27011698 | RNS_CUS | E | May 11, 2017, 12:04 p.m. | OK | GNU C++11 | TESTS | 88 | 31 | 819200 | 3100 | |
20949675 | ChiliuDog | E | Sept. 27, 2016, 3:07 p.m. | OK | GNU C++11 | TESTS | 88 | 31 | 2457600 | 3100 | |
65277687 | cuizhuyefei | E | Nov. 18, 2019, 3:02 a.m. | OK | GNU C++11 | TESTS | 88 | 31 | 3174400 | 3100 | |
25377276 | liyang21 | E | March 10, 2017, 11:05 a.m. | OK | GNU C++11 | TESTS | 88 | 31 | 3276800 | 3100 | |
38265455 | xc01 | E | May 15, 2018, 11:17 a.m. | OK | GNU C++11 | TESTS | 88 | 31 | 4300800 | 3100 | |
52663600 | SylvanasS | E | April 13, 2019, 2:41 a.m. | OK | GNU C++11 | TESTS | 88 | 31 | 7987200 | 3100 | |
52398762 | _Sakits | E | April 6, 2019, 12:21 p.m. | OK | GNU C++11 | TESTS | 88 | 31 | 7987200 | 3100 | |
38266038 | _Sakits | E | May 15, 2018, 11:39 a.m. | OK | GNU C++11 | TESTS | 88 | 31 | 11571200 | 3100 | |
36277680 | AwD | E | March 14, 2018, 1:43 p.m. | OK | GNU C++14 | TESTS | 88 | 46 | 5529600 | 3100 | |
23378822 | Ali.Pi | E | Dec. 28, 2016, 1:31 p.m. | OK | GNU C++14 | TESTS | 88 | 61 | 2764800 | 3100 | |
36642497 | Geo_01 | E | March 26, 2018, 12:38 p.m. | OK | GNU C++14 | TESTS | 88 | 61 | 4403200 | 3100 | |
20940861 | jiaqiyang | E | Sept. 27, 2016, 8:48 a.m. | OK | GNU C++14 | TESTS | 88 | 62 | 819200 | 3100 | |
53045320 | QuartZ_Z | E | April 20, 2019, 11:52 a.m. | OK | GNU C++14 | TESTS | 88 | 62 | 1536000 | 3100 | |
25156934 | darkhh | E | March 2, 2017, 6:56 p.m. | OK | GNU C++14 | TESTS | 88 | 62 | 3174400 | 3100 | |
58805245 | melancholic_fat_otaku | E | Aug. 14, 2019, 8:41 a.m. | OK | GNU C++14 | TESTS | 88 | 62 | 7987200 | 3100 | |
23132723 | NiroBC | E | Dec. 19, 2016, 7:53 a.m. | OK | GNU C++14 | TESTS | 88 | 77 | 3072000 | 3100 | |
35866168 | nielswiles | E | March 3, 2018, 1:44 a.m. | OK | GNU C++14 | TESTS | 88 | 77 | 3788800 | 3100 | |
37725207 | AmberFrame | E | April 29, 2018, 3:19 p.m. | OK | GNU C++14 | TESTS | 88 | 77 | 6553600 | 3100 | |
52647056 | Als123 | E | April 12, 2019, 3 p.m. | OK | GNU C++17 | TESTS | 88 | 46 | 1638400 | 3100 | |
55525755 | Shayan.P | E | June 13, 2019, 11:04 a.m. | OK | GNU C++17 | TESTS | 88 | 61 | 409600 | 3100 | |
46835272 | InvUsr | E | Dec. 10, 2018, 1:19 a.m. | OK | GNU C++17 | TESTS | 88 | 78 | 1638400 | 3100 | |
52663522 | Rose_max | E | April 13, 2019, 2:36 a.m. | OK | GNU C++17 | TESTS | 88 | 78 | 7987200 | 3100 | |
65155725 | user202729_ | E | Nov. 16, 2019, 9:15 a.m. | OK | GNU C++17 | TESTS | 88 | 92 | 2355200 | 3100 | |
55972248 | ZloyHR | E | June 23, 2019, 3:28 p.m. | OK | GNU C++17 | TESTS | 88 | 218 | 12083200 | 3100 | |
57247312 | Benq | E | July 17, 2019, 8:06 p.m. | OK | GNU C++17 | TESTS | 88 | 607 | 2662400 | 3100 | |
21201508 | Los_Angelos_Laycurse | E | Oct. 5, 2016, 5:41 a.m. | OK | MS C++ | TESTS | 88 | 46 | 1024000 | 3100 | |
21201487 | Los_Angelos_Laycurse | E | Oct. 5, 2016, 5:39 a.m. | OK | MS C++ | TESTS | 88 | 46 | 1433600 | 3100 |
Back to search problems