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 |
|---|---|---|---|---|---|---|
| 2259 | Codeforces Round 1119 (Div. 3) | FINISHED | False | 8100 | 2560466 | Sept. 5, 2026, 2:45 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 968 ) | H | Treasure Map Destruction (Counting Version) | PROGRAMMING | 2-sat combinatorics dfs and similar dp graphs math |
Bessie the Buccaneer has plundered the six or seven seas for decades, but now she needs to find a place to bury her treasure! There are (n) islands in a line, and Bessie buried her treasure on some number of islands. It is guaranteed that Bessie buried treasure on at least one island. In order to remember where she buried her treasure, she created a treasure map. The treasure map can be represented as an array of (n) integers, where (a_i) indicates the minimum number of islands that Bessie would need to travel through to get to an island with treasure if she started at island (i), assuming she can only travel to adjacent islands. However, after Bessie buried her treasure, Elsie the Evil Explorer tried to steal Bessie's treasure map! Thankfully, Elsie was unsuccessful, but in the chaos, parts of Bessie's treasure map got destroyed, meaning that some of the elements of (a) were set to (-1)! Panicked, Bessie gives you the destroyed array (b), and wants to know how many possible distinct sets of islands she could have placed her treasures on. Two sets (A, B) are distinct if there exists at least one element in (A) that is not in (B) or vice versa. It's possible that Bessie messed up while writing the treasure map, so there could be no possible set of islands on which she could have placed her treasure. The first line of the input contains (t) ((1 \leq t \leq 10^4)) — the number of test cases. The first line of each test case contains (n) ((1 \leq n \leq 2 \cdot 10^5)) — the number of islands. The second line contains (b_1, b_2, \ldots, b_n) ((-1 \leq b_i \leq n-1)) — the destroyed array of distances. If (b_i = -1), the element was destroyed. It is guaranteed that the sum of (n) over all test cases does not exceed (2 \cdot 10^5). For each testcase, output the number of possible distinct sets of islands that Bessie could have placed her treasure on mod (10^9 + 7). In the first test c |
| Codeforces Round 1119 (Div. 3) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 389655553 | yjun. | H | Sept. 6, 2026, 1:37 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 62 | 4096000 | ||
| 389639949 | phongtin27 | H | Sept. 6, 2026, 10:58 a.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 62 | 11264000 | ||
| 389692783 | 3LOCKBOX | H | Sept. 6, 2026, 8:52 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 78 | 0 | ||
| 389707140 | KinightNight78 | H | Sept. 7, 2026, 4:44 a.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 78 | 102400 | ||
| 389639124 | ayushmanjha25 | H | Sept. 6, 2026, 10:50 a.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 78 | 102400 | ||
| 389633188 | JPMM | H | Sept. 6, 2026, 9:53 a.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 78 | 102400 | ||
| 389589090 | Midhilesh | H | Sept. 5, 2026, 7:34 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 78 | 102400 | ||
| 389573454 | _urbanmyth | H | Sept. 5, 2026, 4:58 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 78 | 102400 | ||
| 389577200 | 3LOCKBOX | H | Sept. 5, 2026, 5:37 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 78 | 307200 | ||
| 389612685 | gnwfgg | H | Sept. 6, 2026, 5:47 a.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 78 | 1024000 | ||
| 389646486 | A.H.M.E.D--N.A.D.Y | H | Sept. 6, 2026, 12:05 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 46 | 102400 | ||
| 389581409 | Antila | H | Sept. 5, 2026, 6:22 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 62 | 3788800 | ||
| 389600711 | include_BM | H | Sept. 6, 2026, 1:01 a.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 62 | 4096000 | ||
| 389687783 | codexistent | H | Sept. 6, 2026, 7:18 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 62 | 6451200 | ||
| 389610359 | AyushmanSharma | H | Sept. 6, 2026, 5:08 a.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 62 | 8089600 | ||
| 389681527 | Liuguang_Ji | H | Sept. 6, 2026, 5:59 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 62 | 9625600 | ||
| 389576892 | WisdomCasual | H | Sept. 5, 2026, 5:33 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 62 | 21708800 | ||
| 389593278 | coding9836 | H | Sept. 5, 2026, 8:46 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 78 | 0 | ||
| 389674608 | Yashwanth_RJ | H | Sept. 6, 2026, 4:51 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 78 | 102400 | ||
| 389673744 | Yashwanth_RJ | H | Sept. 6, 2026, 4:43 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 78 | 102400 | ||
| 389691142 | Mischiefius | H | Sept. 6, 2026, 8:16 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 62 | 0 | ||
| 389690212 | pluto111 | H | Sept. 6, 2026, 7:58 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 62 | 0 | ||
| 389647536 | Kerkeden | H | Sept. 6, 2026, 12:17 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 62 | 102400 | ||
| 389600149 | helloworld15 | H | Sept. 6, 2026, 12:37 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 62 | 102400 | ||
| 389675115 | hawk.chan | H | Sept. 6, 2026, 4:56 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 62 | 204800 | ||
| 389642595 | m_manasc | H | Sept. 6, 2026, 11:24 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 62 | 307200 | ||
| 389633057 | Tuli2024 | H | Sept. 6, 2026, 9:52 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 62 | 614400 | ||
| 389644372 | aarav__kansal | H | Sept. 6, 2026, 11:42 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 62 | 716800 | ||
| 389604472 | arcanery | H | Sept. 6, 2026, 2:57 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 62 | 1740800 | ||
| 389686691 | Mr-Methodical | H | Sept. 6, 2026, 7:02 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 62 | 2048000 | ||
| 389706681 | Sarupya | H | Sept. 7, 2026, 4:33 a.m. | OK | GNU C11 | TESTS | 24 | 78 | 4505600 | ||
| 389706648 | tejashwinichimaladari | H | Sept. 7, 2026, 4:33 a.m. | OK | GNU C11 | TESTS | 24 | 93 | 4505600 | ||
| 389594129 | OONGABOONGA | H | Sept. 5, 2026, 9:04 p.m. | OK | GNU C11 | TESTS | 24 | 109 | 8908800 | ||
| 389706836 | GPS22 | H | Sept. 7, 2026, 4:38 a.m. | OK | GNU C11 | TESTS | 24 | 109 | 10547200 | ||
| 389653643 | komalpatil0403 | H | Sept. 6, 2026, 1:18 p.m. | OK | Java 21 | TESTS | 24 | 281 | 5017600 | ||
| 389673428 | arafa_ | H | Sept. 6, 2026, 4:39 p.m. | OK | PyPy 3-64 | TESTS | 24 | 171 | 26828800 | ||
| 389609624 | BeforeRedemption | H | Sept. 6, 2026, 4:55 a.m. | OK | PyPy 3-64 | TESTS | 24 | 203 | 43520000 | ||
| 389581387 | OneBased | H | Sept. 5, 2026, 6:22 p.m. | OK | PyPy 3-64 | TESTS | 24 | 218 | 26112000 | ||
| 389674256 | MayankSagarr | H | Sept. 6, 2026, 4:48 p.m. | OK | PyPy 3-64 | TESTS | 24 | 218 | 27340800 | ||
| 389593445 | coding9836 | H | Sept. 5, 2026, 8:49 p.m. | OK | PyPy 3-64 | TESTS | 24 | 218 | 28057600 | ||
| 389594246 | twosquares | H | Sept. 5, 2026, 9:07 p.m. | OK | PyPy 3-64 | TESTS | 24 | 343 | 56422400 | ||
| 389597640 | mega_mango | H | Sept. 5, 2026, 10:47 p.m. | OK | PyPy 3-64 | TESTS | 24 | 359 | 33689600 | ||
| 389595759 | equeen | H | Sept. 5, 2026, 9:46 p.m. | OK | PyPy 3-64 | TESTS | 24 | 656 | 36454400 | ||
| 389670326 | Polynomu | H | Sept. 6, 2026, 4:09 p.m. | OK | PyPy 3-64 | TESTS | 24 | 1328 | 30310400 | ||
| 389593886 | ruhittanvir14 | H | Sept. 5, 2026, 8:59 p.m. | OK | Python 3 | TESTS | 24 | 187 | 23756800 | ||
| 389696235 | bulatko | H | Sept. 6, 2026, 10:56 p.m. | OK | Python 3 | TESTS | 24 | 203 | 26009600 | ||
| 389703516 | ArnavGupta10 | H | Sept. 7, 2026, 3:23 a.m. | OK | Python 3 | TESTS | 24 | 312 | 28979200 | ||
| 389646785 | Devenderdagar | H | Sept. 6, 2026, 12:08 p.m. | OK | Python 3 | TESTS | 24 | 343 | 57753600 | ||
| 389711724 | code.demon | H | Sept. 7, 2026, 6:05 a.m. | OK | Python 3 | TESTS | 24 | 359 | 21913600 | ||
| 389574402 | krithika_mengani | H | Sept. 5, 2026, 4:59 p.m. | OK | Python 3 | TESTS | 24 | 359 | 40345600 | ||
| 389602218 | mr3musab | H | Sept. 6, 2026, 1:57 a.m. | OK | Python 3 | TESTS | 24 | 484 | 23142400 | ||
| 389662608 | Yobiking | H | Sept. 6, 2026, 2:45 p.m. | OK | Python 3 | TESTS | 24 | 484 | 77004800 | ||
| 389581445 | PrakashMoond01 | H | Sept. 5, 2026, 6:23 p.m. | OK | Python 3 | TESTS | 24 | 640 | 58675200 | ||
| 389638767 | newbalance2 | H | Sept. 6, 2026, 10:47 a.m. | OK | Python 3 | TESTS | 24 | 859 | 34611200 | ||
| 389591250 | singhdipanshu133 | H | Sept. 5, 2026, 8:08 p.m. | OK | Rust 2021 | TESTS | 24 | 78 | 6963200 | ||
| 389573365 | Kevin-27 | H | Sept. 5, 2026, 4:58 p.m. | OK | Rust 2024 | TESTS | 24 | 62 | 4198400 |
Back to search problems