Codeforces Round 509 (Div. 2)

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
1041 Codeforces Round 509 (Div. 2) FINISHED False 7200 194729099 Sept. 16, 2018, 10:35 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 9524 ) C Coffee Break PROGRAMMING binary search data structures greedy two pointers 1500

B"Recently Monocarp got a job. His working day lasts exactly m minutes. During work, Monocarp wants to drink coffee at certain moments: there are n minutes a_1, a_2, ... , a_n , when he is able and willing to take a coffee break (for the sake of simplicity let's consider that each coffee break lasts exactly one minute). However, Monocarp's boss doesn't like when Monocarp takes his coffee breaks too often. So for the given coffee break that is going to be on minute a_i , Monocarp must choose the day in which he will drink coffee during the said minute, so that every day at least d minutes pass between any two coffee breaks. Monocarp also wants to take these n coffee breaks in a minimum possible number of working days (he doesn't count days when he is not at work, and he doesn't take coffee breaks on such days). Take into account that more than d minutes pass between the end of any working day and the start of the following working day. For each of the n given minutes determine the day, during which Monocarp should take a coffee break in this minute. You have to minimize the number of days spent. The first line contains three integers n , m , d (1 <= n <= 2 cdot10^{5}, n <= m <= 10^{9}, 1 <= d <= m) -- the number of coffee breaks Monocarp wants to have, the length of each working day, and the minimum number of minutes between any two consecutive coffee breaks. The second line contains n distinct integers a_1, a_2, ... , a_n (1 <= a_i <= m) , where a_i is some minute when Monocarp wants to have a coffee break. In the first line, write the minimum number of days required to make a coffee break in each of the n given minutes. In the second line, print n space separated integers. The i -th of integers should be the index of the day during which Monocarp should have a coffee break at minute a_i . Days are numbered from 1 . If there ar"...

Tutorials

Codeforces Round #509 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
43078855 Rabbicode C Sept. 19, 2018, 12:56 p.m. OK Clang++17 Diagnostics TESTS 51 592 2048000 1500
69937600 vjudge2 C Feb. 1, 2020, 4:47 a.m. OK Clang++17 Diagnostics TESTS 51 1138 13619200 1500
42967986 vdanh7277 C Sept. 17, 2018, 3:17 a.m. OK FPC TESTS 51 530 2457600 1500
42943106 wjhh C Sept. 16, 2018, 12:16 p.m. OK FPC TESTS 51 608 6041600 1500
42943301 TShT C Sept. 16, 2018, 12:17 p.m. OK FPC TESTS 51 608 64102400 1500
42945891 AHTOH._. C Sept. 16, 2018, 12:30 p.m. OK FPC TESTS 51 639 3379200 1500
45317561 chaorenhaha C Nov. 5, 2018, 8:51 a.m. OK FPC TESTS 51 639 4812800 1500
45317864 chaorenhaha C Nov. 5, 2018, 9 a.m. OK FPC TESTS 51 654 4812800 1500
54833435 chaorenhaha C May 30, 2019, 9:50 a.m. OK FPC TESTS 51 779 16076800 1500
53590930 toleman C April 30, 2019, 11:22 p.m. OK GNU C11 TESTS 51 717 2457600 1500
46995347 Scut82 C Dec. 14, 2018, 8:02 a.m. OK GNU C++11 TESTS 51 62 2457600 1500
47004769 Scut82 C Dec. 14, 2018, 1:25 p.m. OK GNU C++11 TESTS 51 62 2457600 1500
54514276 xllarr C May 23, 2019, 8:55 a.m. OK GNU C++11 TESTS 51 62 5529600 1500
44751582 ReaLNero1 C Oct. 23, 2018, 8:13 p.m. OK GNU C++11 TESTS 51 62 7987200 1500
47004704 Scut82 C Dec. 14, 2018, 1:23 p.m. OK GNU C++11 TESTS 51 77 2457600 1500
42964950 yugao C Sept. 16, 2018, 11:16 p.m. OK GNU C++11 TESTS 51 78 2252800 1500
57629109 Steven_Meng C July 24, 2019, 8:10 a.m. OK GNU C++11 TESTS 51 78 2457600 1500
43000914 qkoqhh C Sept. 17, 2018, 1:49 p.m. OK GNU C++11 TESTS 51 78 3174400 1500
42967368 Powder C Sept. 17, 2018, 2:36 a.m. OK GNU C++11 TESTS 51 78 3993600 1500
57627474 luogu_bot1 C July 24, 2019, 7:34 a.m. OK GNU C++11 TESTS 51 78 4608000 1500
42937882 Cipri321 C Sept. 16, 2018, 11:47 a.m. OK GNU C++14 TESTS 51 93 5632000 1500
48540664 kaplanyb C Jan. 18, 2019, 4:33 p.m. OK GNU C++14 TESTS 51 109 2355200 1500
67506740 RasMalai C Dec. 24, 2019, 7:35 a.m. OK GNU C++14 TESTS 51 109 2457600 1500
46581220 LanaDelRey C Dec. 4, 2018, 11:20 a.m. OK GNU C++14 TESTS 51 109 2457600 1500
42956852 tushar_2658 C Sept. 16, 2018, 4:46 p.m. OK GNU C++14 TESTS 51 109 2457600 1500
52333472 appleofdiscord C April 5, 2019, 6:42 a.m. OK GNU C++14 TESTS 51 109 2457600 1500
67506772 ac_97 C Dec. 24, 2019, 7:36 a.m. OK GNU C++14 TESTS 51 109 2457600 1500
49887301 danya.smelskiy C Feb. 13, 2019, 11:02 p.m. OK GNU C++14 TESTS 51 109 3174400 1500
55711499 ronaldocr7 C June 18, 2019, 10:31 a.m. OK GNU C++14 TESTS 51 109 3174400 1500
45581514 xiaolongbao C Nov. 12, 2018, 4:58 a.m. OK GNU C++14 TESTS 51 109 3379200 1500
42968206 CodingDolphin C Sept. 17, 2018, 3:32 a.m. OK GNU C++17 TESTS 51 93 158412800 1500
42967954 CodingDolphin C Sept. 17, 2018, 3:15 a.m. OK GNU C++17 TESTS 51 93 168857600 1500
54764731 AryaKnight C May 28, 2019, 4:49 p.m. OK GNU C++17 TESTS 51 109 2457600 1500
55968174 sammithkanur C June 23, 2019, 1:16 p.m. OK GNU C++17 TESTS 51 109 3174400 1500
45053911 vjudge2 C Oct. 29, 2018, 11:55 a.m. OK GNU C++17 TESTS 51 109 5017600 1500
46574490 DD_BOND C Dec. 4, 2018, 7:57 a.m. OK GNU C++17 TESTS 51 109 12083200 1500
68573112 Ethos C Jan. 11, 2020, 3:31 a.m. OK GNU C++17 TESTS 51 109 16076800 1500
42967858 CodingDolphin C Sept. 17, 2018, 3:09 a.m. OK GNU C++17 TESTS 51 109 168857600 1500
65762635 LeoRiether C Nov. 26, 2019, 4:29 p.m. OK GNU C++17 TESTS 51 124 2457600 1500
62765481 sea_26 C Oct. 17, 2019, 8:29 a.m. OK GNU C++17 TESTS 51 124 2457600 1500
51403417 LoveKitty C March 17, 2019, 8:37 a.m. OK Go TESTS 51 764 9830400 1500
51403227 LoveKitty C March 17, 2019, 8:32 a.m. OK Go TESTS 51 780 9830400 1500
42936787 Haar C Sept. 16, 2018, 11:42 a.m. OK Haskell TESTS 51 1981 67481600 1500
63915663 Clowyy C Oct. 31, 2019, 9:58 a.m. OK Java 11 TESTS 51 576 7884800 1500
42958652 chandan5284 C Sept. 16, 2018, 5:44 p.m. OK Java 8 TESTS 51 249 0 1500
42934032 ShowStopper728 C Sept. 16, 2018, 11:28 a.m. OK Java 8 TESTS 51 311 0 1500
42934805 bhavyashah9873 C Sept. 16, 2018, 11:32 a.m. OK Java 8 TESTS 51 311 6451200 1500
45314856 donli C Nov. 5, 2018, 7:23 a.m. OK Java 8 TESTS 51 311 6758400 1500
42942202 amolpratap007 C Sept. 16, 2018, 12:11 p.m. OK Java 8 TESTS 51 311 15462400 1500
50666248 Harbin C March 2, 2019, 4:22 a.m. OK Java 8 TESTS 51 327 7372800 1500
43292801 java_geek C Sept. 23, 2018, 11:42 a.m. OK Java 8 TESTS 51 342 2048000 1500
43516871 darshankdarji C Sept. 28, 2018, 5:35 a.m. OK Java 8 TESTS 51 342 14336000 1500
42957643 karamkontar C Sept. 16, 2018, 5:12 p.m. OK Java 8 TESTS 51 343 5017600 1500
52793781 prituladima C April 15, 2019, 7:05 p.m. OK Java 8 TESTS 51 343 17100800 1500
54725982 xiaowuc1 C May 27, 2019, 8:32 p.m. OK Kotlin TESTS 51 264 5939200 1500
43163523 stepanovep C Sept. 21, 2018, 3:14 a.m. OK Kotlin TESTS 51 1403 23347200 1500
43232097 stepanovep C Sept. 22, 2018, 5:10 a.m. OK Kotlin TESTS 51 1435 23347200 1500
55632854 og.kostya C June 16, 2019, 10:30 a.m. OK Mono C# TESTS 51 124 13619200 1500
51416609 nemars C March 17, 2019, 2:20 p.m. OK Mono C# TESTS 51 327 44339200 1500
42936830 mircea85 C Sept. 16, 2018, 11:42 a.m. OK Mono C# TESTS 51 358 33382400 1500
42951427 omikad C Sept. 16, 2018, 2:33 p.m. OK Mono C# TESTS 51 577 45465600 1500
42936848 emelyan C Sept. 16, 2018, 11:42 a.m. OK Mono C# TESTS 51 701 35840000 1500
43659337 nastya1199 C Oct. 1, 2018, 6:38 p.m. OK Mono C# TESTS 51 967 43827200 1500
42946240 TrinidadTobago C Sept. 16, 2018, 12:32 p.m. OK Mono C# TESTS 51 1294 29798400 1500
43030116 eki C Sept. 18, 2018, 11:13 a.m. OK Mono C# TESTS 51 1902 45772800 1500
43022989 absi2011 C Sept. 18, 2018, 6:43 a.m. OK MS C++ TESTS 51 124 2662400 1500
50555225 vjudge5 C Feb. 27, 2019, 7:32 a.m. OK MS C++ TESTS 51 140 2457600 1500
45329744 scorpiowf C Nov. 5, 2018, 2:38 p.m. OK MS C++ TESTS 51 140 8704000 1500
48679405 vjudge5 C Jan. 21, 2019, 12:41 p.m. OK MS C++ TESTS 51 140 12083200 1500
54229425 vjudge5 C May 16, 2019, 8:05 a.m. OK MS C++ TESTS 51 155 7884800 1500
42968909 vjudge4 C Sept. 17, 2018, 4:17 a.m. OK MS C++ TESTS 51 155 16076800 1500
49391840 vjudge4 C Feb. 3, 2019, 10:21 a.m. OK MS C++ TESTS 51 156 2457600 1500
49392781 vjudge3 C Feb. 3, 2019, 10:55 a.m. OK MS C++ TESTS 51 156 2662400 1500
42937428 ch_g C Sept. 16, 2018, 11:45 a.m. OK MS C++ TESTS 51 156 5632000 1500
43027305 axuan C Sept. 18, 2018, 9:32 a.m. OK MS C++ TESTS 51 171 2662400 1500
64774383 vjudge3 C Nov. 13, 2019, 2:59 a.m. OK MS C++ 2017 TESTS 51 202 3174400 1500
54717089 Dragostan C May 27, 2019, 2 p.m. OK MS C++ 2017 TESTS 51 343 3174400 1500
62853956 vjudge1 C Oct. 18, 2019, 8:31 a.m. OK MS C++ 2017 TESTS 51 405 3174400 1500
55847542 darkus-_- C June 20, 2019, 11:30 p.m. OK MS C++ 2017 TESTS 51 405 8089600 1500
69902709 vjudge5 C Jan. 31, 2020, 1:25 p.m. OK MS C++ 2017 TESTS 51 467 8089600 1500
49477212 Still_Theory C Feb. 4, 2019, 7:59 p.m. OK MS C++ 2017 TESTS 51 467 16076800 1500
69899392 vjudge4 C Jan. 31, 2020, 12:38 p.m. OK MS C++ 2017 TESTS 51 483 8294400 1500
67513718 Mad112233 C Dec. 24, 2019, 10:04 a.m. OK MS C++ 2017 TESTS 51 514 8294400 1500
51856815 Peinot C March 26, 2019, 11:30 a.m. OK MS C++ 2017 TESTS 51 577 14540800 1500
53097273 Foxy663 C April 21, 2019, 2:16 p.m. OK MS C++ 2017 TESTS 51 623 13721600 1500
43163389 CTC C Sept. 21, 2018, 3:08 a.m. OK PHP TESTS 51 1559 54169600 1500
66210979 aaa_bbb_ccc C Dec. 3, 2019, 6:43 a.m. OK PyPy 2 TESTS 51 810 17920000 1500
43020823 Djok216 C Sept. 18, 2018, 4:40 a.m. OK PyPy 2 TESTS 51 1060 24576000 1500
44096065 111vad111 C Oct. 11, 2018, 12:32 a.m. OK PyPy 3 TESTS 51 857 28467200 1500
69709989 shivammishra C Jan. 29, 2020, 6:36 a.m. OK PyPy 3 TESTS 51 1013 20992000 1500
62442449 deadguy C Oct. 12, 2019, 8:10 p.m. OK PyPy 3 TESTS 51 1154 30720000 1500
42956967 Pratik_2106 C Sept. 16, 2018, 4:50 p.m. OK PyPy 3 TESTS 51 1216 22630400 1500
45259086 homoeconomicus C Nov. 3, 2018, 10:51 p.m. OK PyPy 3 TESTS 51 1325 29286400 1500
45258816 homoeconomicus C Nov. 3, 2018, 10:29 p.m. OK PyPy 3 TESTS 51 1606 36147200 1500
49632784 index_ C Feb. 8, 2019, 4:59 p.m. OK PyPy 3 TESTS 51 1949 32870400 1500
42952571 qyjubriskxp C Sept. 16, 2018, 2:48 p.m. OK Python 2 TESTS 51 966 33894400 1500
43446168 tnowakow C Sept. 26, 2018, 11:30 a.m. OK Python 2 TESTS 51 1138 27238400 1500
45898405 EoinDavey C Nov. 18, 2018, 1:44 a.m. OK Python 2 TESTS 51 1200 40652800 1500
42942513 jassi9c C Sept. 16, 2018, 12:13 p.m. OK Python 2 TESTS 51 1559 39731200 1500
43413272 SerChirag C Sept. 25, 2018, 2:20 p.m. OK Python 2 TESTS 51 1980 44544000 1500
44437725 bupt.wc C Oct. 17, 2018, 10:53 a.m. OK Python 3 TESTS 51 545 36659200 1500
48507169 toysheeyeyraku C Jan. 17, 2019, 6:15 p.m. OK Python 3 TESTS 51 577 31948800 1500
43635307 orailly C Oct. 1, 2018, 8:16 a.m. OK Python 3 TESTS 51 623 26828800 1500
67463087 Annvv C Dec. 23, 2019, 9:59 a.m. OK Python 3 TESTS 51 733 21196800 1500
42935744 coro65536 C Sept. 16, 2018, 11:36 a.m. OK Python 3 TESTS 51 795 36659200 1500
67462984 Annvv C Dec. 23, 2019, 9:57 a.m. OK Python 3 TESTS 51 810 21299200 1500
53796454 gaidash C May 5, 2019, 3:34 p.m. OK Python 3 TESTS 51 935 23347200 1500
47677802 nowyyz C Dec. 29, 2018, 10:17 a.m. OK Python 3 TESTS 51 982 31846400 1500
42943239 Gurak C Sept. 16, 2018, 12:17 p.m. OK Python 3 TESTS 51 1387 22425600 1500
43163728 ustb_zhsh C Sept. 21, 2018, 3:24 a.m. OK Python 3 TESTS 51 1528 29798400 1500
42958673 clrcldy C Sept. 16, 2018, 5:45 p.m. OK Rust TESTS 51 218 10547200 1500

remove filters

Back to search problems