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 |
---|---|---|---|---|---|---|
1864 | Harbour.Space Scholarship Contest 2023-2024 (Div. 1 + Div. 2) | FINISHED | False | 10800 | 44119463 | Aug. 26, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 283 ) | G | Magic Square | PROGRAMMING | combinatorics constructive algorithms |
B"Aquamoon has a Rubik's Square which can be seen as an n x n matrix, the elements of the matrix constitute a permutation of numbers 1, ldots, n^2 . Aquamoon can perform two operations on the matrix: The rows are numbered from 1 to n from top to bottom, the columns are numbered from 1 to n from left to right. The cell at the intersection of the x -th row and the y -th column is denoted as (x, y) . Aquamoon can perform several (possibly, zero) operations, but she has to obey the following restrictions: Aquamoon wonders in how many ways she can transform the Rubik's Square from the given initial state to a given target state. Two ways are considered different if the sequences of applied operations are different. Since the answer can be very large, print the result modulo 998 ,244 ,353 . Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 2 cdot 10^4 ). The description of the test cases follows. The first line of each test case contains an integer n ( 3 <= n <= 500 ). The i -th of the following n lines contains n integers a_{i1}, ldots, a_{in} , representing the i -th row of the initial matrix ( 1 <= a_{ij} <= n^2 ). The i -th of the following n lines contains n integers b_{i1}, ldots, b_{in} , representing the i -th row of the target matrix ( 1 <= b_{ij} <= n^2 ). It is guaranteed that both the elements of the initial matrix and the elements of the target matrix constitute a permutation of numbers 1, ldots, n^2 . It is guaranteed that the sum of n^2 over all test cases does not exceed 250 ,000 . For each test case, if it is possible to convert the initial state to the target state respecting all the restrictions, output one integer -- the number of ways to do so, modulo 998 ,244 ,353 . If there is no solution, print a single integer 0"... |
Harbour.Space Scholarship Contest 2023-2024 (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 |
---|---|---|---|---|---|---|---|---|---|---|---|
220590355 | HailHomura | G | Aug. 26, 2023, 5:07 p.m. | OK | GNU C++14 | TESTS | 101 | 155 | 9625600 | ||
220631091 | jzp | G | Aug. 27, 2023, 3:30 a.m. | OK | GNU C++14 | TESTS | 101 | 296 | 7372800 | ||
220597575 | 275307894a | G | Aug. 26, 2023, 5:34 p.m. | OK | GNU C++14 | TESTS | 101 | 1778 | 16281600 | ||
220627747 | thecold | G | Aug. 27, 2023, 2:22 a.m. | OK | GNU C++17 | TESTS | 101 | 140 | 6144000 | ||
220593519 | Nachia | G | Aug. 26, 2023, 5:20 p.m. | OK | GNU C++17 | TESTS | 101 | 155 | 10137600 | ||
220612216 | Hack.404 | G | Aug. 26, 2023, 8:42 p.m. | OK | GNU C++17 | TESTS | 101 | 171 | 16486400 | ||
220609749 | pooty | G | Aug. 26, 2023, 8:14 p.m. | OK | GNU C++17 | TESTS | 101 | 467 | 45363200 | ||
220628910 | old_wrp | G | Aug. 27, 2023, 2:48 a.m. | OK | GNU C++17 | TESTS | 101 | 623 | 31744000 | ||
220590354 | kotatsugame | G | Aug. 26, 2023, 5:07 p.m. | OK | GNU C++17 (64) | TESTS | 101 | 109 | 6246400 | ||
220628534 | orzdevinwang | G | Aug. 27, 2023, 2:40 a.m. | OK | GNU C++17 (64) | TESTS | 101 | 109 | 10342400 | ||
220596174 | tute7627 | G | Aug. 26, 2023, 5:30 p.m. | OK | GNU C++17 (64) | TESTS | 101 | 140 | 14336000 | ||
220591092 | Xellos | G | Aug. 26, 2023, 5:10 p.m. | OK | GNU C++17 (64) | TESTS | 101 | 155 | 10342400 | ||
220607623 | Geothermal | G | Aug. 26, 2023, 7:53 p.m. | OK | GNU C++17 (64) | TESTS | 101 | 218 | 21299200 | ||
220589078 | K-H | G | Aug. 26, 2023, 5:02 p.m. | OK | GNU C++17 (64) | TESTS | 101 | 265 | 7168000 | ||
220592653 | Rubikun | G | Aug. 26, 2023, 5:16 p.m. | OK | GNU C++17 (64) | TESTS | 101 | 295 | 23654400 | ||
220585515 | ainta | G | Aug. 26, 2023, 4:49 p.m. | OK | GNU C++17 (64) | TESTS | 101 | 358 | 9523200 | ||
220591769 | dlalswp25 | G | Aug. 26, 2023, 5:13 p.m. | OK | GNU C++17 (64) | TESTS | 101 | 452 | 21196800 | ||
220620388 | akdfjhafjlk | G | Aug. 26, 2023, 11:08 p.m. | OK | GNU C++17 (64) | TESTS | 101 | 546 | 24678400 | ||
220627663 | yaoxi | G | Aug. 27, 2023, 2:21 a.m. | OK | GNU C++20 (64) | TESTS | 101 | 78 | 14848000 | ||
220590419 | gamegame | G | Aug. 26, 2023, 5:07 p.m. | OK | GNU C++20 (64) | TESTS | 101 | 93 | 5120000 | ||
220608825 | PinkieRabbit | G | Aug. 26, 2023, 8:05 p.m. | OK | GNU C++20 (64) | TESTS | 101 | 93 | 9216000 | ||
220626687 | feeder1 | G | Aug. 27, 2023, 1:58 a.m. | OK | GNU C++20 (64) | TESTS | 101 | 93 | 28569600 | ||
220596067 | Kuroni | G | Aug. 26, 2023, 5:29 p.m. | OK | GNU C++20 (64) | TESTS | 101 | 109 | 10342400 | ||
220590686 | allitnicS | G | Aug. 26, 2023, 5:08 p.m. | OK | GNU C++20 (64) | TESTS | 101 | 124 | 5427200 | ||
220637017 | RDDCCD | G | Aug. 27, 2023, 5:11 a.m. | OK | GNU C++20 (64) | TESTS | 101 | 140 | 4096000 | ||
220633783 | kimoyami | G | Aug. 27, 2023, 4:23 a.m. | OK | GNU C++20 (64) | TESTS | 101 | 218 | 16281600 | ||
220595469 | -14 | G | Aug. 26, 2023, 5:27 p.m. | OK | GNU C++20 (64) | TESTS | 101 | 249 | 22425600 | ||
220607004 | dl720125 | G | Aug. 26, 2023, 7:49 p.m. | OK | GNU C++20 (64) | TESTS | 101 | 249 | 25292800 | ||
220595409 | topon9ly | G | Aug. 26, 2023, 5:27 p.m. | OK | Kotlin 1.6 | TESTS | 101 | 1029 | 61542400 | ||
220597667 | Tlatoani | G | Aug. 26, 2023, 5:34 p.m. | OK | Kotlin 1.6 | TESTS | 101 | 1263 | 91443200 |
Back to search problems