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 |
---|---|---|---|---|---|---|
1704 | CodeTON Round 2 (Div. 1 + Div. 2, Rated, Prizes!) | FINISHED | False | 9000 | 72546899 | July 31, 2022, 2:05 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 2375 ) | E | Count Seconds | PROGRAMMING | brute force constructive algorithms dp graphs |
B'Cirno has a DAG (Directed Acyclic Graph) with n nodes and m edges. The graph has exactly one node that has no out edges. The i -th node has an integer a_i on it. Every second the following happens: Find the first moment of time when all a_i become 0 . Since the answer can be very large, output it modulo 998 ,244 ,353 . The first line contains a single integer t ( 1 <= q t <= q 1000 ) -- the number of test cases. Description of test cases follows. The first line of each test case contains two integers n, m ( 1 <= q n, m <= q 1000 ) -- the number of vertices and edges in the graph. The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 0 <= q a_i <= q 10^9 ) -- the integer on vertices. Each line of the following m lines contains two integers x, y ( 1 <= q x, y <= q n ), represent a directed edge from x to y . It is guaranteed that the graph is a DAG with no multi-edges, and there is exactly one node that has no out edges. It is guaranteed that both sum of n and sum of m over all test cases are less than or equal to 10 ,000 . For each test case, print an integer in a separate line -- the first moment of time when all a_i become 0 , modulo 998 ,244 ,353 . In the first test case: So the answer is 3 . In the third test case: The first moment of time when all a_i become 0 is 6 cdot 998244353 + 4 . '... |
CodeTON Round 2 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
166382928 | Gassa | E | July 31, 2022, 3:18 p.m. | OK | D | TESTS | 67 | 280 | 6144000 | ||
166395317 | Rayshifter | E | July 31, 2022, 4:12 p.m. | OK | GNU C++14 | TESTS | 67 | 30 | 307200 | ||
166443115 | lindalee | E | Aug. 1, 2022, 5:34 a.m. | OK | GNU C++14 | TESTS | 81 | 31 | 0 | ||
166395159 | Zhangxuyang | E | July 31, 2022, 4:11 p.m. | OK | GNU C++14 | TESTS | 67 | 31 | 102400 | ||
166427370 | Syf2020 | E | Aug. 1, 2022, 1:15 a.m. | OK | GNU C++14 | TESTS | 79 | 31 | 204800 | ||
166406716 | Syf2020 | E | July 31, 2022, 6:19 p.m. | OK | GNU C++14 | TESTS | 69 | 31 | 204800 | ||
166389386 | ykl | E | July 31, 2022, 3:44 p.m. | OK | GNU C++14 | TESTS | 67 | 31 | 204800 | ||
166389165 | __sleep | E | July 31, 2022, 3:42 p.m. | OK | GNU C++14 | TESTS | 67 | 31 | 204800 | ||
166398333 | mathking1021 | E | July 31, 2022, 4:27 p.m. | OK | GNU C++14 | TESTS | 67 | 31 | 307200 | ||
166396838 | LovelyEther | E | July 31, 2022, 4:20 p.m. | OK | GNU C++14 | TESTS | 67 | 31 | 307200 | ||
166395244 | AlternatingCurrent | E | July 31, 2022, 4:12 p.m. | OK | GNU C++14 | TESTS | 67 | 31 | 307200 | ||
166388083 | HailHomura | E | July 31, 2022, 3:38 p.m. | OK | GNU C++17 | TESTS | 67 | 15 | 307200 | ||
166413682 | Bobocan | E | July 31, 2022, 7:41 p.m. | OK | GNU C++17 | TESTS | 76 | 15 | 921600 | ||
166397895 | Ziad_Yousef | E | July 31, 2022, 4:25 p.m. | OK | GNU C++17 | TESTS | 67 | 30 | 307200 | ||
166392858 | tem_shett | E | July 31, 2022, 3:59 p.m. | OK | GNU C++17 | TESTS | 67 | 30 | 307200 | ||
166396037 | baqargam | E | July 31, 2022, 4:16 p.m. | OK | GNU C++17 | TESTS | 67 | 30 | 3072000 | ||
166395599 | orangecalculator | E | July 31, 2022, 4:14 p.m. | OK | GNU C++17 | TESTS | 67 | 31 | 204800 | ||
166393173 | vanogam | E | July 31, 2022, 4:01 p.m. | OK | GNU C++17 | TESTS | 67 | 31 | 204800 | ||
166392592 | Aging1986 | E | July 31, 2022, 3:58 p.m. | OK | GNU C++17 | TESTS | 67 | 31 | 204800 | ||
166388740 | 275307894b | E | July 31, 2022, 3:41 p.m. | OK | GNU C++17 | TESTS | 67 | 31 | 204800 | ||
166387883 | serotonin | E | July 31, 2022, 3:37 p.m. | OK | GNU C++17 | TESTS | 67 | 31 | 204800 | ||
166429093 | adventure | E | Aug. 1, 2022, 1:41 a.m. | OK | GNU C++17 (64) | TESTS | 79 | 15 | 204800 | ||
166388642 | lucasxia01 | E | July 31, 2022, 3:40 p.m. | OK | GNU C++17 (64) | TESTS | 67 | 15 | 204800 | ||
166398125 | ymy40378 | E | July 31, 2022, 4:26 p.m. | OK | GNU C++17 (64) | TESTS | 67 | 15 | 307200 | ||
166387771 | Kazumin | E | July 31, 2022, 3:37 p.m. | OK | GNU C++17 (64) | TESTS | 67 | 15 | 307200 | ||
166395821 | SanweiTreap | E | July 31, 2022, 4:15 p.m. | OK | GNU C++17 (64) | TESTS | 67 | 30 | 102400 | ||
166390884 | zqyyy | E | July 31, 2022, 3:50 p.m. | OK | GNU C++17 (64) | TESTS | 67 | 30 | 204800 | ||
166388263 | Hyperbolic | E | July 31, 2022, 3:39 p.m. | OK | GNU C++17 (64) | TESTS | 67 | 30 | 204800 | ||
166398378 | torisasami | E | July 31, 2022, 4:27 p.m. | OK | GNU C++17 (64) | TESTS | 67 | 30 | 307200 | ||
166382589 | tabr | E | July 31, 2022, 3:17 p.m. | OK | GNU C++17 (64) | TESTS | 67 | 30 | 307200 | ||
166441974 | xju_lyc | E | Aug. 1, 2022, 5:16 a.m. | OK | GNU C++17 (64) | TESTS | 81 | 31 | 0 | ||
166407295 | yash_daga | E | July 31, 2022, 6:24 p.m. | OK | GNU C++20 (64) | TESTS | 69 | 15 | 102400 | ||
166406112 | A_G | E | July 31, 2022, 6:15 p.m. | OK | GNU C++20 (64) | TESTS | 68 | 15 | 102400 | ||
166392406 | Evirir | E | July 31, 2022, 3:57 p.m. | OK | GNU C++20 (64) | TESTS | 67 | 15 | 102400 | ||
166409102 | Ivan_len | E | July 31, 2022, 6:41 p.m. | OK | GNU C++20 (64) | TESTS | 73 | 15 | 204800 | ||
166408504 | ppps | E | July 31, 2022, 6:35 p.m. | OK | GNU C++20 (64) | TESTS | 73 | 15 | 204800 | ||
166407198 | ppps | E | July 31, 2022, 6:23 p.m. | OK | GNU C++20 (64) | TESTS | 69 | 15 | 204800 | ||
166382631 | trieboi | E | July 31, 2022, 3:17 p.m. | OK | GNU C++20 (64) | TESTS | 67 | 15 | 204800 | ||
166409482 | choux_la_creme | E | July 31, 2022, 6:46 p.m. | OK | GNU C++20 (64) | TESTS | 74 | 15 | 307200 | ||
166400069 | SpadeZ | E | July 31, 2022, 4:34 p.m. | OK | GNU C++20 (64) | TESTS | 67 | 15 | 307200 | ||
166390347 | ajpiano | E | July 31, 2022, 3:48 p.m. | OK | GNU C++20 (64) | TESTS | 67 | 15 | 307200 | ||
166383591 | eatmore | E | July 31, 2022, 3:21 p.m. | OK | Java 11 | TESTS | 67 | 202 | 0 | ||
166423038 | dzhi | E | July 31, 2022, 11:04 p.m. | OK | Java 11 | TESTS | 77 | 233 | 0 | ||
166422988 | dzhi | E | July 31, 2022, 11:03 p.m. | OK | Java 11 | TESTS | 77 | 233 | 0 | ||
166392306 | mmaxio | E | July 31, 2022, 3:57 p.m. | OK | Java 11 | TESTS | 67 | 233 | 0 | ||
166396331 | profchi | E | July 31, 2022, 4:17 p.m. | OK | Java 11 | TESTS | 67 | 248 | 0 | ||
166431330 | dusty.and.rusty | E | Aug. 1, 2022, 2:16 a.m. | OK | Java 11 | TESTS | 79 | 264 | 0 | ||
166408882 | dusty.and.rusty | E | July 31, 2022, 6:39 p.m. | OK | Java 11 | TESTS | 73 | 265 | 0 | ||
166410223 | dusty.and.rusty | E | July 31, 2022, 6:55 p.m. | OK | Java 11 | TESTS | 74 | 311 | 0 | ||
166412261 | megaspazz | E | July 31, 2022, 7:21 p.m. | OK | Java 11 | TESTS | 76 | 389 | 0 | ||
166416771 | dunkingdonuts | E | July 31, 2022, 8:30 p.m. | OK | Java 11 | TESTS | 77 | 421 | 0 | ||
166394580 | freehandle | E | July 31, 2022, 4:08 p.m. | OK | Java 17 | TESTS | 67 | 280 | 512000 | ||
166407293 | Dukkha | E | July 31, 2022, 6:24 p.m. | OK | Java 17 | TESTS | 69 | 311 | 1024000 | ||
166412317 | megaspazz | E | July 31, 2022, 7:22 p.m. | OK | Java 17 | TESTS | 76 | 483 | 819200 | ||
166436003 | xxafhixx | E | Aug. 1, 2022, 3:31 a.m. | OK | Java 17 | TESTS | 80 | 577 | 819200 | ||
166411984 | megaspazz | E | July 31, 2022, 7:17 p.m. | OK | Java 17 | TESTS | 76 | 951 | 409600 | ||
166386330 | SecondThread | E | July 31, 2022, 3:31 p.m. | OK | Java 8 | TESTS | 67 | 155 | 38502400 | ||
166407740 | cftauros | E | July 31, 2022, 6:28 p.m. | OK | Java 8 | TESTS | 72 | 218 | 0 | ||
166407357 | cftauros | E | July 31, 2022, 6:24 p.m. | OK | Java 8 | TESTS | 69 | 218 | 0 | ||
166432394 | megaspazz | E | Aug. 1, 2022, 2:34 a.m. | OK | Java 8 | TESTS | 79 | 296 | 0 | ||
166412904 | megaspazz | E | July 31, 2022, 7:29 p.m. | OK | Java 8 | TESTS | 76 | 342 | 0 | ||
166412342 | megaspazz | E | July 31, 2022, 7:22 p.m. | OK | Java 8 | TESTS | 76 | 342 | 0 | ||
166411969 | megaspazz | E | July 31, 2022, 7:17 p.m. | OK | Java 8 | TESTS | 76 | 779 | 0 | ||
166388422 | Hakiobo | E | July 31, 2022, 3:39 p.m. | OK | Kotlin 1.4 | TESTS | 67 | 187 | 1740800 | ||
166391759 | elizarov | E | July 31, 2022, 3:54 p.m. | OK | Kotlin 1.6 | TESTS | 67 | 296 | 307200 | ||
166385838 | LeoPro | E | July 31, 2022, 3:29 p.m. | OK | Kotlin 1.6 | TESTS | 67 | 498 | 102400 | ||
166437185 | hawaiianpizza | E | Aug. 1, 2022, 3:50 a.m. | OK | MS C++ 2017 | TESTS | 80 | 93 | 102400 | ||
166405654 | beckusator | E | July 31, 2022, 6:13 p.m. | OK | MS C++ 2017 | TESTS | 67 | 93 | 4096000 | ||
166388042 | machine_solution | E | July 31, 2022, 3:38 p.m. | OK | MS C++ 2017 | TESTS | 67 | 124 | 512000 | ||
166394630 | lddlinan | E | July 31, 2022, 4:08 p.m. | OK | PyPy 2 | TESTS | 67 | 858 | 144691200 | ||
166398490 | titia | E | July 31, 2022, 4:28 p.m. | OK | PyPy 3 | TESTS | 67 | 249 | 9113600 | ||
166440237 | zouyu9631 | E | Aug. 1, 2022, 4:45 a.m. | OK | PyPy 3 | TESTS | 80 | 342 | 45670400 | ||
166390396 | ruimina | E | July 31, 2022, 3:48 p.m. | OK | PyPy 3 | TESTS | 67 | 467 | 9523200 | ||
166417578 | Eddard | E | July 31, 2022, 8:44 p.m. | OK | PyPy 3 | TESTS | 77 | 483 | 45977600 | ||
166439501 | zouyu9631 | E | Aug. 1, 2022, 4:33 a.m. | OK | PyPy 3 | TESTS | 80 | 795 | 10752000 | ||
166439465 | zouyu9631 | E | Aug. 1, 2022, 4:32 a.m. | OK | PyPy 3 | TESTS | 80 | 826 | 10444800 | ||
166408906 | titia | E | July 31, 2022, 6:39 p.m. | OK | PyPy 3-64 | TESTS | 73 | 217 | 9932800 | ||
166390942 | duck702702 | E | July 31, 2022, 3:50 p.m. | OK | PyPy 3-64 | TESTS | 67 | 264 | 9625600 | ||
166407496 | aqxa | E | July 31, 2022, 6:26 p.m. | OK | PyPy 3-64 | TESTS | 69 | 296 | 9932800 | ||
166435685 | siganai | E | Aug. 1, 2022, 3:26 a.m. | OK | PyPy 3-64 | TESTS | 80 | 327 | 9728000 | ||
166407442 | aqxa2k | E | July 31, 2022, 6:25 p.m. | OK | PyPy 3-64 | TESTS | 69 | 342 | 9932800 | ||
166412746 | PotassiumWings | E | July 31, 2022, 7:27 p.m. | OK | PyPy 3-64 | TESTS | 76 | 358 | 10649600 | ||
166392649 | xxh1999 | E | July 31, 2022, 3:58 p.m. | OK | PyPy 3-64 | TESTS | 67 | 373 | 77619200 | ||
166383668 | BasicTH | E | July 31, 2022, 3:21 p.m. | OK | PyPy 3-64 | TESTS | 67 | 405 | 32153600 | ||
166393131 | oshamashama | E | July 31, 2022, 4:01 p.m. | OK | PyPy 3-64 | TESTS | 67 | 529 | 49766400 | ||
166387607 | Arsen4ikVar | E | July 31, 2022, 3:36 p.m. | OK | PyPy 3-64 | TESTS | 67 | 545 | 10854400 | ||
166406985 | Niklassanden | E | July 31, 2022, 6:21 p.m. | OK | Rust 2021 | TESTS | 69 | 31 | 409600 | ||
166412066 | Thallium54 | E | July 31, 2022, 7:18 p.m. | OK | Rust 2021 | TESTS | 76 | 46 | 512000 | ||
166411556 | 45muillaht | E | July 31, 2022, 7:11 p.m. | OK | Rust 2021 | TESTS | 76 | 46 | 512000 |
Back to search problems