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 |
|---|---|---|---|---|---|---|
| 2255 | Codeforces Round 1116 (Div. 1) | FINISHED | False | 9000 | 2820275 | Aug. 9, 2026, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 1529 ) | D | How Long Until Nothing Remains? | PROGRAMMING | binary search bitmasks greedy |
Before her final sortie, Chtholly asks Willem three questions. The first is this: if the end is inevitable, how long will it take until nothing remains? Willem cannot answer her directly. Instead, he writes down (n) positive integers (a_1,a_2,\ldots,a_n). Each operation takes one second. In one operation, Willem does the following: Choose an index (p) ((1\le p\le n)); Then, replace (a_p) with (\left\lfloor\dfrac{a_p}{2}\right\rfloor), and for every (i\ne p), replace (a_i) by (\left\lceil\dfrac{a_i}{2}\right\rceil). All replacements are performed simultaneously. Find the minimum number of seconds needed to make all (n) integers equal to (0). Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^4)). The description of the test cases follows. The first line of each test case contains one integer (n) ((1\le n\le2\cdot10^5)) — the number of integers. The second line of each test case contains (n) integers (a_1,a_2,\ldots,a_n) ((1\le a_i\le10^9)) — the initial integers. It is guaranteed that the sum of (n) over all test cases does not exceed (2\cdot10^5). For each test case, output a single integer — the minimum number of seconds needed to make all integers equal to (0). In the first test case, the only integer changes as (3\to1\to0), so the answer is (2). In the second test case, an integer equal to (1) becomes (0) only when its index is chosen. Thus, at least (3) seconds are necessary, and choosing every index once is sufficient. In the third test case, an optimal sequence is: Choose (p=1): (1,2,4\to0,1,2); Choose (p=2): (0,1,2\to0,0,1); Choose (p=3): (0,0,1\to0,0,0). In the fourth test case, an optimal sequence is (5,2\to2,1\to1,0\to0,0), where the chosen indices are (1), (2), and (1). |
| 155840 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 386429258 | lmjsjg | D | Aug. 10, 2026, 2:45 a.m. | OK | C++17 (GCC 7-32) | TESTS | 43 | 109 | 819200 | ||
| 386374366 | quanjun | D | Aug. 9, 2026, 3:42 p.m. | OK | C++17 (GCC 7-32) | TESTS | 43 | 109 | 819200 | ||
| 386393451 | Miaoborui | D | Aug. 9, 2026, 4:42 p.m. | OK | C++17 (GCC 7-32) | TESTS | 43 | 125 | 1638400 | ||
| 386384828 | liheyang | D | Aug. 9, 2026, 4:12 p.m. | OK | C++17 (GCC 7-32) | TESTS | 43 | 125 | 3788800 | ||
| 386371753 | qwef_ | D | Aug. 9, 2026, 3:36 p.m. | OK | C++17 (GCC 7-32) | TESTS | 43 | 125 | 8089600 | ||
| 386376983 | iliya_mon | D | Aug. 9, 2026, 3:49 p.m. | OK | C++17 (GCC 7-32) | TESTS | 43 | 125 | 138342400 | ||
| 386408378 | aryan.rai.1503 | D | Aug. 9, 2026, 6:39 p.m. | OK | C++17 (GCC 7-32) | TESTS | 43 | 140 | 0 | ||
| 386376220 | potato167 | D | Aug. 9, 2026, 3:47 p.m. | OK | C++17 (GCC 7-32) | TESTS | 43 | 140 | 0 | ||
| 386382999 | MingdzxWillWinIOI | D | Aug. 9, 2026, 4:06 p.m. | OK | C++17 (GCC 7-32) | TESTS | 43 | 140 | 1638400 | ||
| 386396357 | ling_chen | D | Aug. 9, 2026, 4:54 p.m. | OK | C++17 (GCC 7-32) | TESTS | 43 | 156 | 819200 | ||
| 386415658 | Geothermal | D | Aug. 9, 2026, 8:31 p.m. | OK | C++20 (GCC 13-64) | TESTS | 43 | 62 | 307200 | ||
| 386393219 | zyc_ovo | D | Aug. 9, 2026, 4:41 p.m. | OK | C++20 (GCC 13-64) | TESTS | 43 | 78 | 0 | ||
| 386369207 | Ormlis | D | Aug. 9, 2026, 3:30 p.m. | OK | C++20 (GCC 13-64) | TESTS | 43 | 78 | 102400 | ||
| 386427212 | xingtiankai2023 | D | Aug. 10, 2026, 2:03 a.m. | OK | C++20 (GCC 13-64) | TESTS | 43 | 78 | 921600 | ||
| 386414831 | noya2 | D | Aug. 9, 2026, 8:15 p.m. | OK | C++20 (GCC 13-64) | TESTS | 43 | 93 | 102400 | ||
| 386398010 | mxiao37 | D | Aug. 9, 2026, 5 p.m. | OK | C++20 (GCC 13-64) | TESTS | 43 | 93 | 102400 | ||
| 386379654 | wangzeyu2013 | D | Aug. 9, 2026, 3:56 p.m. | OK | C++20 (GCC 13-64) | TESTS | 43 | 93 | 1638400 | ||
| 386374227 | Khanhcsp1 | D | Aug. 9, 2026, 3:42 p.m. | OK | C++20 (GCC 13-64) | TESTS | 43 | 93 | 1638400 | ||
| 386365652 | tickcross.y | D | Aug. 9, 2026, 3:23 p.m. | OK | C++20 (GCC 13-64) | TESTS | 43 | 93 | 2969600 | ||
| 386409530 | supercoder888 | D | Aug. 9, 2026, 6:54 p.m. | OK | C++20 (GCC 13-64) | TESTS | 43 | 93 | 4096000 | ||
| 386389557 | iforandom | D | Aug. 9, 2026, 4:27 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 43 | 62 | 6963200 | ||
| 386386250 | robert.barbu27 | D | Aug. 9, 2026, 4:17 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 43 | 78 | 0 | ||
| 386403637 | ecnerwala | D | Aug. 9, 2026, 5:50 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 43 | 78 | 102400 | ||
| 386383035 | permutation | D | Aug. 9, 2026, 4:06 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 43 | 78 | 102400 | ||
| 386390132 | conqueror_of_kaiboy | D | Aug. 9, 2026, 4:30 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 43 | 78 | 1638400 | ||
| 386440140 | vjudge666 | D | Aug. 10, 2026, 5:54 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 43 | 93 | 102400 | ||
| 386436762 | Mark_Pr | D | Aug. 10, 2026, 5:06 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 43 | 93 | 102400 | ||
| 386432653 | ko_osaga | D | Aug. 10, 2026, 3:49 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 43 | 93 | 102400 | ||
| 386430738 | perchuts | D | Aug. 10, 2026, 3:13 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 43 | 93 | 102400 | ||
| 386427889 | goldenutu | D | Aug. 10, 2026, 2:19 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 43 | 93 | 102400 | ||
| 386386226 | codecrasher_ | D | Aug. 9, 2026, 4:17 p.m. | OK | Go | TESTS | 43 | 62 | 7782400 | ||
| 386384872 | MBBN | D | Aug. 9, 2026, 4:12 p.m. | OK | Java 21 | TESTS | 43 | 343 | 7065600 | ||
| 386372425 | AJ123496 | D | Aug. 9, 2026, 3:38 p.m. | OK | Java 21 | TESTS | 43 | 703 | 1536000 | ||
| 386362844 | LT1 | D | Aug. 9, 2026, 3:17 p.m. | OK | Java 21 | TESTS | 43 | 1000 | 7577600 | ||
| 386378440 | dark_slayer007 | D | Aug. 9, 2026, 3:53 p.m. | OK | Java 8 | TESTS | 43 | 187 | 0 | ||
| 386389059 | Tlatoani | D | Aug. 9, 2026, 4:26 p.m. | OK | Kotlin 2.2 | TESTS | 43 | 671 | 21401600 | ||
| 386374059 | conqueror_of_tourist | D | Aug. 9, 2026, 3:42 p.m. | OK | PyPy 3-64 | TESTS | 43 | 187 | 27340800 | ||
| 386388397 | dparth_7 | D | Aug. 9, 2026, 4:23 p.m. | OK | PyPy 3-64 | TESTS | 43 | 343 | 24985600 | ||
| 386361202 | x0rque | D | Aug. 9, 2026, 3:14 p.m. | OK | PyPy 3-64 | TESTS | 43 | 578 | 30822400 | ||
| 386376703 | code.demon | D | Aug. 9, 2026, 3:48 p.m. | OK | PyPy 3-64 | TESTS | 43 | 656 | 23244800 | ||
| 386390480 | chhillarankit74 | D | Aug. 9, 2026, 4:31 p.m. | OK | PyPy 3-64 | TESTS | 43 | 656 | 43622400 | ||
| 386364877 | literalchild | D | Aug. 9, 2026, 3:21 p.m. | OK | PyPy 3-64 | TESTS | 43 | 734 | 27750400 | ||
| 386367650 | fft64 | D | Aug. 9, 2026, 3:27 p.m. | OK | PyPy 3-64 | TESTS | 43 | 1140 | 43827200 | ||
| 386369292 | toam | D | Aug. 9, 2026, 3:30 p.m. | OK | PyPy 3-64 | TESTS | 43 | 1406 | 29388800 | ||
| 386388394 | PaperMemory | D | Aug. 9, 2026, 4:23 p.m. | OK | PyPy 3-64 | TESTS | 43 | 1828 | 32153600 | ||
| 386351954 | de1uxegg | D | Aug. 9, 2026, 2:58 p.m. | OK | Python 3 | TESTS | 43 | 187 | 23347200 | ||
| 386374246 | maworkin | D | Aug. 9, 2026, 3:42 p.m. | OK | Python 3 | TESTS | 43 | 562 | 24371200 | ||
| 386404805 | DanielAnker | D | Aug. 9, 2026, 6:01 p.m. | OK | Rust 2024 | TESTS | 43 | 46 | 2355200 | ||
| 386376271 | trycatchcry | D | Aug. 9, 2026, 3:47 p.m. | OK | Rust 2024 | TESTS | 43 | 62 | 3379200 | ||
| 386408951 | Solalyth | D | Aug. 9, 2026, 6:46 p.m. | OK | Rust 2024 | TESTS | 43 | 78 | 20787200 | ||
| 386383046 | d11maan | D | Aug. 9, 2026, 4:06 p.m. | OK | Rust 2024 | TESTS | 43 | 109 | 3379200 | ||
| 386389812 | cvs-650 | D | Aug. 9, 2026, 4:28 p.m. | OK | Rust 2024 | TESTS | 43 | 125 | 4096000 | ||
| 386384307 | will_wang | D | Aug. 9, 2026, 4:10 p.m. | OK | Rust 2024 | TESTS | 43 | 546 | 3379200 |
Back to search problems