Codeforces Round 707 (Div. 1, based on Moscow Open Olympiad in Informatics)

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
1500 Codeforces Round 707 (Div. 1, based on Moscow Open Olympiad in Informatics) FINISHED False 9000 121726511 March 13, 2021, 9:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 826 ) C Matrix Sorting PROGRAMMING bitmasks constructive algorithms dfs and similar greedy hashing string suffix structures two pointers 2600

B'You are given two tables A and B of size n x m . We define a sorting by column as the following: we choose a column and reorder the rows of the table by the value in this column, from the rows with the smallest value to the rows with the largest. In case there are two or more rows with equal value in this column, their relative order does not change (such sorting algorithms are called stable). You can find this behavior of sorting by column in many office software for managing spreadsheets. Petya works in one, and he has a table A opened right now. He wants to perform zero of more sortings by column to transform this table to table B . Determine if it is possible to do so, and if yes, find a sequence of columns to sort by. Note that you do not need to minimize the number of sortings. The first line contains two integers n and m ( 1 <= n, m <= 1500 ) -- the sizes of the tables. Each of the next n lines contains m integers a_{i,j} ( 1 <= a_{i, j} <= n ), denoting the elements of the table A . Each of the next n lines contains m integers b_{i, j} ( 1 <= b_{i, j} <= n ), denoting the elements of the table B . If it is not possible to transform A into B , print -1 . Otherwise, first print an integer k ( 0 <= k <= 5000 ) -- the number of sortings in your solution. Then print k integers c_1, ldots, c_k ( 1 <= c_i <= m ) -- the columns, by which Petya needs to perform a sorting. We can show that if a solution exists, there is one in no more than 5000 sortings. Consider the second example. After the sorting by the first column the table becomes begin{matrix} 1&3&3 1&1&2 2&3&2. end{matrix} After the sorting by the second column the table becomes begin{matrix} 1&1&2 1&3&3 2&3&2, end{matrix} and this is what we need. In the third test any sorting does not change anyt'...

Tutorials

Codeforces Round #707 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
109930143 dengyipeng C March 14, 2021, 1:49 a.m. OK GNU C++11 TESTS 129 155 27238400 2600
109881388 mengbierr C March 13, 2021, 11:16 a.m. OK GNU C++11 TESTS 126 171 27340800 2600
109933485 fallleaves01 C March 14, 2021, 3:42 a.m. OK GNU C++11 TESTS 132 171 36659200 2600
109876492 ezoilearner C March 13, 2021, 10:55 a.m. OK GNU C++11 TESTS 126 171 37683200 2600
109875643 ItstInternationalTourist C March 13, 2021, 10:52 a.m. OK GNU C++11 TESTS 126 187 18534400 2600
109883636 FluffyT C March 13, 2021, 11:25 a.m. OK GNU C++11 TESTS 126 187 38297600 2600
109877532 Yukikaze_ C March 13, 2021, 11 a.m. OK GNU C++11 TESTS 126 234 54579200 2600
109935534 Lucky_Glass C March 14, 2021, 4:34 a.m. OK GNU C++11 TESTS 132 342 18227200 2600
109857364 LJC00118 C March 13, 2021, 9:46 a.m. OK GNU C++11 TESTS 126 342 18534400 2600
109932577 Shedneryan C March 14, 2021, 3:15 a.m. OK GNU C++11 TESTS 130 358 27443200 2600
109926042 AgReB C March 13, 2021, 9:54 p.m. OK GNU C++14 TESTS 128 623 18841600 2600
109903708 antguz C March 13, 2021, 2:57 p.m. OK GNU C++14 TESTS 127 670 28057600 2600
109868826 Farhod_Farmon C March 13, 2021, 10:25 a.m. OK GNU C++14 TESTS 126 732 28467200 2600
109920563 WiwiHo C March 13, 2021, 7:15 p.m. OK GNU C++14 TESTS 128 811 53657600 2600
109876332 atomicenergy C March 13, 2021, 10:55 a.m. OK GNU C++14 TESTS 126 904 18227200 2600
109896575 nhho C March 13, 2021, 1:44 p.m. OK GNU C++14 TESTS 126 904 28774400 2600
109872225 y1s1 C March 13, 2021, 10:38 a.m. OK GNU C++14 TESTS 126 919 19763200 2600
109879529 Eden_CY C March 13, 2021, 11:08 a.m. OK GNU C++14 TESTS 126 919 32563200 2600
109900279 aid C March 13, 2021, 2:19 p.m. OK GNU C++14 TESTS 127 936 18432000 2600
109885394 Moririn2528 C March 13, 2021, 11:31 a.m. OK GNU C++14 TESTS 126 951 54476800 2600
109874216 MrDindows C March 13, 2021, 10:46 a.m. OK GNU C++17 TESTS 126 358 27648000 2600
109885644 mbalsells C March 13, 2021, 11:32 a.m. OK GNU C++17 TESTS 126 623 29696000 2600
109876971 yuto1115 C March 13, 2021, 10:58 a.m. OK GNU C++17 TESTS 126 654 19660800 2600
109899297 Nakagawa.Kanon C March 13, 2021, 2:10 p.m. OK GNU C++17 TESTS 127 654 28979200 2600
109899151 Nishihara C March 13, 2021, 2:08 p.m. OK GNU C++17 TESTS 127 654 28979200 2600
109876483 Anachor C March 13, 2021, 10:55 a.m. OK GNU C++17 TESTS 126 655 19865600 2600
109869641 tute7627 C March 13, 2021, 10:28 a.m. OK GNU C++17 TESTS 126 655 39014400 2600
109937269 valerikk C March 14, 2021, 5:13 a.m. OK GNU C++17 TESTS 132 670 28467200 2600
109931079 Normie28 C March 14, 2021, 2:23 a.m. OK GNU C++17 TESTS 129 686 26009600 2600
109869162 4eT_llpuyHblJl C March 13, 2021, 10:27 a.m. OK GNU C++17 TESTS 126 686 28672000 2600
109858583 Miracle03 C March 13, 2021, 9:50 a.m. OK GNU C++17 (64) TESTS 126 124 20787200 2600
109893810 namespace_std C March 13, 2021, 1:15 p.m. OK GNU C++17 (64) TESTS 126 124 96460800 2600
109871380 Akemi-Homura- C March 13, 2021, 10:35 a.m. OK GNU C++17 (64) TESTS 126 155 39731200 2600
109928490 wty2016 C March 14, 2021, 12:22 a.m. OK GNU C++17 (64) TESTS 128 234 10444800 2600
109895868 namespace_std C March 13, 2021, 1:37 p.m. OK GNU C++17 (64) TESTS 126 280 173056000 2600
109900363 aid C March 13, 2021, 2:20 p.m. OK GNU C++17 (64) TESTS 127 545 18227200 2600
109882328 thenymphsofdelphi C March 13, 2021, 11:19 a.m. OK GNU C++17 (64) TESTS 126 560 27443200 2600
109866235 Sana C March 13, 2021, 10:16 a.m. OK GNU C++17 (64) TESTS 126 560 28467200 2600
109858563 jiangly C March 13, 2021, 9:50 a.m. OK GNU C++17 (64) TESTS 126 561 29491200 2600
109873910 rniya C March 13, 2021, 10:45 a.m. OK GNU C++17 (64) TESTS 126 561 38195200 2600
109869034 uwi C March 13, 2021, 10:26 a.m. OK Java 11 TESTS 126 436 18534400 2600
109882738 Justyo C March 13, 2021, 11:21 a.m. OK Java 11 TESTS 126 857 18841600 2600
109874363 iakovlev.zakhar C March 13, 2021, 10:47 a.m. OK Java 8 TESTS 126 592 17408000 2600
109911993 hu_tao C March 13, 2021, 4:48 p.m. OK Java 8 TESTS 128 826 26624000 2600
109911740 hu_tao C March 13, 2021, 4:45 p.m. OK Java 8 TESTS 128 1044 26624000 2600
109912849 Tlatoani C March 13, 2021, 5:02 p.m. OK Kotlin TESTS 128 1560 127692800 2600
109868378 elizarov C March 13, 2021, 10:24 a.m. OK Kotlin TESTS 126 1856 113356800 2600
109927182 amethyst0 C March 13, 2021, 10:54 p.m. OK MS C++ 2017 TESTS 128 1294 28160000 2600
109906069 sansen C March 13, 2021, 3:27 p.m. OK Rust TESTS 127 249 55603200 2600
109904167 sansen C March 13, 2021, 3:03 p.m. OK Rust TESTS 127 404 55091200 2600
109860495 ocamler C March 13, 2021, 9:56 a.m. OK Rust TESTS 126 530 20992000 2600
109869261 dp0 C March 13, 2021, 10:27 a.m. OK Rust TESTS 126 810 64512000 2600
109878411 sansen C March 13, 2021, 11:04 a.m. OK Rust TESTS 126 982 73216000 2600

remove filters

Back to search problems