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 |
|---|---|---|---|---|---|---|
| 2056 | Codeforces Round 997 (Div. 2) | FINISHED | False | 7200 | 39281123 | Jan. 17, 2025, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 1016 ) | E | Nested Segments | PROGRAMMING | combinatorics dp math trees |
A set (A) consisting of pairwise distinct segments (l, r) with integer endpoints is called good if (1\le l\le r\le n), and for any pair of distinct segments (l_i, r_i, l_j, r_j) in (A), exactly one of the following conditions holds: (r_i < l_j) or (r_j < l_i) (the segments do not intersect) (l_i \le l_j \le r_j \le r_i) or (l_j \le l_i \le r_i \le r_j) (one segment is fully contained within the other) You are given a good set (S) consisting of (m) pairwise distinct segments (l_i, r_i) with integer endpoints. You want to add as many additional segments to the set (S) as possible while ensuring that set (S) remains good. Since this task is too easy, you need to determine the number of different ways to add the maximum number of additional segments to (S), ensuring that the set remains good. Two ways are considered different if there exists a segment that is being added in one of the ways, but not in the other. Formally, you need to find the number of good sets (T) of distinct segments, such that (S) is a subset of (T) and (T) has the maximum possible size. Since the result might be very large, compute the answer modulo (998\,244\,353). 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 two integers (n) and (m) ((1 \le n \le 2 \cdot 10^5), (0 \le m \le 2 \cdot 10^5)) — the maximum right endpoint of the segments, and the size of (S). The (i)-th of the next (m) lines contains two integers (l_i) and (r_i) ((1 \le l_i \le r_i \le n)) — the boundaries of the segments in set (S). It is guaranteed that the given set (S) is good, and the segments in set (S) are pairwise distinct. It is guaranteed that both the sum of (n) and the sum of (m) over all test cases do not e |
| Codeforces Round #997 (Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 301500473 | 1G1U4E5S1T4 | E | Jan. 18, 2025, 2:37 a.m. | OK | C++17 (GCC 7-32) | TESTS | 40 | 171 | 8089600 | ||
| 301466677 | TrendBattles | E | Jan. 17, 2025, 5:10 p.m. | OK | C++17 (GCC 7-32) | TESTS | 40 | 187 | 5120000 | ||
| 301469501 | potato167 | E | Jan. 17, 2025, 5:29 p.m. | OK | C++17 (GCC 7-32) | TESTS | 40 | 187 | 7680000 | ||
| 301463458 | HOTVITLON | E | Jan. 17, 2025, 4:34 p.m. | OK | C++17 (GCC 7-32) | TESTS | 40 | 202 | 12288000 | ||
| 301498291 | AstralMetal | E | Jan. 18, 2025, 1:50 a.m. | OK | C++17 (GCC 7-32) | TESTS | 40 | 249 | 5836800 | ||
| 301457721 | mnaveenkumar2009 | E | Jan. 17, 2025, 4:22 p.m. | OK | C++17 (GCC 7-32) | TESTS | 40 | 249 | 21913600 | ||
| 301470083 | hieu_2004 | E | Jan. 17, 2025, 5:33 p.m. | OK | C++17 (GCC 7-32) | TESTS | 40 | 249 | 57241600 | ||
| 301468782 | CrispyLobster | E | Jan. 17, 2025, 5:24 p.m. | OK | C++17 (GCC 7-32) | TESTS | 40 | 264 | 3481600 | ||
| 301509496 | 4927618350 | E | Jan. 18, 2025, 4:49 a.m. | OK | C++17 (GCC 7-32) | TESTS | 40 | 265 | 8908800 | ||
| 301462172 | pl_er | E | Jan. 17, 2025, 4:32 p.m. | OK | C++17 (GCC 7-32) | TESTS | 40 | 265 | 16076800 | ||
| 301502337 | tangyigeng2028 | E | Jan. 18, 2025, 3:10 a.m. | OK | C++20 (GCC 13-64) | TESTS | 40 | 139 | 41369600 | ||
| 301466037 | DanielChang | E | Jan. 17, 2025, 5:07 p.m. | OK | C++20 (GCC 13-64) | TESTS | 40 | 155 | 24883200 | ||
| 301477146 | ahmetalp | E | Jan. 17, 2025, 6:33 p.m. | OK | C++20 (GCC 13-64) | TESTS | 40 | 156 | 6758400 | ||
| 301456228 | zhongpeilin | E | Jan. 17, 2025, 4:19 p.m. | OK | C++20 (GCC 13-64) | TESTS | 40 | 156 | 14540800 | ||
| 301503092 | _Kamisato_Ayaka_ | E | Jan. 18, 2025, 3:23 a.m. | OK | C++20 (GCC 13-64) | TESTS | 40 | 156 | 40140800 | ||
| 301507341 | Hurrikale | E | Jan. 18, 2025, 4:26 a.m. | OK | C++20 (GCC 13-64) | TESTS | 40 | 171 | 4096000 | ||
| 301476400 | foammmm | E | Jan. 17, 2025, 6:26 p.m. | OK | C++20 (GCC 13-64) | TESTS | 40 | 171 | 5836800 | ||
| 301467632 | jtrh | E | Jan. 17, 2025, 5:16 p.m. | OK | C++20 (GCC 13-64) | TESTS | 40 | 171 | 8192000 | ||
| 301491928 | cockatooo_2025GM | E | Jan. 17, 2025, 10:28 p.m. | OK | C++20 (GCC 13-64) | TESTS | 40 | 171 | 13414400 | ||
| 301453698 | _R00T | E | Jan. 17, 2025, 4:14 p.m. | OK | C++20 (GCC 13-64) | TESTS | 40 | 171 | 16588800 | ||
| 301516696 | threebody4 | E | Jan. 18, 2025, 5:45 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 40 | 140 | 3276800 | ||
| 301506406 | Normalizerr | E | Jan. 18, 2025, 4:15 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 40 | 140 | 9318400 | ||
| 301482584 | KobicGend | E | Jan. 17, 2025, 7:34 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 40 | 155 | 19763200 | ||
| 301503116 | po_rag526 | E | Jan. 18, 2025, 3:23 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 40 | 155 | 40140800 | ||
| 301505358 | mpl_peaches | E | Jan. 18, 2025, 4 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 40 | 156 | 13824000 | ||
| 301455416 | lcyxds | E | Jan. 17, 2025, 4:17 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 40 | 171 | 6246400 | ||
| 301495102 | lrvideckis | E | Jan. 18, 2025, 12:25 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 40 | 171 | 22630400 | ||
| 301502993 | _Kamisato_Ayaka_ | E | Jan. 18, 2025, 3:21 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 40 | 171 | 40140800 | ||
| 301468883 | SkyAscendant | E | Jan. 17, 2025, 5:24 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 40 | 186 | 11673600 | ||
| 301456884 | ttamx | E | Jan. 17, 2025, 4:21 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 40 | 186 | 30412800 | ||
| 301461095 | nguyenquocthao00 | E | Jan. 17, 2025, 4:30 p.m. | OK | Go | TESTS | 40 | 358 | 105984000 | ||
| 301499087 | Rice_tawara459 | E | Jan. 18, 2025, 2:10 a.m. | OK | PyPy 3-64 | TESTS | 40 | 1109 | 41062400 | ||
| 301472018 | tassei903 | E | Jan. 17, 2025, 5:49 p.m. | OK | PyPy 3-64 | TESTS | 40 | 1249 | 87654400 | ||
| 301493754 | monocrap | E | Jan. 17, 2025, 11:34 p.m. | OK | PyPy 3-64 | TESTS | 40 | 1405 | 101580800 | ||
| 301458310 | kdy8128 | E | Jan. 17, 2025, 4:24 p.m. | OK | PyPy 3-64 | TESTS | 40 | 1530 | 63692800 | ||
| 301476701 | twosquares | E | Jan. 17, 2025, 6:29 p.m. | OK | PyPy 3-64 | TESTS | 40 | 1733 | 168448000 |
Back to search problems