Atto Round 1 (Codeforces Round 1041, Div. 1 + Div. 2)

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
2127 Atto Round 1 (Codeforces Round 1041, Div. 1 + Div. 2) FINISHED False 10800 21828323 Aug. 7, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 6159 ) D Root was Built by Love, Broken by Destiny PROGRAMMING combinatorics dfs and similar graphs trees

Heartfall River runs horizontally through Destinyland and divides it into the northern and southern sides. Engineer Root wants to build (n) houses along the river, numbered from (1) to (n). All houses on the northern side and all houses on the southern side must lie along straight lines parallel to Heartfall River. There will be (m) bridges, with the (i)-th bridge connecting house (u_i) and house (v_i) ((u_i \ne v_i)). It is guaranteed that all (n) houses are connected by these bridges, that is, you can travel from any house to any other by crossing bridges. Also, there are no two bridges connecting the same pair of houses. Root wants to know how many ways there are to arrange the (n) houses along the river, modulo (10^9+7), such that the following conditions hold for the planned (m) bridges: For every bridge, the two houses it connects lie on opposite sides of the river; The bridges do not cross when drawn as straight lines between the houses. Two arrangements are considered different if at least one of the following conditions holds: There exists a house that lies on a different side in each arrangement; There exist two houses (a) and (b) that are on the same side in both arrangements, but (a) comes before (b) in one arrangement and (b) comes before (a) in the other. Since Root is distracted by his ex, whom destiny separated from him, he asks you to calculate the number of ways to arrange the houses along the river, modulo (10^9+7). 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) ((2 \leq n \leq 2 \cdot 10^5), (n-1 \leq m \leq \min\left(\frac{n(n-1)}{2}, 2 \cdot 10^5\right))) — the number of houses and the number of bridges. Then (m) lines follow, the (i)-th line containing

Tutorials

Atto Round 1 (Codeforces Round 1041, Div. 1 + Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
332942002 LXL4510 D Aug. 8, 2025, 2:24 a.m. OK C++17 (GCC 7-32) TESTS 18 140 6451200
332904741 Links D Aug. 7, 2025, 5:30 p.m. OK C++17 (GCC 7-32) TESTS 18 140 14233600
332935727 robo7179 D Aug. 8, 2025, 12:40 a.m. OK C++17 (GCC 7-32) TESTS 18 171 3891200
332938823 Hex1234567 D Aug. 8, 2025, 1:37 a.m. OK C++17 (GCC 7-32) TESTS 18 171 3993600
332932347 Abdulqawi D Aug. 7, 2025, 11:06 p.m. OK C++17 (GCC 7-32) TESTS 18 171 5529600
332919317 mhxtc D Aug. 7, 2025, 7:17 p.m. OK C++17 (GCC 7-32) TESTS 18 171 7270400
332933340 FwP-ID D Aug. 7, 2025, 11:42 p.m. OK C++17 (GCC 7-32) TESTS 18 186 8089600
332918497 Karieciation D Aug. 7, 2025, 7:09 p.m. OK C++17 (GCC 7-32) TESTS 18 186 39628800
332949400 Bayaraa980 D Aug. 8, 2025, 3:58 a.m. OK C++17 (GCC 7-32) TESTS 18 187 3993600
332918305 ritsrnjn D Aug. 7, 2025, 7:07 p.m. OK C++17 (GCC 7-32) TESTS 18 187 5734400
332949647 temp_swufe D Aug. 8, 2025, 4:02 a.m. OK C++20 (GCC 13-64) TESTS 18 140 16486400
332945860 TSY12 D Aug. 8, 2025, 3:14 a.m. OK C++20 (GCC 13-64) TESTS 18 155 6860800
332901149 omsincoconut D Aug. 7, 2025, 5:21 p.m. OK C++20 (GCC 13-64) TESTS 18 156 1228800
332933546 oapabhaiya15356 D Aug. 7, 2025, 11:50 p.m. OK C++20 (GCC 13-64) TESTS 18 156 6860800
332941071 HaHeHyt D Aug. 8, 2025, 2:12 a.m. OK C++20 (GCC 13-64) TESTS 18 156 20684800
332941018 viggil D Aug. 8, 2025, 2:12 a.m. OK C++20 (GCC 13-64) TESTS 18 156 26316800
332957929 xingke233 D Aug. 8, 2025, 5:43 a.m. OK C++20 (GCC 13-64) TESTS 18 156 40857600
332949613 doreen129 D Aug. 8, 2025, 4:01 a.m. OK C++20 (GCC 13-64) TESTS 18 171 6758400
332924820 Ra_ist D Aug. 7, 2025, 8:19 p.m. OK C++20 (GCC 13-64) TESTS 18 171 6758400
332945021 btoandizi D Aug. 8, 2025, 3:04 a.m. OK C++20 (GCC 13-64) TESTS 18 171 6860800
332932144 MixxCP3 D Aug. 7, 2025, 10:59 p.m. OK C++23 (GCC 14-64, msys2) TESTS 18 124 2048000
332944015 duchuan75 D Aug. 8, 2025, 2:51 a.m. OK C++23 (GCC 14-64, msys2) TESTS 18 156 6963200
332950249 script.kidd D Aug. 8, 2025, 4:10 a.m. OK C++23 (GCC 14-64, msys2) TESTS 18 156 7168000
332938736 gaojtccc D Aug. 8, 2025, 1:35 a.m. OK C++23 (GCC 14-64, msys2) TESTS 18 156 7270400
332943618 hgzx D Aug. 8, 2025, 2:46 a.m. OK C++23 (GCC 14-64, msys2) TESTS 18 156 7782400
332930757 Sahilaccount D Aug. 7, 2025, 10:16 p.m. OK C++23 (GCC 14-64, msys2) TESTS 18 156 7782400
332959230 __praveen D Aug. 8, 2025, 5:55 a.m. OK C++23 (GCC 14-64, msys2) TESTS 18 156 11571200
332943754 Rsclet D Aug. 8, 2025, 2:47 a.m. OK C++23 (GCC 14-64, msys2) TESTS 18 156 32972800
332933016 A_G D Aug. 7, 2025, 11:31 p.m. OK C++23 (GCC 14-64, msys2) TESTS 18 171 6144000
332946956 radhekrishn04 D Aug. 8, 2025, 3:29 a.m. OK C++23 (GCC 14-64, msys2) TESTS 18 171 6963200
332925312 rainboy D Aug. 7, 2025, 8:25 p.m. OK GNU C11 TESTS 18 109 3993600
332905459 danCrusoe D Aug. 7, 2025, 5:31 p.m. OK Go TESTS 18 358 50483200
332926886 kartik__sethi D Aug. 7, 2025, 8:50 p.m. OK Java 21 TESTS 18 671 36864000
332959896 iamalizaidi D Aug. 8, 2025, 6:02 a.m. OK Java 21 TESTS 18 734 41164800
332918672 lupunish D Aug. 7, 2025, 7:11 p.m. OK Java 21 TESTS 18 890 77619200
332906547 ibrahimjp630 D Aug. 7, 2025, 5:33 p.m. OK Java 21 TESTS 18 1562 56627200
332906253 kytrieu D Aug. 7, 2025, 5:33 p.m. OK Java 21 TESTS 18 1578 58675200
332917774 kasiru_69 D Aug. 7, 2025, 7:03 p.m. OK Java 8 TESTS 18 483 28979200
332907130 KaranKamath D Aug. 7, 2025, 5:34 p.m. OK Java 8 TESTS 18 671 54476800
332948913 xmjlove D Aug. 8, 2025, 3:53 a.m. OK Java 8 TESTS 18 686 59904000
332936372 testtest111ksjfrdvn D Aug. 8, 2025, 12:52 a.m. OK Java 8 TESTS 18 733 124416000
332913587 leonlian D Aug. 7, 2025, 6:32 p.m. OK Java 8 TESTS 18 734 49971200
332906604 saicharangopisetty23 D Aug. 7, 2025, 5:34 p.m. OK Java 8 TESTS 18 1342 69632000
332898534 vasily.slesarev D Aug. 7, 2025, 5:14 p.m. OK Java 8 TESTS 18 1468 100761600
332919820 L-S-S D Aug. 7, 2025, 7:22 p.m. OK Kotlin 1.9 TESTS 18 733 53657600
332907271 kaedeeeee D Aug. 7, 2025, 5:34 p.m. OK PyPy 3 TESTS 18 671 35532800
332943901 pipylon D Aug. 8, 2025, 2:49 a.m. OK PyPy 3 TESTS 18 1343 35840000
332919991 minuki646 D Aug. 7, 2025, 7:23 p.m. OK PyPy 3-64 TESTS 18 359 39936000
332920273 minuki646 D Aug. 7, 2025, 7:26 p.m. OK PyPy 3-64 TESTS 18 374 38912000
332901382 Ayis137 D Aug. 7, 2025, 5:22 p.m. OK PyPy 3-64 TESTS 18 421 56627200
332899151 xyyyyyyyyyyy D Aug. 7, 2025, 5:16 p.m. OK PyPy 3-64 TESTS 18 437 44236800
332949617 hokto D Aug. 8, 2025, 4:01 a.m. OK PyPy 3-64 TESTS 18 452 43929600
332931033 abcsumits D Aug. 7, 2025, 10:25 p.m. OK PyPy 3-64 TESTS 18 453 54169600
332916388 bishoprunner D Aug. 7, 2025, 6:52 p.m. OK PyPy 3-64 TESTS 18 468 41472000
332946968 jakekim D Aug. 8, 2025, 3:29 a.m. OK PyPy 3-64 TESTS 18 484 56729600
332914438 iska_terminator D Aug. 7, 2025, 6:37 p.m. OK PyPy 3-64 TESTS 18 499 64409600
332923145 DarkTemplarDrop D Aug. 7, 2025, 7:58 p.m. OK PyPy 3-64 TESTS 18 562 47513600
332901797 Jimanbanashi D Aug. 7, 2025, 5:23 p.m. OK Python 2 TESTS 18 796 38092800
332936284 ayushdreams147 D Aug. 8, 2025, 12:51 a.m. OK Python 3 TESTS 18 578 44236800
332927104 123gjweq2 D Aug. 7, 2025, 8:54 p.m. OK Rust 2021 TESTS 18 280 47411200
332901563 Darkcoder404 D Aug. 7, 2025, 5:22 p.m. OK Rust 2021 TESTS 18 281 44339200
332898917 kz2d D Aug. 7, 2025, 5:15 p.m. OK Rust 2021 TESTS 18 281 67686400

remove filters

Back to search problems