Codeforces Round 792 (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
1684 Codeforces Round 792 (Div. 1 + Div. 2) FINISHED False 7200 78852299 May 19, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 12407 ) C Column Swapping PROGRAMMING constructive algorithms implementation sortings 1400

B"You are given a grid with n rows and m columns, where each cell has a positive integer written on it. Let's call a grid good, if in each row the sequence of numbers is sorted in a non-decreasing order. It means, that for each 1 <= i <= n and 2 <= j <= m the following holds: a_{i,j} ge a_{i, j-1} . You have to to do the following operation exactly once: choose two columns with indexes i and j (not necessarily different), 1 <= i, j <= m , and swap them. You are asked to determine whether it is possible to make the grid good after the swap and, if it is, find the columns that need to be swapped. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 100 ). Description of the test cases follows. The first line of each test case contains two integers n and m ( 1 <= n, m <= 2 cdot 10^5 ) -- the number of rows and columns respectively. Each of the next n rows contains m integers, j -th element of i -th row is a_{i,j} ( 1 <= a_{i,j} <= 10^9 ) -- the number written in the j -th cell of the i -th row. It's guaranteed that the sum of n cdot m over all test cases does not exceed 2 cdot 10^5 . If after the swap it is impossible to get a good grid, output -1 . In the other case output 2 integers -- the indices of the columns that should be swapped to get a good grid. If there are multiple solutions, print any. In the first test case the grid is initially good, so we can, for example, swap the first column with itself. In the second test case it is impossible to make the grid good. In the third test case it is needed to swap the first and the second column, then the grid becomes good. "...

Tutorials

Codeforces Round #792 (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
157739752 extremall C May 19, 2022, 6:34 p.m. OK C# 8 TESTS 22 140 25395200 1400
157735760 Bobocan C May 19, 2022, 5:58 p.m. OK GNU C11 TESTS 22 15 5324800 1400
157767530 keutoi C May 20, 2022, 5:15 a.m. OK GNU C11 TESTS 24 46 1638400 1400
157745052 LiAsa7 C May 19, 2022, 7:49 p.m. OK GNU C11 TESTS 22 46 4505600 1400
157740334 akshat211103 C May 19, 2022, 6:42 p.m. OK GNU C11 TESTS 22 62 4505600 1400
157728165 ja1467 C May 19, 2022, 4:33 p.m. OK GNU C11 TESTS 22 77 8499200 1400
157733920 saritesh C May 19, 2022, 5:48 p.m. OK GNU C++14 TESTS 22 61 3481600 1400
157765762 nerdy_guy07 C May 20, 2022, 4:47 a.m. OK GNU C++14 TESTS 24 61 5836800 1400
157758464 Liang2003 C May 20, 2022, 2:20 a.m. OK GNU C++14 TESTS 23 61 5836800 1400
157753771 lingo2 C May 19, 2022, 11:59 p.m. OK GNU C++14 TESTS 23 61 6553600 1400
157759837 AIM-9M C May 20, 2022, 2:52 a.m. OK GNU C++14 TESTS 23 62 1126400 1400
157759806 AIM-9X C May 20, 2022, 2:51 a.m. OK GNU C++14 TESTS 23 62 1126400 1400
157759872 _whoAreYou C May 20, 2022, 2:52 a.m. OK GNU C++14 TESTS 23 62 2355200 1400
157744262 Concrete_Green C May 19, 2022, 7:36 p.m. OK GNU C++14 TESTS 22 62 2662400 1400
157755810 free_fantasy C May 20, 2022, 1:08 a.m. OK GNU C++14 TESTS 23 62 3174400 1400
157747947 shivansh977 C May 19, 2022, 8:46 p.m. OK GNU C++14 TESTS 22 62 3993600 1400
157758194 jhc_123 C May 20, 2022, 2:14 a.m. OK GNU C++17 TESTS 23 31 22630400 1400
157768284 readyplayer1 C May 20, 2022, 5:27 a.m. OK GNU C++17 TESTS 24 46 5836800 1400
157757692 fallleaves07 C May 20, 2022, 2:02 a.m. OK GNU C++17 TESTS 23 46 5836800 1400
157756410 BaboerBen C May 20, 2022, 1:28 a.m. OK GNU C++17 TESTS 23 61 5836800 1400
157768337 Yash_dn C May 20, 2022, 5:28 a.m. OK GNU C++17 TESTS 24 61 5836800 1400
157736677 Wailydest C May 19, 2022, 6:05 p.m. OK GNU C++17 TESTS 22 61 6041600 1400
157760991 subhash1e C May 20, 2022, 3:15 a.m. OK GNU C++17 TESTS 23 61 6963200 1400
157725432 iprom C May 19, 2022, 4:25 p.m. OK GNU C++17 TESTS 22 61 12492800 1400
157754731 u00bl3t C May 20, 2022, 12:33 a.m. OK GNU C++17 TESTS 23 62 819200 1400
157768747 Eftekhar_Nahim_CoU14 C May 20, 2022, 5:34 a.m. OK GNU C++17 TESTS 24 62 819200 1400
157763768 QAQAutoMaton C May 20, 2022, 4:11 a.m. OK GNU C++17 (64) TESTS 23 31 12288000 1400
157767527 SakiBee C May 20, 2022, 5:15 a.m. OK GNU C++17 (64) TESTS 24 46 1638400 1400
157724049 1-GUN C May 19, 2022, 4:22 p.m. OK GNU C++17 (64) TESTS 22 46 2867200 1400
157756945 kumarnimit0316 C May 20, 2022, 1:43 a.m. OK GNU C++17 (64) TESTS 23 46 3174400 1400
157741922 Sakib62 C May 19, 2022, 7:02 p.m. OK GNU C++17 (64) TESTS 22 46 4198400 1400
157742174 vladislav228 C May 19, 2022, 7:06 p.m. OK GNU C++17 (64) TESTS 22 46 4198400 1400
157745261 RenegadeKamikaze C May 19, 2022, 7:52 p.m. OK GNU C++17 (64) TESTS 22 46 4403200 1400
157737147 itsmihir C May 19, 2022, 6:09 p.m. OK GNU C++17 (64) TESTS 22 46 4403200 1400
157748225 Havoc_01 C May 19, 2022, 8:52 p.m. OK GNU C++17 (64) TESTS 22 46 4812800 1400
157763519 TheHavoc C May 20, 2022, 4:07 a.m. OK GNU C++17 (64) TESTS 23 46 5734400 1400
157749417 marwanmm4626 C May 19, 2022, 9:23 p.m. OK GNU C++20 (64) TESTS 23 31 819200 1400
157749323 Veldora_ C May 19, 2022, 9:21 p.m. OK GNU C++20 (64) TESTS 23 31 819200 1400
157757146 SanguineChameleon C May 20, 2022, 1:49 a.m. OK GNU C++20 (64) TESTS 23 31 1638400 1400
157753689 emailam C May 19, 2022, 11:56 p.m. OK GNU C++20 (64) TESTS 23 31 1638400 1400
157767117 superMAXX C May 20, 2022, 5:09 a.m. OK GNU C++20 (64) TESTS 24 31 1638400 1400
157769598 cutcopypaste C May 20, 2022, 5:47 a.m. OK GNU C++20 (64) TESTS 24 31 2457600 1400
157737329 Mo7amed_Alaa C May 19, 2022, 6:10 p.m. OK GNU C++20 (64) TESTS 22 31 2867200 1400
157745256 EM17 C May 19, 2022, 7:52 p.m. OK GNU C++20 (64) TESTS 22 31 2867200 1400
157746405 Srbmaury C May 19, 2022, 8:13 p.m. OK GNU C++20 (64) TESTS 22 31 2867200 1400
157768193 get_out_of_my_way C May 20, 2022, 5:26 a.m. OK GNU C++20 (64) TESTS 24 31 2969600 1400
157755751 0x3F C May 20, 2022, 1:06 a.m. OK Go TESTS 23 156 8806400 1400
157743753 LXL C May 19, 2022, 7:28 p.m. OK Go TESTS 22 171 14028800 1400
157756075 0x3F C May 20, 2022, 1:18 a.m. OK Go TESTS 23 187 8704000 1400
157737558 koqo C May 19, 2022, 6:12 p.m. OK Go TESTS 22 202 18124800 1400
157758289 satyaa_78 C May 20, 2022, 2:16 a.m. OK Java 11 TESTS 23 187 0 1400
157760725 satyaa_78 C May 20, 2022, 3:09 a.m. OK Java 11 TESTS 23 202 0 1400
157758033 naman5811 C May 20, 2022, 2:11 a.m. OK Java 11 TESTS 23 218 0 1400
157745118 katPrend C May 19, 2022, 7:50 p.m. OK Java 11 TESTS 22 218 25395200 1400
157757003 Hreshi C May 20, 2022, 1:45 a.m. OK Java 11 TESTS 23 233 0 1400
157768101 1364354238zxd C May 20, 2022, 5:24 a.m. OK Java 11 TESTS 24 233 0 1400
157735093 SAMAD_ C May 19, 2022, 5:54 p.m. OK Java 11 TESTS 22 233 25190400 1400
157739264 eeshaan_311 C May 19, 2022, 6:28 p.m. OK Java 11 TESTS 22 233 25497600 1400
157736185 tanish_1131 C May 19, 2022, 6:01 p.m. OK Java 11 TESTS 22 234 25804800 1400
157727070 jdown C May 19, 2022, 4:30 p.m. OK Java 11 TESTS 22 249 25395200 1400
157746215 toufique_husein C May 19, 2022, 8:10 p.m. OK Java 8 TESTS 22 109 19148800 1400
157736609 gagan_6730 C May 19, 2022, 6:05 p.m. OK Java 8 TESTS 22 140 28364800 1400
157757675 white_square C May 20, 2022, 2:02 a.m. OK Java 8 TESTS 23 155 2969600 1400
157756844 white_square C May 20, 2022, 1:40 a.m. OK Java 8 TESTS 23 155 3072000 1400
157741261 Unrated_Pritam C May 19, 2022, 6:53 p.m. OK Java 8 TESTS 22 155 26214400 1400
157769681 SecondThread C May 20, 2022, 5:48 a.m. OK Java 8 TESTS 24 156 66048000 1400
157743717 govindrajput C May 19, 2022, 7:27 p.m. OK Java 8 TESTS 22 171 26112000 1400
157767353 ashish1729 C May 20, 2022, 5:12 a.m. OK Java 8 TESTS 24 186 3072000 1400
157767602 ashish1729 C May 20, 2022, 5:17 a.m. OK Java 8 TESTS 24 187 3072000 1400
157732859 Omar_Mohammad C May 19, 2022, 5:43 p.m. OK Java 8 TESTS 22 187 25907200 1400
157751897 fatant C May 19, 2022, 10:43 p.m. OK MS C++ 2017 TESTS 23 202 5632000 1400
157741717 machine_solution C May 19, 2022, 7 p.m. OK MS C++ 2017 TESTS 22 202 12595200 1400
157748348 BalaluevEgor C May 19, 2022, 8:55 p.m. OK MS C++ 2017 TESTS 22 218 5632000 1400
157733244 Inspired C May 19, 2022, 5:44 p.m. OK Node.js TESTS 22 421 48332800 1400
157760953 XYShaoKang C May 20, 2022, 3:14 a.m. OK Node.js TESTS 23 499 32768000 1400
157727147 XYShaoKang C May 19, 2022, 4:30 p.m. OK Node.js TESTS 22 545 41369600 1400
157734057 1_2_3_4_5_9 C May 19, 2022, 5:48 p.m. OK PyPy 2 TESTS 22 202 42496000 1400
157767129 NecroSean38 C May 20, 2022, 5:09 a.m. OK PyPy 3 TESTS 24 156 19865600 1400
157735893 hxu10 C May 19, 2022, 5:59 p.m. OK PyPy 3 TESTS 22 202 41779200 1400
157766031 FrozenKandy C May 20, 2022, 4:52 a.m. OK PyPy 3 TESTS 24 218 16793600 1400
157752308 hxu10 C May 19, 2022, 10:59 p.m. OK PyPy 3 TESTS 23 233 23961600 1400
157760220 ruimina C May 20, 2022, 2:59 a.m. OK PyPy 3 TESTS 23 234 23347200 1400
157742795 coder_sounak C May 19, 2022, 7:14 p.m. OK PyPy 3 TESTS 22 295 48537600 1400
157739535 Mashin_larner C May 19, 2022, 6:31 p.m. OK PyPy 3 TESTS 22 295 49356800 1400
157739059 rainap C May 19, 2022, 6:26 p.m. OK PyPy 3 TESTS 22 342 35430400 1400
157728756 anishde85 C May 19, 2022, 4:34 p.m. OK PyPy 3 TESTS 22 389 39731200 1400
157725437 ArjitShrivastava C May 19, 2022, 4:26 p.m. OK PyPy 3 TESTS 22 436 46694400 1400
157767864 _Frust C May 20, 2022, 5:21 a.m. OK PyPy 3-64 TESTS 24 139 29798400 1400
157756704 huangxw C May 20, 2022, 1:36 a.m. OK PyPy 3-64 TESTS 23 171 28876800 1400
157759641 Liberator187 C May 20, 2022, 2:48 a.m. OK PyPy 3-64 TESTS 23 186 28364800 1400
157736775 plevande C May 19, 2022, 6:06 p.m. OK PyPy 3-64 TESTS 22 202 53043200 1400
157735429 aayush_chhabra C May 19, 2022, 5:56 p.m. OK PyPy 3-64 TESTS 22 202 61644800 1400
157740261 IkshitG C May 19, 2022, 6:40 p.m. OK PyPy 3-64 TESTS 22 217 60313600 1400
157756265 abhijeet.panihar.cse20 C May 20, 2022, 1:24 a.m. OK PyPy 3-64 TESTS 23 217 61440000 1400
157737787 oadey89 C May 19, 2022, 6:15 p.m. OK PyPy 3-64 TESTS 22 233 58982400 1400
157755080 majay1638 C May 20, 2022, 12:43 a.m. OK PyPy 3-64 TESTS 23 295 28057600 1400
157770391 CAELO C May 20, 2022, 5:58 a.m. OK PyPy 3-64 TESTS 24 326 28262400 1400
157739855 7tranger C May 19, 2022, 6:35 p.m. OK Python 3 TESTS 22 342 20377600 1400
157758249 PMiguelez C May 20, 2022, 2:15 a.m. OK Python 3 TESTS 23 483 15667200 1400
157735299 Eldababa C May 19, 2022, 5:55 p.m. OK Python 3 TESTS 22 499 20377600 1400
157765607 Laveen2001 C May 20, 2022, 4:44 a.m. OK Python 3 TESTS 24 514 15667200 1400
157764440 vp2002 C May 20, 2022, 4:23 a.m. OK Python 3 TESTS 24 592 15769600 1400
157739105 saini.laxman2002 C May 19, 2022, 6:26 p.m. OK Python 3 TESTS 22 607 20377600 1400
157763460 sranbir C May 20, 2022, 4:05 a.m. OK Python 3 TESTS 23 608 15769600 1400
157742119 amarbudhiraja C May 19, 2022, 7:05 p.m. OK Python 3 TESTS 22 623 20377600 1400
157742248 ahmedsiad C May 19, 2022, 7:07 p.m. OK Python 3 TESTS 22 623 20684800 1400
157738403 Divij12 C May 19, 2022, 6:20 p.m. OK Python 3 TESTS 22 623 21094400 1400
157748700 qwerty787788 C May 19, 2022, 9:04 p.m. OK Rust 2021 TESTS 23 46 8806400 1400
157748493 qwerty787788 C May 19, 2022, 8:59 p.m. OK Rust 2021 TESTS 22 46 8806400 1400
157733958 qwerty787788 C May 19, 2022, 5:48 p.m. OK Rust 2021 TESTS 22 46 10035200 1400
157769124 Hisengard C May 20, 2022, 5:40 a.m. OK Rust 2021 TESTS 24 62 18534400 1400

remove filters

Back to search problems