Codeforces Round 1046 (Div. 1)

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
2135 Codeforces Round 1046 (Div. 1) FINISHED False 10800 20013923 Aug. 28, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 986 ) D2 From the Unknown (Hard Version) PROGRAMMING binary search brute force constructive algorithms interactive math

This is the hard version of the problem. The difference between the versions is that in this version, the sum of the lengths of the articles over all queries must not exceed (2.5\cdot 10^4). You can hack only if you solved all versions of this problem. This is an interactive problem. The RiOI Team has recently developed a text editor named RiOI Editor . The editor works with exactly one integer parameter (W) — the width of each line. It is known that (1 \leq W \leq 10^5). As you cannot understand the RiOI Language, from your point of view, words differ from each other only by their length. Hence, an article of length (n) is defined as a sequence (a) consisting of (n) positive integers, where (a_i) is the length of the (i)-th word in the article . The RiOI Editor displays the article (a_1, a_2,\ldots, a_n) on screen as follows: If (\max(a_1, a_2, \ldots, a_n) > W), the editor is unable to display the article ; Otherwise, the editor is able to display the article by the following process: Initially, (l = 1), and (s = 0). During the whole process, (l) always denotes the current number of lines in the editor, and (s) always denotes the sum of lengths of words in the last line; Then, for each (1\le i\le n): If (s + a_i \leq W), the word is inserted at the end of the current line. Thus, (l) remains unchanged, and (s) gets increased by (a_i). Otherwise, the word is inserted into a new line. Thus, (l) becomes (l + 1), and (s) becomes (a_i). The number of lines needed to display the article is the final value of (l). Initially, (l = 1), and (s = 0). During the whole process, (l) always denotes the current number of lines in the editor, and (s) always denotes the sum of lengths of words in the last line; Then, for each (1\le i\le n): If (s + a_i \leq W), the word is inserted at the end of the current line. Thus, (l) remains unchanged, and $$$

Tutorials

Codeforces Round 1046 (Div. 1, Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
336031581 alireza_kaviani D2 Aug. 28, 2025, 5 p.m. OK C++17 (GCC 7-32) TESTS 60 108 0
336028665 Feynman5210 D2 Aug. 28, 2025, 4:52 p.m. OK C++17 (GCC 7-32) TESTS 60 140 0
336018943 Ak_16 D2 Aug. 28, 2025, 4:27 p.m. OK C++17 (GCC 7-32) TESTS 60 140 0
336086093 zjwwjhy D2 Aug. 29, 2025, 5:28 a.m. OK C++17 (GCC 7-32) TESTS 60 155 0
336065130 DereFer D2 Aug. 28, 2025, 11:13 p.m. OK C++17 (GCC 7-32) TESTS 60 155 0
336042808 Watersphere D2 Aug. 28, 2025, 5:31 p.m. OK C++17 (GCC 7-32) TESTS 60 155 0
336021680 eyadhjarray111 D2 Aug. 28, 2025, 4:34 p.m. OK C++17 (GCC 7-32) TESTS 60 155 102400
336030635 fishy15 D2 Aug. 28, 2025, 4:57 p.m. OK C++17 (GCC 7-32) TESTS 60 156 0
336052491 Splashing D2 Aug. 28, 2025, 7:36 p.m. OK C++17 (GCC 7-32) TESTS 60 156 102400
336079110 mhxtc D2 Aug. 29, 2025, 3:55 a.m. OK C++17 (GCC 7-32) TESTS 60 171 0
336028200 makrav D2 Aug. 28, 2025, 4:51 p.m. OK C++20 (GCC 13-64) TESTS 60 139 0
336000378 BurnedChicken D2 Aug. 28, 2025, 3:46 p.m. OK C++20 (GCC 13-64) TESTS 60 139 0
336072476 wanghaoning123 D2 Aug. 29, 2025, 2:13 a.m. OK C++20 (GCC 13-64) TESTS 60 139 102400
336026902 Mitsubachi D2 Aug. 28, 2025, 4:47 p.m. OK C++20 (GCC 13-64) TESTS 60 139 102400
336032617 kiyotaka D2 Aug. 28, 2025, 5:03 p.m. OK C++20 (GCC 13-64) TESTS 60 139 409600
336051953 thabumi D2 Aug. 28, 2025, 7:30 p.m. OK C++20 (GCC 13-64) TESTS 60 140 0
336037356 anmichi D2 Aug. 28, 2025, 5:16 p.m. OK C++20 (GCC 13-64) TESTS 60 140 0
336020558 siganai D2 Aug. 28, 2025, 4:31 p.m. OK C++20 (GCC 13-64) TESTS 60 140 0
336011441 mtsd D2 Aug. 28, 2025, 4:09 p.m. OK C++20 (GCC 13-64) TESTS 60 140 0
336009568 Kapt D2 Aug. 28, 2025, 4:05 p.m. OK C++20 (GCC 13-64) TESTS 60 140 0
336051811 dumb_boi D2 Aug. 28, 2025, 7:29 p.m. OK C++23 (GCC 14-64, msys2) TESTS 60 124 0
336029024 waauto D2 Aug. 28, 2025, 4:53 p.m. OK C++23 (GCC 14-64, msys2) TESTS 60 124 0
336028522 Gheal D2 Aug. 28, 2025, 4:51 p.m. OK C++23 (GCC 14-64, msys2) TESTS 60 124 0
336031211 apgpsoop D2 Aug. 28, 2025, 4:59 p.m. OK C++23 (GCC 14-64, msys2) TESTS 60 124 102400
336018517 peltorator D2 Aug. 28, 2025, 4:26 p.m. OK C++23 (GCC 14-64, msys2) TESTS 60 124 102400
336016563 ymmparsa D2 Aug. 28, 2025, 4:21 p.m. OK C++23 (GCC 14-64, msys2) TESTS 60 124 409600
336028521 lnsuyn D2 Aug. 28, 2025, 4:51 p.m. OK C++23 (GCC 14-64, msys2) TESTS 60 139 0
336072603 lingfunny D2 Aug. 29, 2025, 2:15 a.m. OK C++23 (GCC 14-64, msys2) TESTS 60 139 102400
336079680 tgossett D2 Aug. 29, 2025, 4:04 a.m. OK C++23 (GCC 14-64, msys2) TESTS 60 140 0
336043834 Mans-21 D2 Aug. 28, 2025, 5:33 p.m. OK C++23 (GCC 14-64, msys2) TESTS 60 140 0
336064007 rainboy D2 Aug. 28, 2025, 10:41 p.m. OK GNU C11 TESTS 60 983 8396800
335996912 Tlatoani D2 Aug. 28, 2025, 3:39 p.m. OK Kotlin 2.2 TESTS 60 389 1740800
336004125 bribritt D2 Aug. 28, 2025, 3:54 p.m. OK PyPy 3-64 TESTS 60 187 9318400
336053240 teekaytai D2 Aug. 28, 2025, 7:43 p.m. OK PyPy 3-64 TESTS 60 202 9318400
336039314 eepsilon D2 Aug. 28, 2025, 5:22 p.m. OK PyPy 3-64 TESTS 60 217 10035200
336009401 bronze_coder D2 Aug. 28, 2025, 4:05 p.m. OK PyPy 3-64 TESTS 60 218 9318400
336013652 toam D2 Aug. 28, 2025, 4:14 p.m. OK PyPy 3-64 TESTS 60 233 9523200
336028627 harurun4635 D2 Aug. 28, 2025, 4:52 p.m. OK PyPy 3-64 TESTS 60 233 9625600
336052917 golomb D2 Aug. 28, 2025, 7:40 p.m. OK PyPy 3-64 TESTS 60 233 10854400
336053191 titia D2 Aug. 28, 2025, 7:42 p.m. OK PyPy 3-64 TESTS 60 234 9932800
336027149 Ritwin D2 Aug. 28, 2025, 4:48 p.m. OK PyPy 3-64 TESTS 60 281 9625600
336022197 anango D2 Aug. 28, 2025, 4:35 p.m. OK PyPy 3-64 TESTS 60 405 38502400
336034884 Sugar_fan D2 Aug. 28, 2025, 5:09 p.m. OK Rust 2021 TESTS 60 187 102400
336036780 darkkcyan D2 Aug. 28, 2025, 5:14 p.m. OK Rust 2024 TESTS 60 156 102400

remove filters

Back to search problems