Codeforces Round 1076 (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
2193 Codeforces Round 1076 (Div. 3) FINISHED False 8100 7053923 Jan. 25, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 21313 ) D Monster Game PROGRAMMING binary search sortings two pointers

You have been gifted a new game called "Elatyh". In the game, you are given (n) swords, each with its own strength. In particular, the sword numbered (i) has a strength of (a_i). The game consists of (n) levels, each of which features a monster. You start at level (1) and progress further. To pass level (i) and move on to level (i + 1), you need to defeat the monster at level (i). To defeat the monster at level (i), you need to deal it (b_i) sword strikes. The swords in the game are very fragile, so they can only deal one strike before breaking. If you complete level (n) or run out of swords, you can finish the game and proceed to score calculation. Before the game, you are allowed to choose the difficulty level. If you choose difficulty (x), swords with a strength less than (x) will not affect the monsters. The game score in this case is equal to (x) multiplied by the number of levels completed. Your task is to choose the game difficulty in such a way as to maximize the game score. Each test consists of several test cases. The first line contains a single integer (t) ((1\le t\le 10^4)) — the number of test cases. The following describes the test cases. The first line of each test case contains a single integer (n) ((1\le n\le 2 \cdot 10^5)). The second line of each test case contains (n) integers (a_1, a_2, \dots, a_n) ((1\le a_i\le 10^9)). The third line of each test case contains (n) integers (b_1, b_2, \dots, b_n) ((1\le b_i\le n)). It is guaranteed that the sum of the values of (n) across all test cases does not exceed (2 \cdot 10^5). For each test case, output a single integer — the maximum game score. Consider the first test case. Optimal difficulty to choose is (3). If difficulty is (3), you can deal strikes with swords number (2) and (3). With (2) swords you can complete (1) level, so the game score is (3\cdot 1 = 3).

Tutorials

Разбор Codeforces Round 1076 (Div. 3)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
359905641 Cellz D Jan. 25, 2026, 6:53 p.m. OK C++17 (GCC 7-32) TESTS 5 78 0
359935690 mrpeanuts D Jan. 26, 2026, 4:20 a.m. OK C++17 (GCC 7-32) TESTS 5 93 0
359934638 singhshivendra0109 D Jan. 26, 2026, 4:02 a.m. OK C++17 (GCC 7-32) TESTS 5 93 0
359933437 OmarAfterMidnight D Jan. 26, 2026, 3:41 a.m. OK C++17 (GCC 7-32) TESTS 5 93 0
359933285 Graniteviper101 D Jan. 26, 2026, 3:38 a.m. OK C++17 (GCC 7-32) TESTS 5 93 0
359928346 Alan7 D Jan. 26, 2026, 1:58 a.m. OK C++17 (GCC 7-32) TESTS 5 93 0
359906047 nightmare18 D Jan. 25, 2026, 6:56 p.m. OK C++17 (GCC 7-32) TESTS 5 93 0
359903397 swayamatal28 D Jan. 25, 2026, 6:34 p.m. OK C++17 (GCC 7-32) TESTS 5 93 0
359887581 blackman_akib54 D Jan. 25, 2026, 4:55 p.m. OK C++17 (GCC 7-32) TESTS 5 93 0
359943906 paracompact D Jan. 26, 2026, 5:51 a.m. OK C++17 (GCC 7-32) TESTS 14 93 102400
359915190 patjed41 D Jan. 25, 2026, 8:34 p.m. OK C++20 (GCC 13-64) TESTS 5 62 0
359929543 hangz D Jan. 26, 2026, 2:26 a.m. OK C++20 (GCC 13-64) TESTS 5 78 0
359926838 aneee D Jan. 26, 2026, 1:14 a.m. OK C++20 (GCC 13-64) TESTS 5 78 0
359921129 Prajii_ D Jan. 25, 2026, 10:19 p.m. OK C++20 (GCC 13-64) TESTS 5 78 0
359924376 codemystery D Jan. 25, 2026, 11:53 p.m. OK C++20 (GCC 13-64) TESTS 5 78 102400
359910903 20230305189 D Jan. 25, 2026, 7:44 p.m. OK C++20 (GCC 13-64) TESTS 5 78 102400
359903479 PrathamTheWarrior D Jan. 25, 2026, 6:35 p.m. OK C++20 (GCC 13-64) TESTS 5 78 102400
359898112 Toninhorf D Jan. 25, 2026, 5:59 p.m. OK C++20 (GCC 13-64) TESTS 5 78 102400
359891313 vishu1204 D Jan. 25, 2026, 5:21 p.m. OK C++20 (GCC 13-64) TESTS 5 78 102400
359885277 AveryClapp D Jan. 25, 2026, 4:48 p.m. OK C++20 (GCC 13-64) TESTS 5 78 921600
359937823 cyris D Jan. 26, 2026, 4:49 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 78 0
359931901 khushicodes03 D Jan. 26, 2026, 3:14 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 78 0
359929909 _Dragneel D Jan. 26, 2026, 2:33 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 78 0
359927580 cmottao D Jan. 26, 2026, 1:38 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 78 0
359924899 AnshulGaharwal D Jan. 26, 2026, 12:11 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 78 0
359915977 DOGQI D Jan. 25, 2026, 8:45 p.m. OK C++23 (GCC 14-64, msys2) TESTS 5 78 0
359884321 Divam13 D Jan. 25, 2026, 4:47 p.m. OK C++23 (GCC 14-64, msys2) TESTS 5 78 0
359938945 puneet_1852 D Jan. 26, 2026, 5:02 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 78 102400
359918102 Godbot D Jan. 25, 2026, 9:16 p.m. OK C++23 (GCC 14-64, msys2) TESTS 5 78 102400
359914761 NrqrN D Jan. 25, 2026, 8:29 p.m. OK C++23 (GCC 14-64, msys2) TESTS 5 78 102400
359888071 dani_iel D Jan. 25, 2026, 4:59 p.m. OK Delphi TESTS 5 140 3276800
359912729 AntonKorch D Jan. 25, 2026, 8:06 p.m. OK F# 9 TESTS 5 109 40038400
359913082 AntonKorch D Jan. 25, 2026, 8:09 p.m. OK F# 9 TESTS 5 125 37785600
359891012 brkrishna_2105_ D Jan. 25, 2026, 5:20 p.m. OK GNU C11 TESTS 5 109 1433600
359905502 Coderhacks16 D Jan. 25, 2026, 6:52 p.m. OK GNU C11 TESTS 5 109 1536000
359945446 sowmitra1 D Jan. 26, 2026, 6:03 a.m. OK GNU C11 TESTS 14 109 2457600
359901896 sudhanjanan D Jan. 25, 2026, 6:24 p.m. OK GNU C11 TESTS 5 109 3993600
359884141 brraghav607 D Jan. 25, 2026, 4:47 p.m. OK GNU C11 TESTS 5 109 4812800
359888152 PrimeMaster D Jan. 25, 2026, 5 p.m. OK GNU C11 TESTS 5 125 3072000
359891038 NRaju D Jan. 25, 2026, 5:20 p.m. OK GNU C11 TESTS 5 140 1945600
359888397 P_M2007 D Jan. 25, 2026, 5:02 p.m. OK GNU C11 TESTS 5 140 3174400
359884417 Farhana_Maha D Jan. 25, 2026, 4:47 p.m. OK GNU C11 TESTS 5 140 4812800
359932632 LittleGopher D Jan. 26, 2026, 3:27 a.m. OK Go TESTS 5 171 7475200
359932955 LittleGopher D Jan. 26, 2026, 3:33 a.m. OK Go TESTS 5 187 5836800
359934451 ILikeThemThicc D Jan. 26, 2026, 3:59 a.m. OK Go TESTS 5 203 10752000
359889354 meldy D Jan. 25, 2026, 5:09 p.m. OK Go TESTS 5 796 9420800
359883736 Abhinav1116 D Jan. 25, 2026, 4:46 p.m. OK Java 21 TESTS 5 187 512000
359884112 young_carl79 D Jan. 25, 2026, 4:47 p.m. OK Java 21 TESTS 5 187 614400
359893489 Fulbabu-F D Jan. 25, 2026, 5:33 p.m. OK Java 21 TESTS 5 234 307200
359896179 HarshitYash D Jan. 25, 2026, 5:47 p.m. OK Java 21 TESTS 5 234 409600
359912408 Sahil_Patel_2507 D Jan. 25, 2026, 8:02 p.m. OK Java 21 TESTS 5 250 1024000
359885039 raghava143 D Jan. 25, 2026, 4:48 p.m. OK Java 21 TESTS 5 250 1228800
359892713 Cut_ArisuT D Jan. 25, 2026, 5:29 p.m. OK Java 21 TESTS 5 265 204800
359944364 Neo0369 D Jan. 26, 2026, 5:55 a.m. OK Java 21 TESTS 14 265 1740800
359902654 kripu-star D Jan. 25, 2026, 6:29 p.m. OK Java 21 TESTS 5 265 2048000
359941371 deepu4477 D Jan. 26, 2026, 5:28 a.m. OK Java 21 TESTS 14 312 6860800
359905294 yadavshivansh849 D Jan. 25, 2026, 6:50 p.m. OK Java 8 TESTS 5 203 4198400
359915844 d1n0Codes D Jan. 25, 2026, 8:43 p.m. OK Java 8 TESTS 5 203 6041600
359908866 MovingBit D Jan. 25, 2026, 7:22 p.m. OK Java 8 TESTS 5 265 19148800
359886797 AnkushSil D Jan. 25, 2026, 4:49 p.m. OK Java 8 TESTS 5 296 5324800
359938638 yash_ash D Jan. 26, 2026, 4:58 a.m. OK Java 8 TESTS 5 562 0
359901429 K_Keerthana D Jan. 25, 2026, 6:21 p.m. OK Java 8 TESTS 5 562 0
359885381 kprabhak D Jan. 25, 2026, 4:48 p.m. OK Java 8 TESTS 5 593 0
359883617 _Ayush_2705 D Jan. 25, 2026, 4:46 p.m. OK Java 8 TESTS 5 593 0
359934879 javeed_123 D Jan. 26, 2026, 4:07 a.m. OK Java 8 TESTS 5 609 0
359920420 richpal8777 D Jan. 25, 2026, 10:03 p.m. OK Java 8 TESTS 5 625 0
359899313 jagbarrameda D Jan. 25, 2026, 6:07 p.m. OK Kotlin 2.2 TESTS 5 312 20787200
359925987 gerogeVT D Jan. 26, 2026, 12:49 a.m. OK Kotlin 2.2 TESTS 5 328 16384000
359905777 madunagu D Jan. 25, 2026, 6:54 p.m. OK Node.js TESTS 5 281 64512000
359885007 MihailLoginov D Jan. 25, 2026, 4:48 p.m. OK PyPy 3 TESTS 5 406 18329600
359912985 subhash_01 D Jan. 25, 2026, 8:09 p.m. OK PyPy 3 TESTS 5 484 18636800
359901377 jayrajderasari D Jan. 25, 2026, 6:20 p.m. OK PyPy 3 TESTS 5 500 20172800
359922475 Dave_get D Jan. 25, 2026, 10:53 p.m. OK PyPy 3 TESTS 5 953 31436800
359883683 ninzasoni D Jan. 25, 2026, 4:46 p.m. OK PyPy 3-64 TESTS 5 140 30003200
359934250 Zeeshan-Haider-Alvi D Jan. 26, 2026, 3:56 a.m. OK PyPy 3-64 TESTS 5 140 31232000
359920553 abutyrev D Jan. 25, 2026, 10:06 p.m. OK PyPy 3-64 TESTS 5 156 24985600
359941590 OpKos D Jan. 26, 2026, 5:30 a.m. OK PyPy 3-64 TESTS 14 156 29798400
359894011 cappucciyes D Jan. 25, 2026, 5:35 p.m. OK PyPy 3-64 TESTS 5 156 29900800
359892462 Eikyu D Jan. 25, 2026, 5:27 p.m. OK PyPy 3-64 TESTS 5 156 36249600
359914046 kaushik.atla D Jan. 25, 2026, 8:20 p.m. OK PyPy 3-64 TESTS 5 156 48435200
359884624 Burnt_Coder D Jan. 25, 2026, 4:47 p.m. OK PyPy 3-64 TESTS 5 171 29798400
359893954 masao D Jan. 25, 2026, 5:35 p.m. OK PyPy 3-64 TESTS 5 171 30003200
359890768 soham_masao D Jan. 25, 2026, 5:19 p.m. OK PyPy 3-64 TESTS 5 171 30003200
359885700 wrichikpaul42 D Jan. 25, 2026, 4:48 p.m. OK Python 3 TESTS 5 187 28057600
359883680 Shanmukh08 D Jan. 25, 2026, 4:46 p.m. OK Python 3 TESTS 5 218 26521600
359927239 gwang35 D Jan. 26, 2026, 1:27 a.m. OK Python 3 TESTS 5 265 24780800
359883474 KanishkChaudhary D Jan. 25, 2026, 4:46 p.m. OK Python 3 TESTS 5 265 26521600
359884138 varshitha_govind D Jan. 25, 2026, 4:47 p.m. OK Python 3 TESTS 5 281 34508800
359900424 Jipsy D Jan. 25, 2026, 6:14 p.m. OK Python 3 TESTS 5 296 26828800
359886879 CuttngCornrs D Jan. 25, 2026, 4:49 p.m. OK Python 3 TESTS 5 328 26521600
359937384 dineshjogala07 D Jan. 26, 2026, 4:43 a.m. OK Python 3 TESTS 5 375 26521600
359916070 holymoly123 D Jan. 25, 2026, 8:46 p.m. OK Python 3 TESTS 5 390 23859200
359883525 wCyunw D Jan. 25, 2026, 4:46 p.m. OK Python 3 TESTS 5 437 36147200
359898576 allenchang2001 D Jan. 25, 2026, 6:02 p.m. OK Rust 2021 TESTS 5 46 3379200
359917625 m397 D Jan. 25, 2026, 9:09 p.m. OK Rust 2024 TESTS 5 46 3993600
359912295 Xeramian D Jan. 25, 2026, 8:01 p.m. OK Rust 2024 TESTS 5 93 7475200

remove filters

Back to search problems