Educational Codeforces Round 137 (Rated for 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
1743 Educational Codeforces Round 137 (Rated for Div. 2) FINISHED False 7200 71249063 Oct. 17, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 19477 ) C Save the Magazines PROGRAMMING constructive algorithms greedy sortings string suffix structures 1100

B"Monocarp has been collecting rare magazines for quite a while, and now he has decided to sell them. He distributed the magazines between n boxes, arranged in a row. The i -th box contains a_i magazines. Some of the boxes are covered with lids, others are not. Suddenly it started to rain, and now Monocarp has to save as many magazines from the rain as possible. To do this, he can move the lids between boxes as follows: if the i -th box was covered with a lid initially, he can either move the lid from the i -th box to the box (i-1) (if it exists), or keep the lid on the i -th box. You may assume that Monocarp can move the lids instantly at the same moment, and no lid can be moved more than once. If a box will be covered with a lid after Monocarp moves the lids, the magazines in it will be safe from the rain; otherwise they will soak. You have to calculate the maximum number of magazines Monocarp can save from the rain. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of the testcases. The first line of each testcase contains a single integer n ( 1 <= n <= 2 cdot 10^5 ) -- the number of boxes. The second line contains a string of n characters 0 and/or 1. If the i -th character is 1, the i -th box is initially covered with a lid. If the i -th character is 0, the i -th box is initially not covered. The third line contains a sequence of integers a_1, a_2, ... , a_n ( 1 <= a_i <= 10^4 ), where a_i is the number of magazines in the i -th box. The sum of n over all testcases doesn't exceed 2 cdot 10^5 . For each testcase, print one integer -- the maximum number of magazines Monocarp can save from the rain. In the first testcase of the example, Monocarp can move the lid from the second box to the first box, so the boxes 1 , 3 and 4 are covered, and 10 + 8 + 9 = 27 magazines are saved. In"...

Tutorials

Educational Codeforces Round 137 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
176781667 solutionhacker21 C Oct. 17, 2022, 4:51 p.m. OK Clang++20 Diagnostics TESTS 7 717 14643200 1100
176772746 yeshwanthkrishna37 C Oct. 17, 2022, 4:26 p.m. OK GNU C11 TESTS 7 46 1024000 1100
176772843 loki_7 C Oct. 17, 2022, 4:26 p.m. OK GNU C11 TESTS 7 62 1638400 1100
176812809 CuiZhenhang C Oct. 17, 2022, 10:36 p.m. OK GNU C++14 TESTS 7 15 2048000 1100
176828244 WulongQAQ C Oct. 18, 2022, 4:20 a.m. OK GNU C++14 TESTS 7 31 1024000 1100
176815623 behuymummim C Oct. 18, 2022, 12:08 a.m. OK GNU C++14 TESTS 7 31 1331200 1100
176820613 Leasier C Oct. 18, 2022, 2:10 a.m. OK GNU C++14 TESTS 7 31 1740800 1100
176781509 sharyash C Oct. 17, 2022, 4:50 p.m. OK GNU C++14 TESTS 7 31 2867200 1100
176783895 newsheep C Oct. 17, 2022, 5:03 p.m. OK GNU C++14 TESTS 7 46 204800 1100
176816690 Daniel777 C Oct. 18, 2022, 12:40 a.m. OK GNU C++14 TESTS 7 46 1024000 1100
176820844 Freed0m8197 C Oct. 18, 2022, 2:14 a.m. OK GNU C++14 TESTS 7 46 1228800 1100
176836094 mahir1 C Oct. 18, 2022, 6:02 a.m. OK GNU C++14 TESTS 7 46 1331200 1100
176835395 MohamedEmadO_O C Oct. 18, 2022, 5:54 a.m. OK GNU C++14 TESTS 7 46 1331200 1100
176827509 ZiFeii C Oct. 18, 2022, 4:08 a.m. OK GNU C++17 TESTS 7 31 5017600 1100
176798084 F_O_R_H_A_D__15 C Oct. 17, 2022, 6:58 p.m. OK GNU C++17 TESTS 7 31 5324800 1100
176828971 XiaoWhy C Oct. 18, 2022, 4:31 a.m. OK GNU C++17 TESTS 7 46 1024000 1100
176823228 jhdonghj112 C Oct. 18, 2022, 2:55 a.m. OK GNU C++17 TESTS 7 46 1024000 1100
176818151 wowo123123 C Oct. 18, 2022, 1:16 a.m. OK GNU C++17 TESTS 7 46 1024000 1100
176816983 QwQ_3 C Oct. 18, 2022, 12:48 a.m. OK GNU C++17 TESTS 7 46 1024000 1100
176804809 Gold_Dragon C Oct. 17, 2022, 8:14 p.m. OK GNU C++17 TESTS 7 46 1024000 1100
176790746 Mark2012 C Oct. 17, 2022, 5:52 p.m. OK GNU C++17 TESTS 7 46 1024000 1100
176830401 kenai C Oct. 18, 2022, 4:54 a.m. OK GNU C++17 TESTS 7 46 1024000 1100
176829942 hongy666 C Oct. 18, 2022, 4:46 a.m. OK GNU C++17 TESTS 7 46 1024000 1100
176817485 J_B_Y C Oct. 18, 2022, 1:01 a.m. OK GNU C++17 (64) TESTS 7 15 1638400 1100
176788094 Mohammed_faizan C Oct. 17, 2022, 5:32 p.m. OK GNU C++17 (64) TESTS 7 31 1331200 1100
176782323 Jame___boy C Oct. 17, 2022, 4:54 p.m. OK GNU C++17 (64) TESTS 7 31 1331200 1100
176821646 cheng1202 C Oct. 18, 2022, 2:28 a.m. OK GNU C++17 (64) TESTS 7 31 1331200 1100
176833338 Huntik_03 C Oct. 18, 2022, 5:31 a.m. OK GNU C++17 (64) TESTS 7 31 1331200 1100
176779026 ShahedRabbbi C Oct. 17, 2022, 4:39 p.m. OK GNU C++17 (64) TESTS 7 31 1331200 1100
176785431 illume2021 C Oct. 17, 2022, 5:13 p.m. OK GNU C++17 (64) TESTS 7 31 1536000 1100
176811396 rezidentura C Oct. 17, 2022, 9:59 p.m. OK GNU C++17 (64) TESTS 7 31 2048000 1100
176794652 Sohaila_Elwaleed C Oct. 17, 2022, 6:25 p.m. OK GNU C++17 (64) TESTS 7 31 2150400 1100
176828139 Rick_GT C Oct. 18, 2022, 4:18 a.m. OK GNU C++17 (64) TESTS 7 31 2150400 1100
176812115 Thallium54 C Oct. 17, 2022, 10:17 p.m. OK GNU C++20 (64) TESTS 7 15 1331200 1100
176827488 SummerWind C Oct. 18, 2022, 4:07 a.m. OK GNU C++20 (64) TESTS 7 15 1331200 1100
176821024 the_ilyas C Oct. 18, 2022, 2:18 a.m. OK GNU C++20 (64) TESTS 7 15 1331200 1100
176791892 Broken_Sword C Oct. 17, 2022, 6:01 p.m. OK GNU C++20 (64) TESTS 7 15 2150400 1100
176803717 Endeavors C Oct. 17, 2022, 8:01 p.m. OK GNU C++20 (64) TESTS 7 30 1331200 1100
176816183 pingyyds C Oct. 18, 2022, 12:24 a.m. OK GNU C++20 (64) TESTS 7 30 1331200 1100
176831469 Code_Morghulis C Oct. 18, 2022, 5:07 a.m. OK GNU C++20 (64) TESTS 7 30 2150400 1100
176826297 12662 C Oct. 18, 2022, 3:48 a.m. OK GNU C++20 (64) TESTS 7 30 2150400 1100
176798020 UtTaRaN C Oct. 17, 2022, 6:57 p.m. OK GNU C++20 (64) TESTS 7 30 2150400 1100
176784031 MeDoCodeIs C Oct. 17, 2022, 5:04 p.m. OK GNU C++20 (64) TESTS 7 30 2150400 1100
176820488 hghgh C Oct. 18, 2022, 2:07 a.m. OK Go TESTS 7 78 4096000 1100
176795760 Hasker C Oct. 17, 2022, 6:35 p.m. OK Haskell TESTS 7 46 4198400 1100
176815225 jhariharan99official C Oct. 17, 2022, 11:53 p.m. OK Java 11 TESTS 7 186 0 1100
176778187 Spidey2182 C Oct. 17, 2022, 4:37 p.m. OK Java 11 TESTS 7 202 0 1100
176823603 aditya2024 C Oct. 18, 2022, 3:02 a.m. OK Java 11 TESTS 7 233 716800 1100
176781144 harsh_gupta_1705 C Oct. 17, 2022, 4:48 p.m. OK Java 11 TESTS 7 233 12902400 1100
176796361 Jackyjuman C Oct. 17, 2022, 6:40 p.m. OK Java 11 TESTS 7 249 0 1100
176794635 Saurabh_jayaswal C Oct. 17, 2022, 6:25 p.m. OK Java 11 TESTS 7 264 0 1100
176816763 yadavdipesh C Oct. 18, 2022, 12:42 a.m. OK Java 11 TESTS 7 265 0 1100
176782779 tanish_1131 C Oct. 17, 2022, 4:56 p.m. OK Java 11 TESTS 7 265 1126400 1100
176835611 yknischal C Oct. 18, 2022, 5:56 a.m. OK Java 11 TESTS 7 280 17203200 1100
176828223 emoyu C Oct. 18, 2022, 4:19 a.m. OK Java 11 TESTS 7 389 0 1100
176794944 harsh.bhandari.v C Oct. 17, 2022, 6:27 p.m. OK Java 17 TESTS 7 218 102400 1100
176790955 Nika_Tamliani C Oct. 17, 2022, 5:53 p.m. OK Java 17 TESTS 7 218 512000 1100
176828075 anuragkr898 C Oct. 18, 2022, 4:17 a.m. OK Java 17 TESTS 7 233 1024000 1100
176793311 Ali04 C Oct. 17, 2022, 6:13 p.m. OK Java 17 TESTS 7 233 1945600 1100
176796661 harman1148 C Oct. 17, 2022, 6:43 p.m. OK Java 17 TESTS 7 233 10342400 1100
176780516 anuragkr898 C Oct. 17, 2022, 4:45 p.m. OK Java 17 TESTS 7 234 307200 1100
176787124 liomsv C Oct. 17, 2022, 5:25 p.m. OK Java 17 TESTS 7 249 0 1100
176782535 tony4875 C Oct. 17, 2022, 4:55 p.m. OK Java 17 TESTS 7 249 0 1100
176799134 Eslam_Ahmed C Oct. 17, 2022, 7:10 p.m. OK Java 17 TESTS 7 249 409600 1100
176797302 Eslam_Ahmed C Oct. 17, 2022, 6:50 p.m. OK Java 17 TESTS 7 264 1945600 1100
176825913 guinnod C Oct. 18, 2022, 3:42 a.m. OK Java 8 TESTS 7 124 0 1100
176818084 jkslyk C Oct. 18, 2022, 1:15 a.m. OK Java 8 TESTS 7 124 0 1100
176817794 swarup_312 C Oct. 18, 2022, 1:09 a.m. OK Java 8 TESTS 7 124 0 1100
176807567 Rayhan_07 C Oct. 17, 2022, 8:49 p.m. OK Java 8 TESTS 7 124 0 1100
176798853 Ketchup_Is_A_Vegetable C Oct. 17, 2022, 7:07 p.m. OK Java 8 TESTS 7 124 0 1100
176784112 raj_shahh C Oct. 17, 2022, 5:04 p.m. OK Java 8 TESTS 7 124 0 1100
176806797 pakkapapad C Oct. 17, 2022, 8:40 p.m. OK Java 8 TESTS 7 124 1024000 1100
176805260 Mohamed308 C Oct. 17, 2022, 8:20 p.m. OK Java 8 TESTS 7 139 1024000 1100
176797673 Dark_Knight_07 C Oct. 17, 2022, 6:53 p.m. OK Java 8 TESTS 7 139 1024000 1100
176800976 invincible777 C Oct. 17, 2022, 7:29 p.m. OK Java 8 TESTS 7 139 12390400 1100
176817493 lxllxs C Oct. 18, 2022, 1:01 a.m. OK MS C++ 2017 TESTS 7 93 1638400 1100
176772840 WUT_ZJL C Oct. 17, 2022, 4:26 p.m. OK MS C++ 2017 TESTS 7 140 614400 1100
176795252 adesh123 C Oct. 17, 2022, 6:30 p.m. OK MS C++ 2017 TESTS 7 156 2764800 1100
176818453 Alex0304 C Oct. 18, 2022, 1:24 a.m. OK MS C++ 2017 TESTS 7 187 1638400 1100
176774087 koynov C Oct. 17, 2022, 4:28 p.m. OK MS C++ 2017 TESTS 7 187 2662400 1100
176782918 viswaviswa236 C Oct. 17, 2022, 4:57 p.m. OK Node.js TESTS 7 202 15052800 1100
176784482 yeling C Oct. 17, 2022, 5:07 p.m. OK Node.js TESTS 7 280 28467200 1100
176790637 rsFalse C Oct. 17, 2022, 5:51 p.m. OK Perl TESTS 7 326 47820800 1100
176788483 rsFalse C Oct. 17, 2022, 5:34 p.m. OK Perl TESTS 7 498 35430400 1100
176799614 Yash_Nandwana C Oct. 17, 2022, 7:15 p.m. OK PyPy 3 TESTS 7 186 17305600 1100
176832381 0x7f_ C Oct. 18, 2022, 5:20 a.m. OK PyPy 3 TESTS 7 264 21504000 1100
176779232 MohamedHamed123 C Oct. 17, 2022, 4:40 p.m. OK PyPy 3 TESTS 7 312 31744000 1100
176824289 bokunopicolo C Oct. 18, 2022, 3:14 a.m. OK PyPy 3 TESTS 7 389 17817600 1100
176786846 konstruktor C Oct. 17, 2022, 5:23 p.m. OK PyPy 3 TESTS 7 405 14643200 1100
176789153 kp_2141 C Oct. 17, 2022, 5:39 p.m. OK PyPy 3 TESTS 7 467 18124800 1100
176784926 34z12000 C Oct. 17, 2022, 5:10 p.m. OK PyPy 3 TESTS 7 483 14540800 1100
176795414 kp_2141 C Oct. 17, 2022, 6:31 p.m. OK PyPy 3 TESTS 7 498 18227200 1100
176785308 aneesh2002 C Oct. 17, 2022, 5:12 p.m. OK PyPy 3 TESTS 7 545 19046400 1100
176813301 crapcode C Oct. 17, 2022, 10:50 p.m. OK PyPy 3-64 TESTS 7 93 20275200 1100
176800199 mrdhnv C Oct. 17, 2022, 7:21 p.m. OK PyPy 3-64 TESTS 7 109 20992000 1100
176813242 crapcode C Oct. 17, 2022, 10:48 p.m. OK PyPy 3-64 TESTS 7 124 28876800 1100
176833876 fan_of_tourist C Oct. 18, 2022, 5:38 a.m. OK PyPy 3-64 TESTS 7 140 27340800 1100
176774499 omar.gawdat C Oct. 17, 2022, 4:29 p.m. OK PyPy 3-64 TESTS 7 156 26521600 1100
176782463 SophieHatter C Oct. 17, 2022, 4:55 p.m. OK PyPy 3-64 TESTS 7 171 28672000 1100
176827573 kwin C Oct. 18, 2022, 4:09 a.m. OK PyPy 3-64 TESTS 7 202 29081600 1100
176804274 vim1729 C Oct. 17, 2022, 8:07 p.m. OK PyPy 3-64 TESTS 7 218 37785600 1100
176775055 Yedige C Oct. 17, 2022, 4:30 p.m. OK PyPy 3-64 TESTS 7 233 28364800 1100
176780424 bekbolbolatov C Oct. 17, 2022, 4:45 p.m. OK PyPy 3-64 TESTS 7 342 37888000 1100
176776833 Ray_29 C Oct. 17, 2022, 4:33 p.m. OK Python 3 TESTS 7 186 14131200 1100
176780271 kanth_7 C Oct. 17, 2022, 4:44 p.m. OK Python 3 TESTS 7 187 13414400 1100
176774933 zl2889 C Oct. 17, 2022, 4:30 p.m. OK Python 3 TESTS 7 187 14131200 1100
176805321 Code777 C Oct. 17, 2022, 8:21 p.m. OK Python 3 TESTS 7 187 14745600 1100
176792493 notxkaran C Oct. 17, 2022, 6:06 p.m. OK Python 3 TESTS 7 187 14745600 1100
176823480 eugalt C Oct. 18, 2022, 3 a.m. OK Python 3 TESTS 7 202 10752000 1100
176822102 hp685 C Oct. 18, 2022, 2:36 a.m. OK Python 3 TESTS 7 202 13824000 1100
176813139 eugalt C Oct. 17, 2022, 10:45 p.m. OK Python 3 TESTS 7 202 14028800 1100
176812682 eugalt C Oct. 17, 2022, 10:33 p.m. OK Python 3 TESTS 7 202 14028800 1100
176773131 rohith39021 C Oct. 17, 2022, 4:26 p.m. OK Python 3 TESTS 7 202 14131200 1100
176815141 IorMemorE C Oct. 17, 2022, 11:49 p.m. OK Rust 2021 TESTS 7 140 5836800 1100

remove filters

Back to search problems