Codeforces Round 540 (Div. 3)

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
1118 Codeforces Round 540 (Div. 3) FINISHED False 8100 186593063 Feb. 19, 2019, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 5736 ) D1 Coffee and Coursework (Easy version) PROGRAMMING brute force greedy 1800

B"The only difference between easy and hard versions is the constraints. Polycarp has to write a coursework. The coursework consists of m pages. Polycarp also has n cups of coffee. The coffee in the i -th cup has a_i caffeine in it. Polycarp can drink some cups of coffee (each one no more than once). He can drink cups in any order. Polycarp drinks each cup instantly and completely (i.e. he cannot split any cup into several days). Surely, courseworks are not usually being written in a single day (in a perfect world of Berland, at least). Some of them require multiple days of hard work. Let's consider some day of Polycarp's work. Consider Polycarp drinks k cups of coffee during this day and caffeine dosages of cups Polycarp drink during this day are a_{i_1}, a_{i_2}, ... , a_{i_k} . Then the first cup he drinks gives him energy to write a_{i_1} pages of coursework, the second cup gives him energy to write max(0, a_{i_2} - 1) pages, the third cup gives him energy to write max(0, a_{i_3} - 2) pages, ..., the k -th cup gives him energy to write max(0, a_{i_k} - k + 1) pages. If Polycarp doesn't drink coffee during some day, he cannot write coursework at all that day. Polycarp has to finish his coursework as soon as possible (spend the minimum number of days to do it). Your task is to find out this number of days or say that it is impossible. The first line of the input contains two integers n and m ( 1 <= n <= 100 , 1 <= m <= 10^4 ) -- the number of cups of coffee and the number of pages in the coursework. The second line of the input contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= 100 ), where a_i is the caffeine dosage of coffee in the i -th cup. If it is impossible to write the coursework, print -1. Otherwise print the minimum number of days Polycarp needs to do it. In the first example Polycarp can drink fourth cup during first day (an"...

Tutorials

65396

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
50301669 Yasola D1 Feb. 22, 2019, 2:47 a.m. OK Clang++17 Diagnostics TESTS 26 46 0 1800
51094317 kmachina D1 March 9, 2019, 3:39 p.m. OK Clang++17 Diagnostics TESTS 26 46 1024000 1800
51680087 rr_ D1 March 22, 2019, 12:17 p.m. OK D TESTS 26 31 0 1800
50195614 ia7ck D1 Feb. 19, 2019, 4:37 p.m. OK D TESTS 26 31 0 1800
54534819 Denor D1 May 23, 2019, 7:18 p.m. OK Delphi TESTS 26 31 1740800 1800
50495587 DarkAvengerr D1 Feb. 25, 2019, 3:01 p.m. OK FPC TESTS 26 30 1638400 1800
50569781 PhuongPeu D1 Feb. 27, 2019, 2:49 p.m. OK FPC TESTS 26 46 921600 1800
56526754 cs234_shrey D1 July 4, 2019, 5:29 p.m. OK GNU C11 TESTS 26 30 0 1800
50352493 cprogrammer D1 Feb. 23, 2019, 9:10 a.m. OK GNU C11 TESTS 26 31 0 1800
50278884 Yznew D1 Feb. 21, 2019, 11:44 a.m. OK GNU C11 TESTS 26 31 0 1800
51227300 Dynamic. D1 March 12, 2019, 2:39 p.m. OK GNU C11 TESTS 26 31 0 1800
53185776 ArinaRaguzina D1 April 23, 2019, 10:15 a.m. OK GNU C11 TESTS 26 31 0 1800
54635257 saumyashah02 D1 May 25, 2019, 4:37 p.m. OK GNU C11 TESTS 26 31 0 1800
50273227 Scut82 D1 Feb. 21, 2019, 8:29 a.m. OK GNU C++11 TESTS 26 15 819200 1800
50270927 noname_ D1 Feb. 21, 2019, 7:13 a.m. OK GNU C++11 TESTS 26 15 819200 1800
52495157 shubh09 D1 April 8, 2019, 1:22 p.m. OK GNU C++11 TESTS 26 30 0 1800
51999294 vjudge3 D1 March 30, 2019, 5:17 a.m. OK GNU C++11 TESTS 26 30 0 1800
54807720 NikolaTECH D1 May 29, 2019, 3:05 p.m. OK GNU C++11 TESTS 26 30 0 1800
55004307 Bilguunzen D1 June 3, 2019, 6:39 a.m. OK GNU C++11 TESTS 26 30 0 1800
56074113 Sparta_KP D1 June 26, 2019, 12:01 p.m. OK GNU C++11 TESTS 26 30 0 1800
57610028 Coder_Zakir D1 July 23, 2019, 8:10 p.m. OK GNU C++11 TESTS 26 30 0 1800
58057654 Prof_BL D1 July 31, 2019, 6:06 a.m. OK GNU C++11 TESTS 26 30 0 1800
67142771 lzq41 D1 Dec. 18, 2019, 7:30 a.m. OK GNU C++11 TESTS 26 30 0 1800
52634899 InvincibleMario D1 April 12, 2019, 9:23 a.m. OK GNU C++14 TESTS 26 15 0 1800
52356572 kyro1202 D1 April 5, 2019, 5:10 p.m. OK GNU C++14 TESTS 26 15 0 1800
52292390 demon12321 D1 April 4, 2019, 3:17 a.m. OK GNU C++14 TESTS 26 15 0 1800
52004370 vjudge4 D1 March 30, 2019, 7:41 a.m. OK GNU C++14 TESTS 26 15 0 1800
67635921 bicycleman D1 Dec. 26, 2019, 6:56 a.m. OK GNU C++14 TESTS 26 15 0 1800
62440148 batsumaru D1 Oct. 12, 2019, 7:02 p.m. OK GNU C++14 TESTS 26 15 0 1800
62072614 SangeetaMishra D1 Oct. 7, 2019, 5:12 p.m. OK GNU C++14 TESTS 26 15 0 1800
55716251 adiah D1 June 18, 2019, 12:51 p.m. OK GNU C++14 TESTS 26 15 0 1800
55599441 yadavrohit D1 June 15, 2019, 5:14 p.m. OK GNU C++14 TESTS 26 15 0 1800
54977341 crap_coder D1 June 2, 2019, 11:27 a.m. OK GNU C++14 TESTS 26 15 0 1800
55657233 MetaFish D1 June 16, 2019, 6:04 p.m. OK GNU C++17 TESTS 26 15 0 1800
67653746 Dynamic. D1 Dec. 26, 2019, 1:08 p.m. OK GNU C++17 TESTS 26 15 0 1800
67649906 ManavJ07 D1 Dec. 26, 2019, 11:42 a.m. OK GNU C++17 TESTS 26 15 0 1800
62554212 masaow D1 Oct. 14, 2019, 9:55 a.m. OK GNU C++17 TESTS 26 15 0 1800
61350174 sparsh_sinha D1 Sept. 27, 2019, 7:40 a.m. OK GNU C++17 TESTS 26 15 0 1800
58380130 ayisn_timur D1 Aug. 6, 2019, 9:37 a.m. OK GNU C++17 TESTS 26 15 0 1800
57879753 van_persie9 D1 July 28, 2019, 7:14 a.m. OK GNU C++17 TESTS 26 15 0 1800
56291995 jernchr11 D1 June 30, 2019, 2:10 a.m. OK GNU C++17 TESTS 26 15 0 1800
56061616 spectre009 D1 June 26, 2019, 5:48 a.m. OK GNU C++17 TESTS 26 15 0 1800
55552559 STommydx D1 June 14, 2019, 8:02 a.m. OK GNU C++17 TESTS 26 15 0 1800
50214674 2008061626 D1 Feb. 20, 2019, 3:29 a.m. OK Go TESTS 26 46 0 1800
50237992 Rohan088 D1 Feb. 20, 2019, 11:42 a.m. OK Java 8 TESTS 26 93 0 1800
58882830 Agnimandur D1 Aug. 15, 2019, 10:51 p.m. OK Java 8 TESTS 26 108 0 1800
50317094 GreatWhite D1 Feb. 22, 2019, 12:47 p.m. OK Java 8 TESTS 26 108 0 1800
50311950 guptautkarsh028 D1 Feb. 22, 2019, 10:10 a.m. OK Java 8 TESTS 26 108 0 1800
50288604 Ahmed_Diab D1 Feb. 21, 2019, 4:14 p.m. OK Java 8 TESTS 26 108 0 1800
50201024 Jay_13 D1 Feb. 19, 2019, 5:17 p.m. OK Java 8 TESTS 26 108 0 1800
50200644 bazinga84 D1 Feb. 19, 2019, 5:12 p.m. OK Java 8 TESTS 26 108 0 1800
57150048 Shivam_72 D1 July 16, 2019, 2:24 p.m. OK Java 8 TESTS 26 109 0 1800
51925348 dtsarun D1 March 28, 2019, 7:17 a.m. OK Java 8 TESTS 26 109 0 1800
51103427 Carson D1 March 9, 2019, 8:19 p.m. OK Java 8 TESTS 26 109 0 1800
50193766 LLI_E_P_JI_O_K D1 Feb. 19, 2019, 4:28 p.m. OK JavaScript TESTS 26 31 204800 1800
50627830 exs D1 March 1, 2019, 7:13 a.m. OK Kotlin TESTS 26 140 409600 1800
50319593 Killer45 D1 Feb. 22, 2019, 1:52 p.m. OK Kotlin TESTS 26 140 512000 1800
50329902 kokokochet D1 Feb. 22, 2019, 6:08 p.m. OK Kotlin TESTS 26 140 1126400 1800
50192785 a11eca D1 Feb. 19, 2019, 4:23 p.m. OK Kotlin TESTS 26 155 1024000 1800
51840617 Mosyagin D1 March 25, 2019, 9:26 p.m. OK Mono C# TESTS 26 46 716800 1800
50305174 NEvOl D1 Feb. 22, 2019, 5:40 a.m. OK Mono C# TESTS 26 62 3584000 1800
50225481 fr0st D1 Feb. 20, 2019, 7:09 a.m. OK Mono C# TESTS 26 62 3686400 1800
50589174 vjudge4 D1 Feb. 28, 2019, 6:19 a.m. OK MS C++ TESTS 26 30 0 1800
50340110 Liquor2020 D1 Feb. 23, 2019, 1:16 a.m. OK MS C++ TESTS 26 30 102400 1800
57171589 vjudge5 D1 July 17, 2019, 3:25 a.m. OK MS C++ TESTS 26 30 819200 1800
50787608 vjudge4 D1 March 4, 2019, 2:03 p.m. OK MS C++ TESTS 26 30 819200 1800
52008130 vjudge4 D1 March 30, 2019, 8:20 a.m. OK MS C++ TESTS 26 31 0 1800
51301085 vjudge3 D1 March 14, 2019, 2:27 p.m. OK MS C++ TESTS 26 31 0 1800
51299716 vjudge3 D1 March 14, 2019, 1:52 p.m. OK MS C++ TESTS 26 31 0 1800
57447844 DostavalovID D1 July 21, 2019, 8:45 a.m. OK MS C++ TESTS 26 31 0 1800
58497283 vjudge1 D1 Aug. 9, 2019, 12:43 p.m. OK MS C++ TESTS 26 31 0 1800
54226085 vjudge1 D1 May 16, 2019, 6:21 a.m. OK MS C++ TESTS 26 31 0 1800
50505507 Husne_Matar D1 Feb. 25, 2019, 7:28 p.m. OK MS C++ 2017 TESTS 26 30 0 1800
50920082 Still_Theory D1 March 7, 2019, 8:43 a.m. OK MS C++ 2017 TESTS 26 30 1638400 1800
61447950 MrLolthe1st D1 Sept. 28, 2019, 10:43 p.m. OK MS C++ 2017 TESTS 26 31 0 1800
55999386 SmelJey D1 June 24, 2019, 12:16 p.m. OK MS C++ 2017 TESTS 26 31 0 1800
55666100 2018qwer D1 June 17, 2019, 3:55 a.m. OK MS C++ 2017 TESTS 26 31 0 1800
54845893 cebrf D1 May 30, 2019, 1:52 p.m. OK MS C++ 2017 TESTS 26 31 0 1800
52263810 zstuycz D1 April 3, 2019, 10:24 a.m. OK MS C++ 2017 TESTS 26 31 0 1800
50423808 oceanlin D1 Feb. 24, 2019, 10:28 a.m. OK MS C++ 2017 TESTS 26 31 0 1800
50342312 fierytree D1 Feb. 23, 2019, 3:29 a.m. OK MS C++ 2017 TESTS 26 31 0 1800
50306912 GordeyZhizhin D1 Feb. 22, 2019, 6:46 a.m. OK MS C++ 2017 TESTS 26 31 0 1800
50560338 Stanislav666 D1 Feb. 27, 2019, 10:37 a.m. OK PascalABC.NET TESTS 26 171 0 1800
50245208 mayakin D1 Feb. 20, 2019, 2:35 p.m. OK PHP TESTS 26 46 0 1800
50271271 apoorv1999 D1 Feb. 21, 2019, 7:25 a.m. OK PyPy 2 TESTS 26 124 0 1800
63032995 YESMAths D1 Oct. 20, 2019, 7:19 p.m. OK PyPy 2 TESTS 26 124 0 1800
57117717 IngaleAnkur10 D1 July 15, 2019, 9:31 p.m. OK PyPy 2 TESTS 26 124 0 1800
50204921 c1729 D1 Feb. 19, 2019, 6:47 p.m. OK PyPy 2 TESTS 26 124 0 1800
50208107 gatsko D1 Feb. 19, 2019, 8:34 p.m. OK PyPy 2 TESTS 26 156 1945600 1800
50253638 Dart-Xeyter D1 Feb. 20, 2019, 6:28 p.m. OK PyPy 3 TESTS 26 124 0 1800
50244333 nikeshthapa255 D1 Feb. 20, 2019, 2:13 p.m. OK PyPy 3 TESTS 26 124 0 1800
50229592 adshin21 D1 Feb. 20, 2019, 8:38 a.m. OK PyPy 3 TESTS 26 124 0 1800
50196544 KTR D1 Feb. 19, 2019, 4:41 p.m. OK PyPy 3 TESTS 26 124 102400 1800
50523113 see_yoon D1 Feb. 26, 2019, 10:27 a.m. OK PyPy 3 TESTS 26 140 0 1800
50400125 vik678 D1 Feb. 23, 2019, 5:50 p.m. OK PyPy 3 TESTS 26 140 0 1800
50252148 MotaSanyal D1 Feb. 20, 2019, 5:48 p.m. OK PyPy 3 TESTS 26 140 0 1800
50243465 index_ D1 Feb. 20, 2019, 1:55 p.m. OK PyPy 3 TESTS 26 140 0 1800
52562511 yumtam D1 April 10, 2019, 11:09 a.m. OK PyPy 3 TESTS 26 140 102400 1800
50597851 III_Wolverine_III D1 Feb. 28, 2019, 11:19 a.m. OK PyPy 3 TESTS 26 155 0 1800
51617230 allonsy_kim D1 March 21, 2019, 12:54 p.m. OK Python 2 TESTS 26 171 0 1800
50217623 sampsonguo302 D1 Feb. 20, 2019, 5:43 a.m. OK Python 2 TESTS 26 171 0 1800
50196565 noob_coder_v2 D1 Feb. 19, 2019, 4:41 p.m. OK Python 2 TESTS 26 171 0 1800
50223717 zaytpotter D1 Feb. 20, 2019, 6:20 a.m. OK Python 3 TESTS 26 93 0 1800
58904091 tushartyagi8750 D1 Aug. 16, 2019, 10:19 a.m. OK Python 3 TESTS 26 108 0 1800
52575128 Gaflo D1 April 10, 2019, 4:01 p.m. OK Python 3 TESTS 26 108 0 1800
52573220 camaleroddur99 D1 April 10, 2019, 3:06 p.m. OK Python 3 TESTS 26 108 0 1800
50282760 Evil__Coder D1 Feb. 21, 2019, 1:28 p.m. OK Python 3 TESTS 26 108 0 1800
50228676 zelendanny D1 Feb. 20, 2019, 8:12 a.m. OK Python 3 TESTS 26 108 0 1800
50206192 ken D1 Feb. 19, 2019, 7:25 p.m. OK Python 3 TESTS 26 108 0 1800
58976297 youness.amhaouch D1 Aug. 18, 2019, 1:10 a.m. OK Python 3 TESTS 26 109 0 1800
56502821 codershuvo D1 July 4, 2019, 7:07 a.m. OK Python 3 TESTS 26 109 0 1800
52648124 beemax D1 April 12, 2019, 3:25 p.m. OK Python 3 TESTS 26 109 0 1800
50200298 danchu D1 Feb. 19, 2019, 5:07 p.m. OK Ruby TESTS 26 62 0 1800
68150185 gearjack D1 Jan. 4, 2020, 6:34 a.m. OK Rust TESTS 26 31 0 1800
50284202 yakamoto D1 Feb. 21, 2019, 2:06 p.m. OK Scala TESTS 26 436 0 1800

remove filters

Back to search problems