Codeforces Round 645 (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
1358 Codeforces Round 645 (Div. 2) FINISHED False 7200 146849111 May 26, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2352 ) E Are You Fired? PROGRAMMING constructive algorithms data structures dp greedy implementation 2400

B"Levian works as an accountant in a large company. Levian knows how much the company has earned in each of the n consecutive months -- in the i -th month the company had income equal to a_i (positive income means profit, negative income means loss, zero income means no change). Because of the general self-isolation, the first lceil tfrac{n}{2} rceil months income might have been completely unstable, but then everything stabilized and for the last lfloor tfrac{n}{2} rfloor months the income was the same. Levian decided to tell the directors n-k+1 numbers -- the total income of the company for each k consecutive months. In other words, for each i between 1 and n-k+1 he will say the value a_i + a_{i+1} + ldots + a_{i + k - 1} . For example, if a=[-1, 0, 1, 2, 2] and k=3 he will say the numbers 0, 3, 5 . Unfortunately, if at least one total income reported by Levian is not a profit (income <= 0 ), the directors will get angry and fire the failed accountant. Save Levian's career: find any such k , that for each k months in a row the company had made a profit, or report that it is impossible. The first line contains a single integer n ( 2 <= n <= 5 cdot 10^5 ) -- the number of months for which Levian must account. The second line contains lceil{ frac{n}{2}} rceil integers a_1, a_2, ldots, a_{ lceil{ frac{n}{2}} rceil} , where a_i ( -10^9 <= a_i <= 10^9 ) -- the income of the company in the i -th month. Third line contains a single integer x ( -10^9 <= x <= 10^9 ) -- income in every month from lceil{ frac{n}{2}} rceil + 1 to n . In a single line, print the appropriate integer k or -1 , if it does not exist. If there are multiple possible answers, you can print any. In the first example, k=2 and k=3 satisfy: in the first case, Levian will report the numbers 1, 1 , "...

Tutorials

Codeforces Round #645 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
81583635 w190971822 E May 27, 2020, 5:33 a.m. OK GNU C++11 TESTS 136 46 3276800 2400
81572683 2018LZY E May 27, 2020, 1:48 a.m. OK GNU C++11 TESTS 136 46 6041600 2400
81531017 J_B_Y E May 26, 2020, 3:58 p.m. OK GNU C++11 TESTS 130 46 6041600 2400
81592958 wasa855 E May 27, 2020, 7:31 a.m. OK GNU C++11 TESTS 136 46 7987200 2400
81574181 msuwakow E May 27, 2020, 2:35 a.m. OK GNU C++11 TESTS 136 46 8192000 2400
81713580 ASC_8384 E May 28, 2020, 2:18 p.m. OK GNU C++11 TESTS 141 46 8294400 2400
81688130 YHHxBULIATANIA E May 28, 2020, 8:58 a.m. OK GNU C++11 TESTS 141 46 8294400 2400
81684269 brined_fish E May 28, 2020, 8:13 a.m. OK GNU C++11 TESTS 141 46 8294400 2400
81617194 LOVE_YJZ E May 27, 2020, 12:24 p.m. OK GNU C++11 TESTS 136 46 8294400 2400
81576068 hdu_daicon E May 27, 2020, 3:12 a.m. OK GNU C++11 TESTS 136 46 8294400 2400
81591803 idxcalcal E May 27, 2020, 7:16 a.m. OK GNU C++14 TESTS 136 46 21094400 2400
81577831 kaffuchino E May 27, 2020, 3:46 a.m. OK GNU C++14 TESTS 136 93 2048000 2400
81649608 ayushgupta_ E May 27, 2020, 7:02 p.m. OK GNU C++14 TESTS 137 93 2252800 2400
81649465 Error_404 E May 27, 2020, 6:59 p.m. OK GNU C++14 TESTS 137 93 2252800 2400
81586872 BeTheStar27 E May 27, 2020, 6:15 a.m. OK GNU C++14 TESTS 136 93 2252800 2400
81551305 txingml E May 26, 2020, 5:47 p.m. OK GNU C++14 TESTS 130 93 2662400 2400
81645137 killforcode E May 27, 2020, 5:42 p.m. OK GNU C++14 TESTS 137 93 3276800 2400
81563915 shreyasbalakrishna19 E May 26, 2020, 8:45 p.m. OK GNU C++14 TESTS 133 93 4300800 2400
81563379 oridya_fan E May 26, 2020, 8:33 p.m. OK GNU C++14 TESTS 133 93 4300800 2400
81561225 oridya_fan E May 26, 2020, 7:52 p.m. OK GNU C++14 TESTS 131 93 4300800 2400
81532124 LayCurse E May 26, 2020, 4:01 p.m. OK GNU C++17 TESTS 130 46 10342400 2400
81594567 CQXYM E May 27, 2020, 7:52 a.m. OK GNU C++17 TESTS 136 62 3276800 2400
81594658 CR400BF-5033 E May 27, 2020, 7:53 a.m. OK GNU C++17 TESTS 136 78 2252800 2400
81605130 JBer E May 27, 2020, 10:03 a.m. OK GNU C++17 TESTS 136 78 4198400 2400
81556710 Nanored E May 26, 2020, 6:42 p.m. OK GNU C++17 TESTS 130 93 2252800 2400
81629937 plekkpea E May 27, 2020, 2:45 p.m. OK GNU C++17 TESTS 136 93 2764800 2400
81541686 camilla E May 26, 2020, 4:23 p.m. OK GNU C++17 TESTS 130 93 4096000 2400
81616879 Coxie E May 27, 2020, 12:21 p.m. OK GNU C++17 TESTS 136 93 4300800 2400
81609484 qfhy E May 27, 2020, 10:59 a.m. OK GNU C++17 TESTS 136 93 5017600 2400
81577363 yeeeet E May 27, 2020, 3:36 a.m. OK GNU C++17 TESTS 136 93 5427200 2400
81576687 QAQAutoMaton E May 27, 2020, 3:24 a.m. OK GNU C++17 (64) TESTS 136 46 20275200 2400
81549771 uruuru8888 E May 26, 2020, 5:30 p.m. OK GNU C++17 (64) TESTS 130 62 2048000 2400
81560149 _oscar_S21 E May 26, 2020, 7:34 p.m. OK GNU C++17 (64) TESTS 130 62 2662400 2400
81584744 zjsdut E May 27, 2020, 5:48 a.m. OK GNU C++17 (64) TESTS 136 77 1024000 2400
81710622 MotoForces E May 28, 2020, 1:43 p.m. OK GNU C++17 (64) TESTS 141 77 2048000 2400
81534742 ransewhale E May 26, 2020, 4:07 p.m. OK GNU C++17 (64) TESTS 130 77 2252800 2400
81655554 msporyshev E May 27, 2020, 9:04 p.m. OK GNU C++17 (64) TESTS 139 77 3993600 2400
81652644 ManavJ07 E May 27, 2020, 7:57 p.m. OK GNU C++17 (64) TESTS 138 77 3993600 2400
81639039 heisenberg1410 E May 27, 2020, 4:27 p.m. OK GNU C++17 (64) TESTS 136 77 3993600 2400
81637164 heisenberg1410 E May 27, 2020, 4:04 p.m. OK GNU C++17 (64) TESTS 136 77 3993600 2400
81624056 synapse E May 27, 2020, 1:41 p.m. OK Go TESTS 136 218 6758400 2400
81679572 avijit_agarwal E May 28, 2020, 7:12 a.m. OK Java 11 TESTS 140 202 0 2400
81576243 irredeemablyalone E May 27, 2020, 3:16 a.m. OK Java 11 TESTS 136 234 4096000 2400
81599010 zhupeijun E May 27, 2020, 8:44 a.m. OK Java 11 TESTS 136 249 4096000 2400
81569182 egaeus.code E May 26, 2020, 11:53 p.m. OK Java 11 TESTS 135 249 5734400 2400
81591502 PizzaLovers007 E May 27, 2020, 7:12 a.m. OK Java 11 TESTS 136 405 307200 2400
81540451 you.maxwell E May 26, 2020, 4:21 p.m. OK Java 11 TESTS 130 763 41472000 2400
81570816 derrick20 E May 27, 2020, 12:49 a.m. OK Java 8 TESTS 135 140 0 2400
81658407 polyakoff E May 27, 2020, 10:43 p.m. OK Java 8 TESTS 140 186 17100800 2400
81696767 reborn.chris E May 28, 2020, 10:48 a.m. OK Java 8 TESTS 141 202 0 2400
81664319 Spheniscine E May 28, 2020, 2:39 a.m. OK Kotlin TESTS 140 171 0 2400
81630910 liouzhou_101 E May 27, 2020, 2:56 p.m. OK Kotlin TESTS 136 202 18841600 2400
81556028 Tlatoani E May 26, 2020, 6:33 p.m. OK Kotlin TESTS 130 249 27750400 2400
81540958 jonas.havelka.42 E May 26, 2020, 4:22 p.m. OK Kotlin TESTS 130 436 33177600 2400
81659391 moptranzistor E May 27, 2020, 11:33 p.m. OK Kotlin TESTS 140 451 33177600 2400
81604843 cristian1997 E May 27, 2020, 10 a.m. OK Kotlin TESTS 136 467 33177600 2400
81604879 cristian1997 E May 27, 2020, 10 a.m. OK Kotlin TESTS 136 483 34918400 2400
81539485 EmK E May 26, 2020, 4:19 p.m. OK Mono C# TESTS 130 155 11776000 2400
81622737 avtoruxadze E May 27, 2020, 1:25 p.m. OK Mono C# TESTS 136 186 39116800 2400
81659347 teru E May 27, 2020, 11:31 p.m. OK Mono C# TESTS 140 186 43110400 2400
81640953 _Trung_Nguyen E May 27, 2020, 4:50 p.m. OK Mono C# TESTS 136 187 40038400 2400
81538547 keymoon E May 26, 2020, 4:16 p.m. OK Mono C# TESTS 130 202 45363200 2400
81535130 Yupiteru E May 26, 2020, 4:08 p.m. OK Mono C# TESTS 130 561 29593600 2400
81546362 P___ E May 26, 2020, 4:33 p.m. OK MS C++ 2017 TESTS 130 108 6041600 2400
81619228 ningBr E May 27, 2020, 12:45 p.m. OK MS C++ 2017 TESTS 136 109 7987200 2400
81693570 wp32pw E May 28, 2020, 10:06 a.m. OK MS C++ 2017 TESTS 141 109 9011200 2400
81656316 P___ E May 27, 2020, 9:28 p.m. OK MS C++ 2017 TESTS 140 124 6246400 2400
81666185 P___ E May 28, 2020, 3:22 a.m. OK MS C++ 2017 TESTS 140 124 6246400 2400
81656384 P___ E May 27, 2020, 9:30 p.m. OK MS C++ 2017 TESTS 140 124 6246400 2400
81619926 ningBr E May 27, 2020, 12:52 p.m. OK MS C++ 2017 TESTS 136 124 7987200 2400
81547443 kupriyanov E May 26, 2020, 4:34 p.m. OK MS C++ 2017 TESTS 130 264 8294400 2400
81603602 Najmus_Sakib_Rashid E May 27, 2020, 9:43 a.m. OK MS C++ 2017 TESTS 136 265 7987200 2400
81659392 yumtam E May 27, 2020, 11:33 p.m. OK PyPy 2 TESTS 140 264 24166400 2400
81627152 glucose E May 27, 2020, 2:16 p.m. OK PyPy 3 TESTS 136 249 25088000 2400
81555323 throwawayatcoder E May 26, 2020, 6:24 p.m. OK PyPy 3 TESTS 130 327 43929600 2400
81578333 siyy E May 27, 2020, 3:56 a.m. OK PyPy 3 TESTS 136 373 47206400 2400
81652582 titia E May 27, 2020, 7:56 p.m. OK PyPy 3 TESTS 138 405 23040000 2400
81652662 titia E May 27, 2020, 7:57 p.m. OK PyPy 3 TESTS 138 405 24985600 2400
81620124 16it030 E May 27, 2020, 12:55 p.m. OK PyPy 3 TESTS 136 420 22016000 2400
81598914 ileixe E May 27, 2020, 8:43 a.m. OK PyPy 3 TESTS 136 421 27955200 2400
81559568 nehan_der_thal E May 26, 2020, 7:24 p.m. OK PyPy 3 TESTS 130 436 22425600 2400
81620846 16it030 E May 27, 2020, 1:03 p.m. OK PyPy 3 TESTS 136 436 22528000 2400
81540809 hir35 E May 26, 2020, 4:21 p.m. OK PyPy 3 TESTS 130 451 23654400 2400
81535223 nwi E May 26, 2020, 4:08 p.m. OK Python 2 TESTS 130 389 13516800 2400
81669310 mkawa2 E May 28, 2020, 4:36 a.m. OK Python 3 TESTS 140 296 20480000 2400
81693250 1194code E May 28, 2020, 10:02 a.m. OK Python 3 TESTS 141 342 20377600 2400
81605982 zhenfisher E May 27, 2020, 10:14 a.m. OK Python 3 TESTS 136 373 21401600 2400
81632450 sawhil E May 27, 2020, 3:12 p.m. OK Python 3 TESTS 136 452 26214400 2400
81564662 old_boo E May 26, 2020, 9:02 p.m. OK Python 3 TESTS 133 467 20582400 2400

remove filters

Back to search problems