Codeforces Round 812 (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
1713 Codeforces Round 812 (Div. 2) FINISHED False 7200 77469863 Aug. 6, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1754 ) E Cross Swapping PROGRAMMING ds greedy matrices 2400

B'You are given a square matrix A of size n x n whose elements are integers. We will denote the element on the intersection of the i -th row and the j -th column as A_{i,j} . You can perform operations on the matrix. In each operation, you can choose an integer k , then for each index i ( 1 <= q i <= q n ), swap A_{i, k} with A_{k, i} . Note that cell A_{k, k} remains unchanged. For example, for n = 4 and k = 3 , this matrix will be transformed like this: You can perform this operation any number of times. Find the lexicographically smallest matrix ^ dagger you can obtain after performing arbitrary number of operations. {}^ dagger For two matrices A and B of size n x n , let a_{(i-1) cdot n + j} = A_{i,j} and b_{(i-1) cdot n + j} = B_{i,j} . Then, the matrix A is lexicographically smaller than the matrix B when there exists an index i ( 1 <= q i <= q n^2 ) such that a_i < b_i and for all indices j such that 1 <= q j < i , a_j = b_j . The first line contains a single integer t ( 1 <= q t <= q 10^5 ) -- the number of test cases. The first line of each test case contains a single integer n ( 1 <= q n <= q 1000 ) -- the size of the matrix. The i -th line of the next n lines contains n integers A_{i, 1}, A_{i, 2}, ... , A_{i, n} ( 1 <= A_{i, j} <= 10^9 ) -- description of the matrix A . It is guaranteed that the sum of n^2 over all test cases does not exceed 10^6 . For each test case, print n lines with n integers each -- the lexicographically smallest matrix. Note that in every picture below the matrix is transformed in such a way that the blue rows are swapped with the green columns. In the first test case, we can perform 1 operation for k = 3 . The matrix will be transformed as below: '...

Tutorials

Codeforces Round #812 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
167348390 Tdyx E Aug. 7, 2022, 4:35 a.m. OK C# 8 TESTS 48 561 78540800 2400
167342688 Hydrogen_zyx E Aug. 7, 2022, 2:58 a.m. OK Clang++17 Diagnostics TESTS 48 935 15462400 2400
167339519 glq_C E Aug. 7, 2022, 1:59 a.m. OK GNU C++14 TESTS 48 140 6144000 2400
167336545 lixp E Aug. 7, 2022, 12:49 a.m. OK GNU C++14 TESTS 48 140 6144000 2400
167302944 FasterThanLight E Aug. 6, 2022, 4:32 p.m. OK GNU C++14 TESTS 48 405 11673600 2400
167336932 glq_C E Aug. 7, 2022, 12:59 a.m. OK GNU C++14 TESTS 48 467 4096000 2400
167336876 glq_C E Aug. 7, 2022, 12:58 a.m. OK GNU C++14 TESTS 48 467 4096000 2400
167344103 METHOD_METAFALICA E Aug. 7, 2022, 3:20 a.m. OK GNU C++14 TESTS 48 467 6144000 2400
167334795 Mryange E Aug. 7, 2022, 12:01 a.m. OK GNU C++14 TESTS 48 468 11571200 2400
167336245 lixp E Aug. 7, 2022, 12:41 a.m. OK GNU C++14 TESTS 48 483 4096000 2400
167315228 Wangxueyi E Aug. 6, 2022, 6:38 p.m. OK GNU C++14 TESTS 48 483 4096000 2400
167337720 Mryange E Aug. 7, 2022, 1:19 a.m. OK GNU C++14 TESTS 48 483 11571200 2400
167324084 ikaurov E Aug. 6, 2022, 8:13 p.m. OK GNU C++17 TESTS 48 452 4300800 2400
167351122 Tioz0 E Aug. 7, 2022, 5:14 a.m. OK GNU C++17 TESTS 48 482 12800000 2400
167342933 knoj014 E Aug. 7, 2022, 3:01 a.m. OK GNU C++17 TESTS 48 483 4198400 2400
167323272 vanvector E Aug. 6, 2022, 8:03 p.m. OK GNU C++17 TESTS 48 498 4300800 2400
167344465 kano_ln E Aug. 7, 2022, 3:26 a.m. OK GNU C++17 TESTS 48 498 12185600 2400
167334723 20Ti_ntson E Aug. 6, 2022, 11:59 p.m. OK GNU C++17 TESTS 48 498 16179200 2400
167323040 limbo16 E Aug. 6, 2022, 8 p.m. OK GNU C++17 TESTS 48 499 3993600 2400
167346364 abc864197532 E Aug. 7, 2022, 3:58 a.m. OK GNU C++17 TESTS 48 499 4300800 2400
167339802 cjycleaner E Aug. 7, 2022, 2:05 a.m. OK GNU C++17 TESTS 48 499 4300800 2400
167313122 S_ky E Aug. 6, 2022, 6:24 p.m. OK GNU C++17 TESTS 48 499 5120000 2400
167337834 yyandy E Aug. 7, 2022, 1:22 a.m. OK GNU C++17 (64) TESTS 48 202 4505600 2400
167345449 wuhypzz E Aug. 7, 2022, 3:42 a.m. OK GNU C++17 (64) TESTS 48 389 4096000 2400
167347179 gqf123 E Aug. 7, 2022, 4:13 a.m. OK GNU C++17 (64) TESTS 48 389 4505600 2400
167320492 MateoCV E Aug. 6, 2022, 7:30 p.m. OK GNU C++17 (64) TESTS 48 389 13414400 2400
167342320 Freedom__King E Aug. 7, 2022, 2:52 a.m. OK GNU C++17 (64) TESTS 48 389 29798400 2400
167338599 Cherumi E Aug. 7, 2022, 1:39 a.m. OK GNU C++17 (64) TESTS 48 404 4608000 2400
167348916 gqf123 E Aug. 7, 2022, 4:43 a.m. OK GNU C++17 (64) TESTS 48 405 4505600 2400
167339179 Cherumi E Aug. 7, 2022, 1:52 a.m. OK GNU C++17 (64) TESTS 48 405 4505600 2400
167345477 machine_solution E Aug. 7, 2022, 3:42 a.m. OK GNU C++17 (64) TESTS 48 405 16179200 2400
167316962 maxwellzen E Aug. 6, 2022, 6:54 p.m. OK GNU C++17 (64) TESTS 48 420 4505600 2400
167342577 juraws E Aug. 7, 2022, 2:56 a.m. OK GNU C++20 (64) TESTS 48 155 4300800 2400
167331836 mhq E Aug. 6, 2022, 10:36 p.m. OK GNU C++20 (64) TESTS 48 249 4096000 2400
167349931 Ivan_len E Aug. 7, 2022, 4:58 a.m. OK GNU C++20 (64) TESTS 48 264 4096000 2400
167333968 Adam_GS E Aug. 6, 2022, 11:36 p.m. OK GNU C++20 (64) TESTS 48 264 4608000 2400
167341773 tarjen E Aug. 7, 2022, 2:41 a.m. OK GNU C++20 (64) TESTS 48 264 16281600 2400
167348082 dalek114514 E Aug. 7, 2022, 4:29 a.m. OK GNU C++20 (64) TESTS 48 265 4096000 2400
167343272 Fox-516 E Aug. 7, 2022, 3:07 a.m. OK GNU C++20 (64) TESTS 48 265 4096000 2400
167348909 lplalbert111 E Aug. 7, 2022, 4:43 a.m. OK GNU C++20 (64) TESTS 48 265 4403200 2400
167348757 Alice114514 E Aug. 7, 2022, 4:40 a.m. OK GNU C++20 (64) TESTS 48 265 4505600 2400
167334124 Dou-Happy E Aug. 6, 2022, 11:41 p.m. OK GNU C++20 (64) TESTS 48 265 8192000 2400
167330209 dzhi E Aug. 6, 2022, 9:56 p.m. OK Java 11 TESTS 48 873 6860800 2400
167316881 Dukkha E Aug. 6, 2022, 6:53 p.m. OK Java 17 TESTS 48 499 819200 2400
167327802 leonlian E Aug. 6, 2022, 9:09 p.m. OK Java 8 TESTS 48 405 4812800 2400
167299944 SecondThread E Aug. 6, 2022, 4:26 p.m. OK Java 8 TESTS 48 779 41779200 2400
167339698 KroosTheKeenGlint E Aug. 7, 2022, 2:03 a.m. OK MS C++ 2017 TESTS 48 623 4096000 2400
167352392 misorin E Aug. 7, 2022, 5:31 a.m. OK PyPy 3-64 TESTS 48 779 72192000 2400
167329775 LittleFall E Aug. 6, 2022, 9:46 p.m. OK Rust 2021 TESTS 48 155 26316800 2400
167328570 LittleFall E Aug. 6, 2022, 9:23 p.m. OK Rust 2021 TESTS 48 155 26316800 2400
167304239 LittleFall E Aug. 6, 2022, 4:34 p.m. OK Rust 2021 TESTS 48 171 26316800 2400
167334230 LittleFall E Aug. 6, 2022, 11:44 p.m. OK Rust 2021 TESTS 48 187 26316800 2400
167320822 Niklassanden E Aug. 6, 2022, 7:33 p.m. OK Rust 2021 TESTS 48 779 87142400 2400

remove filters

Back to search problems