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 |
---|---|---|---|---|---|---|
1830 | Codeforces Round 875 (Div. 1) | FINISHED | False | 9000 | 51895463 | May 28, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 1755 ) | C | Hyperregular Bracket Strings | PROGRAMMING | combinatorics hashing number theory sortings two pointers |
B'You are given an integer n and k intervals. The i -th interval is [l_i,r_i] where 1 <= q l_i <= q r_i <= q n . Let us call a regular bracket sequence ^{ dagger, ddagger} of length n hyperregular if for each i such that 1 <= q i <= q k , the substring overline{s_{l_i} s_{l_{i}+1} ldots s_{r_i}} is also a regular bracket sequence. Your task is to count the number of hyperregular bracket sequences. Since this number can be really large, you are only required to find it modulo 998 ,244 ,353 . ^ dagger A bracket sequence is a string containing only the characters "(" and ")". ^ ddagger A bracket sequence is called regular if one can turn it into a valid math expression by adding characters + and 1. For example, sequences (())(), (), (()(())) and the empty string are regular, while )(, ((), and (()))( are not. Each test contains multiple test cases. The first line of input contains a single integer t ( 1 <= t <= 10^5 ) -- the number of test cases. The description of test cases follows. The first line of each test case contains two integers n and k ( 1 <= n <= 3 cdot 10^5 , 0 <= k <= 3 cdot 10^5 ) -- the length of the hyperregular bracket sequences and the number of intervals respectively. The following k lines of each test case contains two integers l_i and r_i ( 1 <= l <= r <= n ). It is guaranteed that the sum of n across all test cases does not exceed 3 cdot 10^5 and the sum of k across all test cases does not exceed 3 cdot 10^5 . For each test case, output the number of hyperregular bracket sequences modulo 998 ,244 ,353 . '... |
Codeforces Round #875 (Div.1 + Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
207653221 | Gassa | C | May 28, 2023, 4:27 p.m. | OK | D | TESTS | 14 | 670 | 41267200 | ||
207622607 | cyh_toby | C | May 28, 2023, 3:24 p.m. | OK | GNU C++14 | TESTS | 14 | 171 | 9625600 | ||
207652062 | MakaPakka | C | May 28, 2023, 4:24 p.m. | OK | GNU C++14 | TESTS | 14 | 202 | 19251200 | ||
207670146 | awoo | C | May 28, 2023, 5:44 p.m. | OK | GNU C++14 | TESTS | 14 | 233 | 23654400 | ||
207639055 | t98slider | C | May 28, 2023, 3:54 p.m. | OK | GNU C++14 | TESTS | 14 | 249 | 7577600 | ||
207692040 | Steven__Chen | C | May 28, 2023, 11:55 p.m. | OK | GNU C++14 | TESTS | 18 | 249 | 37068800 | ||
207693260 | ztcakioi | C | May 29, 2023, 12:37 a.m. | OK | GNU C++14 | TESTS | 18 | 265 | 24268800 | ||
207654379 | _anodiebird | C | May 28, 2023, 4:30 p.m. | OK | GNU C++14 | TESTS | 14 | 280 | 16588800 | ||
207694993 | Flamire | C | May 29, 2023, 1:25 a.m. | OK | GNU C++14 | TESTS | 18 | 296 | 20582400 | ||
207670373 | mod998244353 | C | May 28, 2023, 5:45 p.m. | OK | GNU C++14 | TESTS | 14 | 296 | 24166400 | ||
207694138 | ZSH_ZSH | C | May 29, 2023, 1:03 a.m. | OK | GNU C++14 | TESTS | 18 | 327 | 20582400 | ||
207680505 | marsxiang5902 | C | May 28, 2023, 7:19 p.m. | OK | GNU C++17 | TESTS | 16 | 187 | 17203200 | ||
207667033 | lxhgww | C | May 28, 2023, 5:03 p.m. | OK | GNU C++17 | TESTS | 14 | 187 | 24576000 | ||
207652665 | Aging1986 | C | May 28, 2023, 4:26 p.m. | OK | GNU C++17 | TESTS | 14 | 202 | 20582400 | ||
207678737 | NegaTeeF | C | May 28, 2023, 6:57 p.m. | OK | GNU C++17 | TESTS | 16 | 233 | 13312000 | ||
207689909 | ethening | C | May 28, 2023, 10:31 p.m. | OK | GNU C++17 | TESTS | 18 | 233 | 20582400 | ||
207656728 | MarbIue | C | May 28, 2023, 4:37 p.m. | OK | GNU C++17 | TESTS | 14 | 233 | 56217600 | ||
207654540 | Rudeus | C | May 28, 2023, 4:31 p.m. | OK | GNU C++17 | TESTS | 14 | 249 | 12083200 | ||
207693293 | zlc1114_v2 | C | May 29, 2023, 12:38 a.m. | OK | GNU C++17 | TESTS | 18 | 264 | 75878400 | ||
207630157 | nishkarsh | C | May 28, 2023, 3:37 p.m. | OK | GNU C++17 | TESTS | 14 | 265 | 20889600 | ||
207666876 | Outlier_ | C | May 28, 2023, 5:03 p.m. | OK | GNU C++17 | TESTS | 14 | 265 | 37888000 | ||
207622025 | Z-302 | C | May 28, 2023, 3:23 p.m. | OK | GNU C++17 (64) | TESTS | 14 | 109 | 18227200 | ||
207695840 | lqx2005 | C | May 29, 2023, 1:46 a.m. | OK | GNU C++17 (64) | TESTS | 19 | 124 | 11980800 | ||
207673756 | Lawali | C | May 28, 2023, 6:07 p.m. | OK | GNU C++17 (64) | TESTS | 16 | 155 | 27750400 | ||
207693582 | orzdevinwang | C | May 29, 2023, 12:47 a.m. | OK | GNU C++17 (64) | TESTS | 18 | 156 | 70860800 | ||
207646950 | kotatsugame | C | May 28, 2023, 4:12 p.m. | OK | GNU C++17 (64) | TESTS | 14 | 170 | 27443200 | ||
207682794 | Sana | C | May 28, 2023, 7:52 p.m. | OK | GNU C++17 (64) | TESTS | 16 | 171 | 20992000 | ||
207658476 | zihouzhong | C | May 28, 2023, 4:41 p.m. | OK | GNU C++17 (64) | TESTS | 14 | 186 | 15360000 | ||
207622590 | sunzh | C | May 28, 2023, 3:24 p.m. | OK | GNU C++17 (64) | TESTS | 14 | 202 | 13926400 | ||
207608198 | tute7627 | C | May 28, 2023, 3:03 p.m. | OK | GNU C++17 (64) | TESTS | 14 | 202 | 22118400 | ||
207610887 | 244mhq | C | May 28, 2023, 3:07 p.m. | OK | GNU C++17 (64) | TESTS | 14 | 202 | 34099200 | ||
207706862 | Nero | C | May 29, 2023, 3:13 a.m. | OK | GNU C++20 (64) | TESTS | 19 | 93 | 4812800 | ||
207682861 | iliya7 | C | May 28, 2023, 7:53 p.m. | OK | GNU C++20 (64) | TESTS | 16 | 93 | 4812800 | ||
207715033 | Nero | C | May 29, 2023, 5:25 a.m. | OK | GNU C++20 (64) | TESTS | 20 | 93 | 11571200 | ||
207715464 | Nero | C | May 29, 2023, 5:31 a.m. | OK | GNU C++20 (64) | TESTS | 20 | 93 | 14643200 | ||
207600441 | tourist | C | May 28, 2023, 2:53 p.m. | OK | GNU C++20 (64) | TESTS | 14 | 109 | 4812800 | ||
207674998 | xindubawukong | C | May 28, 2023, 6:17 p.m. | OK | GNU C++20 (64) | TESTS | 16 | 109 | 6041600 | ||
207653096 | risujiroh | C | May 28, 2023, 4:27 p.m. | OK | GNU C++20 (64) | TESTS | 14 | 109 | 7270400 | ||
207715744 | Ivan_len | C | May 29, 2023, 5:35 a.m. | OK | GNU C++20 (64) | TESTS | 20 | 109 | 9113600 | ||
207613818 | ecnerwala | C | May 28, 2023, 3:11 p.m. | OK | GNU C++20 (64) | TESTS | 14 | 109 | 9625600 | ||
207716231 | Nero | C | May 29, 2023, 5:42 a.m. | OK | GNU C++20 (64) | TESTS | 20 | 109 | 13516800 | ||
207714599 | 0x3F | C | May 29, 2023, 5:18 a.m. | OK | Go | TESTS | 20 | 264 | 26214400 | ||
207716132 | 0x3F | C | May 29, 2023, 5:40 a.m. | OK | Go | TESTS | 20 | 280 | 26214400 | ||
207715082 | 0x3F | C | May 29, 2023, 5:26 a.m. | OK | Go | TESTS | 20 | 467 | 32665600 | ||
207715593 | 0x3F | C | May 29, 2023, 5:33 a.m. | OK | Go | TESTS | 20 | 483 | 32665600 | ||
207636070 | Tlatoani | C | May 28, 2023, 3:48 p.m. | OK | Kotlin 1.6 | TESTS | 14 | 1138 | 29491200 | ||
207632370 | FastFreeTask | C | May 28, 2023, 3:42 p.m. | OK | Kotlin 1.6 | TESTS | 14 | 1169 | 26214400 | ||
207654676 | kyoran | C | May 28, 2023, 4:31 p.m. | OK | PyPy 3-64 | TESTS | 14 | 592 | 30105600 | ||
207694098 | Little_Sheep_Yawn | C | May 29, 2023, 1:02 a.m. | OK | PyPy 3-64 | TESTS | 18 | 1201 | 96358400 | ||
207667301 | hxu10 | C | May 28, 2023, 5:04 p.m. | OK | PyPy 3-64 | TESTS | 14 | 1965 | 95744000 | ||
207641775 | plevande | C | May 28, 2023, 4 p.m. | OK | PyPy 3-64 | TESTS | 14 | 2854 | 109568000 | ||
207628948 | sansen | C | May 28, 2023, 3:35 p.m. | OK | Rust 2021 | TESTS | 14 | 78 | 18534400 | ||
207690012 | magnus.hegdahl | C | May 28, 2023, 10:35 p.m. | OK | Rust 2021 | TESTS | 18 | 670 | 128307200 | ||
207620063 | Egor | C | May 28, 2023, 3:20 p.m. | OK | Rust 2021 | TESTS | 14 | 1154 | 59904000 |
Back to search problems