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 |
---|---|---|---|---|---|---|
1534 | Codeforces LATOKEN Round 1 (Div. 1 + Div. 2) | FINISHED | False | 10800 | 108224699 | June 13, 2021, 3:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 12878 ) | C | Little Alawn's Puzzle | PROGRAMMING | combinatorics dfs and similar dp ds graphs math |
B"When he's not training for IOI, Little Alawn enjoys playing with puzzles of various types to stimulate his brain. Today, he's playing with a puzzle that consists of a 2 x n grid where each row is a permutation of the numbers 1,2,3, ldots,n . The goal of Little Alawn's puzzle is to make sure no numbers on the same column or row are the same (we'll call this state of the puzzle as solved), and to achieve this he is able to swap the numbers in any column. However, after solving the puzzle many times, Little Alawn got bored and began wondering about the number of possible solved configurations of the puzzle he could achieve from an initial solved configuration only by swapping numbers in a column. Unfortunately, Little Alawn got stuck while trying to solve this harder problem, so he was wondering if you could help him with it. Find the answer modulo 10^9+7 . Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10^4 ). Description of the test cases follows. The first line of each test case contains a single integer n ( 2 <= n <= 4 cdot 10^5 ). The next two lines of each test case describe the initial state of the puzzle grid. Each line will be a permutation of the numbers 1,2,3, ldots,n and the numbers in each column and row will be pairwise distinct. It is guaranteed that the sum of n over all test cases does not exceed 4 cdot 10^5 . For each test case output a single integer, the number of possible solved configurations of the puzzle Little Alawn can achieve from an initial solved configuration only by swapping numbers in a column. As the answer can be very large, please output it modulo 10^9+7 . The answer for each test case should be on a separate line. The two possible puzzle configurations for example 1 are: "... |
Codeforces LATOKEN Round 1 (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 |
---|---|---|---|---|---|---|---|---|---|---|---|
119411079 | cutx64 | C | June 14, 2021, 2:26 a.m. | OK | D | TESTS | 27 | 171 | 24064000 | ||
119409302 | wxg_Jay | C | June 14, 2021, 1:31 a.m. | OK | GNU C++11 | TESTS | 27 | 46 | 10035200 | ||
119416728 | xwp | C | June 14, 2021, 4:27 a.m. | OK | GNU C++11 | TESTS | 27 | 46 | 24064000 | ||
119407841 | Werner_Yin | C | June 14, 2021, 12:18 a.m. | OK | GNU C++11 | TESTS | 27 | 61 | 4812800 | ||
119410006 | zhoumofei | C | June 14, 2021, 1:53 a.m. | OK | GNU C++11 | TESTS | 27 | 62 | 12800000 | ||
119408506 | use_fft | C | June 14, 2021, 12:55 a.m. | OK | GNU C++11 | TESTS | 27 | 62 | 19251200 | ||
119414265 | Aestas16 | C | June 14, 2021, 3:38 a.m. | OK | GNU C++11 | TESTS | 27 | 78 | 16076800 | ||
119420903 | TQX | C | June 14, 2021, 5:37 a.m. | OK | GNU C++11 | TESTS | 27 | 139 | 6451200 | ||
119412405 | TQX | C | June 14, 2021, 2:59 a.m. | OK | GNU C++11 | TESTS | 27 | 139 | 6451200 | ||
119409031 | _Leaving_ | C | June 14, 2021, 1:21 a.m. | OK | GNU C++11 | TESTS | 27 | 140 | 4608000 | ||
119409543 | Huah | C | June 14, 2021, 1:39 a.m. | OK | GNU C++11 | TESTS | 27 | 140 | 6553600 | ||
119394279 | LastEagle | C | June 13, 2021, 6:25 p.m. | OK | GNU C++14 | TESTS | 27 | 202 | 6451200 | ||
119414385 | Manz | C | June 14, 2021, 3:41 a.m. | OK | GNU C++14 | TESTS | 27 | 202 | 6963200 | ||
119409386 | MichaelHyh | C | June 14, 2021, 1:33 a.m. | OK | GNU C++14 | TESTS | 27 | 217 | 7987200 | ||
119415006 | fullcomding | C | June 14, 2021, 3:53 a.m. | OK | GNU C++14 | TESTS | 27 | 218 | 5222400 | ||
119406866 | Dynamic_Squid | C | June 13, 2021, 11:14 p.m. | OK | GNU C++14 | TESTS | 27 | 218 | 6451200 | ||
119391111 | exqt | C | June 13, 2021, 6:13 p.m. | OK | GNU C++14 | TESTS | 27 | 218 | 6451200 | ||
119421740 | Volts | C | June 14, 2021, 5:49 a.m. | OK | GNU C++14 | TESTS | 27 | 218 | 9523200 | ||
119410233 | mdsaqib | C | June 14, 2021, 2 a.m. | OK | GNU C++14 | TESTS | 27 | 218 | 9728000 | ||
119418645 | axs7384 | C | June 14, 2021, 5:02 a.m. | OK | GNU C++14 | TESTS | 27 | 218 | 12083200 | ||
119414096 | kamandlabalashekhar | C | June 14, 2021, 3:34 a.m. | OK | GNU C++14 | TESTS | 27 | 218 | 12800000 | ||
119409728 | OrlKorrekt | C | June 14, 2021, 1:45 a.m. | OK | GNU C++17 | TESTS | 27 | 93 | 104755200 | ||
119415439 | grininja | C | June 14, 2021, 4:02 a.m. | OK | GNU C++17 | TESTS | 27 | 187 | 3584000 | ||
119420624 | 1127193030 | C | June 14, 2021, 5:34 a.m. | OK | GNU C++17 | TESTS | 27 | 202 | 4812800 | ||
119419287 | pversusnp | C | June 14, 2021, 5:13 a.m. | OK | GNU C++17 | TESTS | 27 | 202 | 4812800 | ||
119411613 | pradumn | C | June 14, 2021, 2:41 a.m. | OK | GNU C++17 | TESTS | 27 | 202 | 4812800 | ||
119409369 | EmmaWatson | C | June 14, 2021, 1:33 a.m. | OK | GNU C++17 | TESTS | 27 | 202 | 4812800 | ||
119393673 | ramanujan_19 | C | June 13, 2021, 6:23 p.m. | OK | GNU C++17 | TESTS | 27 | 202 | 4915200 | ||
119406077 | fxhd | C | June 13, 2021, 10:28 p.m. | OK | GNU C++17 | TESTS | 27 | 202 | 4915200 | ||
119399600 | Shubh4nk | C | June 13, 2021, 7:50 p.m. | OK | GNU C++17 | TESTS | 27 | 202 | 5222400 | ||
119421587 | Pedestrian1 | C | June 14, 2021, 5:47 a.m. | OK | GNU C++17 | TESTS | 27 | 202 | 6041600 | ||
119405215 | thhsu | C | June 13, 2021, 9:51 p.m. | OK | GNU C++17 (64) | TESTS | 27 | 124 | 4915200 | ||
119410985 | iShibly | C | June 14, 2021, 2:23 a.m. | OK | GNU C++17 (64) | TESTS | 27 | 124 | 8089600 | ||
119407258 | clam | C | June 13, 2021, 11:42 p.m. | OK | GNU C++17 (64) | TESTS | 27 | 124 | 9728000 | ||
119411089 | iShibly | C | June 14, 2021, 2:26 a.m. | OK | GNU C++17 (64) | TESTS | 27 | 139 | 4915200 | ||
119401166 | vok8 | C | June 13, 2021, 8:05 p.m. | OK | GNU C++17 (64) | TESTS | 27 | 139 | 4915200 | ||
119400072 | Cuellius | C | June 13, 2021, 7:53 p.m. | OK | GNU C++17 (64) | TESTS | 27 | 139 | 6451200 | ||
119413887 | chctxdy68 | C | June 14, 2021, 3:30 a.m. | OK | GNU C++17 (64) | TESTS | 27 | 139 | 10035200 | ||
119399767 | taruntk | C | June 13, 2021, 7:51 p.m. | OK | GNU C++17 (64) | TESTS | 27 | 139 | 16179200 | ||
119413858 | ginwAa | C | June 14, 2021, 3:30 a.m. | OK | GNU C++17 (64) | TESTS | 27 | 140 | 4812800 | ||
119389794 | empathy117 | C | June 13, 2021, 6:08 p.m. | OK | GNU C++17 (64) | TESTS | 27 | 140 | 5222400 | ||
119400220 | cribabby | C | June 13, 2021, 7:55 p.m. | OK | Java 11 | TESTS | 27 | 264 | 18022400 | ||
119414557 | SrapZark | C | June 14, 2021, 3:45 a.m. | OK | Java 11 | TESTS | 27 | 311 | 12288000 | ||
119390566 | GhoulvsTitan | C | June 13, 2021, 6:11 p.m. | OK | Java 11 | TESTS | 27 | 343 | 10956800 | ||
119415293 | PetrNguyen | C | June 14, 2021, 3:59 a.m. | OK | Java 11 | TESTS | 27 | 358 | 10444800 | ||
119403559 | lucasr | C | June 13, 2021, 8:58 p.m. | OK | Java 11 | TESTS | 27 | 373 | 11776000 | ||
119386983 | akshatj07 | C | June 13, 2021, 5:55 p.m. | OK | Java 11 | TESTS | 27 | 389 | 16384000 | ||
119407989 | adarsh_goku | C | June 14, 2021, 12:26 a.m. | OK | Java 11 | TESTS | 27 | 389 | 25395200 | ||
119416847 | Sachin_2961 | C | June 14, 2021, 4:29 a.m. | OK | Java 11 | TESTS | 27 | 576 | 11468800 | ||
119422322 | mrlucent | C | June 14, 2021, 5:57 a.m. | OK | Java 11 | TESTS | 27 | 576 | 55193600 | ||
119390914 | Charigardash | C | June 13, 2021, 6:12 p.m. | OK | Java 11 | TESTS | 27 | 685 | 66969600 | ||
119403206 | qlf9 | C | June 13, 2021, 8:49 p.m. | OK | Java 8 | TESTS | 27 | 249 | 17920000 | ||
119401310 | onlytrall | C | June 13, 2021, 8:07 p.m. | OK | Java 8 | TESTS | 27 | 249 | 22118400 | ||
119389985 | Embrion_top | C | June 13, 2021, 6:09 p.m. | OK | Java 8 | TESTS | 27 | 265 | 25190400 | ||
119418427 | tarun_sm | C | June 14, 2021, 4:58 a.m. | OK | Java 8 | TESTS | 27 | 280 | 1536000 | ||
119412491 | alibaba | C | June 14, 2021, 3:01 a.m. | OK | Java 8 | TESTS | 27 | 296 | 22118400 | ||
119401214 | onlytrall | C | June 13, 2021, 8:06 p.m. | OK | Java 8 | TESTS | 27 | 311 | 22118400 | ||
119393171 | pribic | C | June 13, 2021, 6:21 p.m. | OK | Java 8 | TESTS | 27 | 311 | 30822400 | ||
119403470 | love1024 | C | June 13, 2021, 8:56 p.m. | OK | Java 8 | TESTS | 27 | 311 | 31744000 | ||
119391204 | casonova | C | June 13, 2021, 6:13 p.m. | OK | Java 8 | TESTS | 27 | 342 | 38707200 | ||
119421588 | trappy00_28 | C | June 14, 2021, 5:47 a.m. | OK | Java 8 | TESTS | 27 | 358 | 22016000 | ||
119407127 | Spheniscine | C | June 13, 2021, 11:32 p.m. | OK | Kotlin | TESTS | 27 | 218 | 0 | ||
119389437 | Bloodwyn | C | June 13, 2021, 6:06 p.m. | OK | Kotlin | TESTS | 27 | 904 | 48128000 | ||
119408478 | VAAB_V23 | C | June 14, 2021, 12:53 a.m. | OK | MS C++ 2017 | TESTS | 27 | 810 | 4812800 | ||
119388027 | Blejac | C | June 13, 2021, 6 p.m. | OK | MS C++ 2017 | TESTS | 27 | 842 | 18739200 | ||
119394519 | thetansquared | C | June 13, 2021, 6:26 p.m. | OK | .NET Core C# | TESTS | 27 | 343 | 67072000 | ||
119404469 | henrychenOutlook | C | June 13, 2021, 9:24 p.m. | OK | Node.js | TESTS | 27 | 311 | 43212800 | ||
119403654 | henrychenOutlook | C | June 13, 2021, 9:01 p.m. | OK | Node.js | TESTS | 27 | 483 | 43110400 | ||
119387694 | PAG | C | June 13, 2021, 5:59 p.m. | OK | PascalABC.NET | TESTS | 27 | 873 | 4915200 | ||
119407139 | lebron87 | C | June 13, 2021, 11:33 p.m. | OK | PyPy 2 | TESTS | 27 | 343 | 36761600 | ||
119407110 | lebron87 | C | June 13, 2021, 11:31 p.m. | OK | PyPy 2 | TESTS | 27 | 390 | 52428800 | ||
119407101 | lebron87 | C | June 13, 2021, 11:30 p.m. | OK | PyPy 2 | TESTS | 27 | 436 | 43315200 | ||
119407086 | lebron87 | C | June 13, 2021, 11:29 p.m. | OK | PyPy 2 | TESTS | 27 | 451 | 41062400 | ||
119406701 | lebron87 | C | June 13, 2021, 11:04 p.m. | OK | PyPy 2 | TESTS | 27 | 592 | 49049600 | ||
119415204 | aniket11 | C | June 14, 2021, 3:58 a.m. | OK | PyPy 2 | TESTS | 27 | 1122 | 41164800 | ||
119401391 | gourav2001k | C | June 13, 2021, 8:09 p.m. | OK | PyPy 3 | TESTS | 27 | 436 | 52940800 | ||
119387686 | half_dead | C | June 13, 2021, 5:59 p.m. | OK | PyPy 3 | TESTS | 27 | 452 | 53145600 | ||
119412808 | shiviDON | C | June 14, 2021, 3:08 a.m. | OK | PyPy 3 | TESTS | 27 | 639 | 33894400 | ||
119409784 | ankan2526 | C | June 14, 2021, 1:47 a.m. | OK | PyPy 3 | TESTS | 27 | 733 | 39833600 | ||
119402125 | TheMisfits | C | June 13, 2021, 8:20 p.m. | OK | PyPy 3 | TESTS | 27 | 748 | 37376000 | ||
119412434 | shiviDON | C | June 14, 2021, 2:59 a.m. | OK | PyPy 3 | TESTS | 27 | 748 | 37683200 | ||
119387689 | shantpat | C | June 13, 2021, 5:59 p.m. | OK | PyPy 3 | TESTS | 27 | 748 | 39014400 | ||
119414591 | harshit0109 | C | June 14, 2021, 3:46 a.m. | OK | PyPy 3 | TESTS | 27 | 748 | 41472000 | ||
119414525 | prackode | C | June 14, 2021, 3:44 a.m. | OK | PyPy 3 | TESTS | 27 | 764 | 38604800 | ||
119408367 | nabovtl | C | June 14, 2021, 12:47 a.m. | OK | PyPy 3 | TESTS | 27 | 779 | 43724800 | ||
119405017 | VioletVal | C | June 13, 2021, 9:44 p.m. | OK | Python 3 | TESTS | 27 | 420 | 49561600 | ||
119404870 | VioletVal | C | June 13, 2021, 9:38 p.m. | OK | Python 3 | TESTS | 27 | 530 | 37888000 | ||
119397403 | iit_yt_28 | C | June 13, 2021, 6:34 p.m. | OK | Python 3 | TESTS | 27 | 655 | 37888000 | ||
119397335 | simran.singh2198 | C | June 13, 2021, 6:34 p.m. | OK | Python 3 | TESTS | 27 | 702 | 49049600 | ||
119404748 | aishu007 | C | June 13, 2021, 9:33 p.m. | OK | Python 3 | TESTS | 27 | 748 | 50278400 | ||
119391815 | Sevastian | C | June 13, 2021, 6:16 p.m. | OK | Python 3 | TESTS | 27 | 779 | 33894400 | ||
119414252 | andr14142 | C | June 14, 2021, 3:38 a.m. | OK | Python 3 | TESTS | 27 | 826 | 34099200 | ||
119412982 | scuby30 | C | June 14, 2021, 3:11 a.m. | OK | Python 3 | TESTS | 27 | 857 | 50483200 | ||
119410728 | aman2000jaiswal14 | C | June 14, 2021, 2:15 a.m. | OK | Python 3 | TESTS | 27 | 904 | 36659200 | ||
119402076 | peakypo | C | June 13, 2021, 8:20 p.m. | OK | Python 3 | TESTS | 27 | 920 | 33280000 | ||
119414394 | ssvb | C | June 14, 2021, 3:41 a.m. | OK | Ruby 3 | TESTS | 27 | 1700 | 69836800 | ||
119413067 | ssvb | C | June 14, 2021, 3:13 a.m. | OK | Ruby 3 | TESTS | 27 | 1793 | 70041600 | ||
119412958 | ssvb | C | June 14, 2021, 3:11 a.m. | OK | Ruby 3 | TESTS | 27 | 1825 | 61440000 | ||
119415492 | cottoncotton | C | June 14, 2021, 4:03 a.m. | OK | Rust | TESTS | 27 | 78 | 7065600 | ||
119403565 | IvanDyachenko | C | June 13, 2021, 8:58 p.m. | OK | Scala | TESTS | 27 | 1045 | 42291200 |
Back to search problems