Codeforces Round 935 (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
1945 Codeforces Round 935 (Div. 3) FINISHED False 8100 20987699 March 19, 2024, 8:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 14553 ) D Seraphim the Owl PROGRAMMING greedy

B"The guys lined up in a queue of n people, starting with person number i = 1 , to ask Serafim the Owl about the meaning of life. Unfortunately, Kirill was very busy writing the legend for this problem, so he arrived a little later and stood at the end of the line after the n -th person. Kirill is completely dissatisfied with this situation, so he decided to bribe some people ahead of him. For the i -th person in the queue, Kirill knows two values: a_i and b_i . If at the moment Kirill is standing at position i , then he can choose any position j such that j < i and exchange places with the person at position j . In this case, Kirill will have to pay him a_j coins. And for each k such that j < k < i , Kirill will have to pay b_k coins to the person at position k . Kirill can perform this action any number of times. Kirill is thrifty, so he wants to spend as few coins as possible, but he doesn't want to wait too long, so Kirill believes he should be among the first m people in line. Help Kirill determine the minimum number of coins he will have to spend in order to not wait too long. Each test consists of several sets of input data. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. Then follows the description of the test case. The first line of each test case contains two integers n and m ( 1 <= m <= n <= 200 ,000 ) -- the number of people in the queue besides Kirill and the maximum allowable final position of Kirill, respectively. The second line contains n integers a_1, a_2, ... , a_n separated by spaces ( 1 <= a_i <= 10^9 ). The third line contains n integers b_1, b_2, ... , b_n separated by spaces ( 1 <= b_i <= 10^9 ). It is guaranteed that the sum of the values of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output a"...

Tutorials

127377

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
252319834 Jord8061 D March 19, 2024, 3:13 p.m. OK C++14 (GCC 6-32) TESTS 26 109 1638400
252332399 raj_robin D March 19, 2024, 4:26 p.m. OK C++14 (GCC 6-32) TESTS 26 109 2150400
252330128 dreamoon_love_AA D March 19, 2024, 4:12 p.m. OK C++14 (GCC 6-32) TESTS 26 124 1638400
252393345 crapatx18 D March 20, 2024, 5:07 a.m. OK C++14 (GCC 6-32) TESTS 26 124 3174400
252386161 OrewaMonkeyDLuffy D March 20, 2024, 3:21 a.m. OK C++14 (GCC 6-32) TESTS 26 124 3174400
252381767 prabalpsingh7115 D March 20, 2024, 2:07 a.m. OK C++14 (GCC 6-32) TESTS 26 124 3174400
252378949 nijuusei_A D March 20, 2024, 1:14 a.m. OK C++14 (GCC 6-32) TESTS 26 124 3174400
252378619 yaotianhao0906 D March 20, 2024, 1:07 a.m. OK C++14 (GCC 6-32) TESTS 26 124 3174400
252368396 Aya_S D March 19, 2024, 9:50 p.m. OK C++14 (GCC 6-32) TESTS 26 124 3174400
252368312 Aya_S D March 19, 2024, 9:49 p.m. OK C++14 (GCC 6-32) TESTS 26 124 3174400
252378545 liuhao24 D March 20, 2024, 1:06 a.m. OK C++17 (GCC 7-32) TESTS 26 31 4915200
252301050 RomyStiQuE D March 19, 2024, 1:25 p.m. OK C++17 (GCC 7-32) TESTS 26 31 5529600
252386494 Sealy D March 20, 2024, 3:26 a.m. OK C++17 (GCC 7-32) TESTS 26 109 1638400
252384573 zhuaiballl D March 20, 2024, 2:56 a.m. OK C++17 (GCC 7-32) TESTS 26 109 1638400
252377046 Mustafa_Elghisha D March 20, 2024, 12:36 a.m. OK C++17 (GCC 7-32) TESTS 26 109 1638400
252318439 void_3 D March 19, 2024, 3:05 p.m. OK C++17 (GCC 7-32) TESTS 26 109 1638400
252304738 NULL_SF D March 19, 2024, 1:46 p.m. OK C++17 (GCC 7-32) TESTS 26 109 3174400
252318005 Lwh1019 D March 19, 2024, 3:02 p.m. OK C++17 (GCC 7-32) TESTS 26 109 7065600
252395177 adityamukhija D March 20, 2024, 5:27 a.m. OK C++17 (GCC 7-32) TESTS 26 124 1638400
252394897 jasonray0328 D March 20, 2024, 5:24 a.m. OK C++17 (GCC 7-32) TESTS 26 124 1638400
252355267 its_harry D March 19, 2024, 7:21 p.m. OK C++20 (GCC 13-64) TESTS 26 62 1638400
252385028 Marckess D March 20, 2024, 3:03 a.m. OK C++20 (GCC 13-64) TESTS 26 62 3276800
252374293 HumanWorld D March 19, 2024, 11:37 p.m. OK C++20 (GCC 13-64) TESTS 26 62 3276800
252371498 Mysterious109 D March 19, 2024, 10:42 p.m. OK C++20 (GCC 13-64) TESTS 26 62 3276800
252357181 newborn_23 D March 19, 2024, 7:40 p.m. OK C++20 (GCC 13-64) TESTS 26 62 4812800
252318737 qqwrv D March 19, 2024, 3:07 p.m. OK C++20 (GCC 13-64) TESTS 26 77 1638400
252368510 gbula D March 19, 2024, 9:51 p.m. OK C++20 (GCC 13-64) TESTS 26 77 3276800
252367960 CodeBot5621 D March 19, 2024, 9:44 p.m. OK C++20 (GCC 13-64) TESTS 26 77 3276800
252359008 Shoeib D March 19, 2024, 7:59 p.m. OK C++20 (GCC 13-64) TESTS 26 77 3276800
252334366 C0ldSmi1e D March 19, 2024, 4:39 p.m. OK C++20 (GCC 13-64) TESTS 26 77 4812800
252344138 SimoFerri D March 19, 2024, 5:49 p.m. OK GNU C11 TESTS 26 108 3481600
252307516 Seansq D March 19, 2024, 2:01 p.m. OK GNU C11 TESTS 26 109 3481600
252303082 Istiyak1264 D March 19, 2024, 1:36 p.m. OK GNU C11 TESTS 26 124 2355200
252314484 sleepntsheep D March 19, 2024, 2:42 p.m. OK GNU C11 TESTS 26 124 3481600
252317509 sa1L D March 19, 2024, 2:59 p.m. OK Go TESTS 26 77 6860800
252320377 E.M.T. D March 19, 2024, 3:16 p.m. OK Go TESTS 26 249 9830400
252347358 priyaroy3370 D March 19, 2024, 6:12 p.m. OK Java 21 TESTS 26 312 204800
252316340 mohit1510 D March 19, 2024, 2:53 p.m. OK Java 21 TESTS 26 358 7475200
252348889 me6 D March 19, 2024, 6:24 p.m. OK Java 21 TESTS 26 374 6656000
252395213 ChongQY D March 20, 2024, 5:28 a.m. OK Java 21 TESTS 26 389 11571200
252308430 yang_wei D March 19, 2024, 2:07 p.m. OK Java 21 TESTS 26 404 102400
252337952 RiceTofu D March 19, 2024, 5:04 p.m. OK Java 21 TESTS 26 421 16076800
252356629 newborn_23 D March 19, 2024, 7:35 p.m. OK Java 21 TESTS 26 436 10035200
252319914 Hemanidhi_18 D March 19, 2024, 3:13 p.m. OK Java 21 TESTS 26 545 40652800
252313497 vinayak_20 D March 19, 2024, 2:36 p.m. OK Java 21 TESTS 26 935 921600
252395547 tanishgoyal16 D March 20, 2024, 5:31 a.m. OK Java 21 TESTS 26 951 4403200
252371088 etian6795 D March 19, 2024, 10:34 p.m. OK Java 8 TESTS 26 218 13516800
252336931 achyut88 D March 19, 2024, 4:57 p.m. OK Java 8 TESTS 26 218 14643200
252311030 ragequitting101 D March 19, 2024, 2:22 p.m. OK Java 8 TESTS 26 233 14643200
252370187 Shenta D March 19, 2024, 10:18 p.m. OK Java 8 TESTS 26 249 11776000
252311432 Billert D March 19, 2024, 2:24 p.m. OK Java 8 TESTS 26 280 17817600
252320236 WindLY D March 19, 2024, 3:15 p.m. OK Java 8 TESTS 26 327 19353600
252319337 mada-mada D March 19, 2024, 3:10 p.m. OK Java 8 TESTS 26 405 35635200
252325870 Mr_A D March 19, 2024, 3:46 p.m. OK Java 8 TESTS 26 670 0
252362982 Maheshwari_Saksham D March 19, 2024, 8:43 p.m. OK Java 8 TESTS 26 685 0
252312151 Lakshay429 D March 19, 2024, 2:28 p.m. OK Java 8 TESTS 26 701 0
252325468 crapcode D March 19, 2024, 3:44 p.m. OK PHP TESTS 26 124 41984000
252309555 maximzasorin D March 19, 2024, 2:13 p.m. OK PHP TESTS 26 124 48332800
252331086 VPriya D March 19, 2024, 4:18 p.m. OK PyPy 3 TESTS 26 842 21504000
252363820 EvGen1u5 D March 19, 2024, 8:53 p.m. OK PyPy 3 TESTS 26 857 21708800
252342621 vishruth_21 D March 19, 2024, 5:37 p.m. OK PyPy 3 TESTS 26 920 32665600
252367387 voicon D March 19, 2024, 9:36 p.m. OK PyPy 3-64 TESTS 26 171 35430400
252364094 Hossam_Hassan_Taher D March 19, 2024, 8:56 p.m. OK PyPy 3-64 TESTS 26 187 35430400
252367801 DRDIV D March 19, 2024, 9:42 p.m. OK PyPy 3-64 TESTS 26 187 35840000
252319835 Mohamed_Hamed D March 19, 2024, 3:13 p.m. OK PyPy 3-64 TESTS 26 202 30310400
252319135 Muhammad_Hamed D March 19, 2024, 3:09 p.m. OK PyPy 3-64 TESTS 26 202 30310400
252368273 MassimoG D March 19, 2024, 9:48 p.m. OK PyPy 3-64 TESTS 26 202 31539200
252340613 gardengnome D March 19, 2024, 5:23 p.m. OK PyPy 3-64 TESTS 26 202 31539200
252356184 Jensen123 D March 19, 2024, 7:30 p.m. OK PyPy 3-64 TESTS 26 202 31641600
252304481 quad_wipe D March 19, 2024, 1:44 p.m. OK PyPy 3-64 TESTS 26 202 32563200
252370827 daszybak D March 19, 2024, 10:29 p.m. OK PyPy 3-64 TESTS 26 217 38400000
252395954 sryMyTrouble D March 20, 2024, 5:36 a.m. OK Python 3 TESTS 26 265 35328000
252389648 harshkankhar1 D March 20, 2024, 4:16 a.m. OK Python 3 TESTS 26 280 34816000
252305692 lucnguyen030608 D March 19, 2024, 1:51 p.m. OK Python 3 TESTS 26 280 36659200
252362805 barvay D March 19, 2024, 8:41 p.m. OK Python 3 TESTS 26 296 36147200
252333367 22H51A6762-Manikanta D March 19, 2024, 4:32 p.m. OK Python 3 TESTS 26 296 36556800
252314449 youknowwho05 D March 19, 2024, 2:41 p.m. OK Python 3 TESTS 26 296 45977600
252346432 dhru72 D March 19, 2024, 6:05 p.m. OK Python 3 TESTS 26 311 36556800
252347836 echopanda D March 19, 2024, 6:16 p.m. OK Python 3 TESTS 26 311 37683200
252306026 Logan2619 D March 19, 2024, 1:53 p.m. OK Python 3 TESTS 26 312 36659200
252304393 s2110676154 D March 19, 2024, 1:44 p.m. OK Python 3 TESTS 26 312 36659200
252368582 0x81 D March 19, 2024, 9:52 p.m. OK Ruby 3 TESTS 26 951 47820800
252325188 AJinGoo D March 19, 2024, 3:43 p.m. OK Rust 2021 TESTS 26 31 13721600

remove filters

Back to search problems