Codeforces Round 684 (Div. 1)

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
1439 Codeforces Round 684 (Div. 1) FINISHED False 8100 170781923 Nov. 17, 2020, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 5390 ) A2 Binary Table (Hard Version) PROGRAMMING constructive algorithms graphs greedy implementation

This is the hard version of the problem. The difference between the versions is in the number of possible operations that can be made. You can make hacks if and only if you solved both versions of the problem. You are given a binary table of size n x m . This table consists of symbols 0 and 1 . You can make such operation: select 3 different cells that belong to one 2 x 2 square and change the symbols in these cells (change 0 to 1 and 1 to 0 ). Your task is to make all symbols in the table equal to 0 . You are allowed to make at most nm operations. You don't need to minimize the number of operations. It can be proved, that it is always possible. The first line contains a single integer t ( 1 <= q t <= q 5000 ) -- the number of test cases. The next lines contain descriptions of test cases. The first line of the description of each test case contains two integers n , m ( 2 <= q n, m <= q 100 ). Each of the next n lines contains a binary string of length m , describing the symbols of the next row of the table. It is guaranteed, that the sum of nm for all test cases does not exceed 20000 . For each test case print the integer k ( 0 <= q k <= q nm ) -- the number of operations. In the each of the next k lines print 6 integers x_1, y_1, x_2, y_2, x_3, y_3 ( 1 <= q x_1, x_2, x_3 <= q n, 1 <= q y_1, y_2, y_3 <= q m ) describing the next operation. This operation will be made with three cells (x_1, y_1) , (x_2, y_2) , (x_3, y_3) . These three cells should be different. These three cells should belong to some 2 x 2 square. In the first test case, it is possible to make only one operation with cells (1, 1) , (2, 1) , (2, 2) . After that, all symbols will be equal to 0 . In the second test case: In the fifth test case:

Tutorials

Codeforces Round #684[Div1 and Div2] Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
98729379 Gassa A2 Nov. 17, 2020, 4:14 p.m. OK D TESTS 9 46 6144000
98726309 hos.lyric A2 Nov. 17, 2020, 4:06 p.m. OK D TESTS 9 46 6144000
98710755 Lius A2 Nov. 17, 2020, 3:24 p.m. OK GNU C++11 TESTS 9 15 204800
98700425 starusc A2 Nov. 17, 2020, 3 p.m. OK GNU C++11 TESTS 9 15 307200
98699574 zld3794955 A2 Nov. 17, 2020, 2:59 p.m. OK GNU C++11 TESTS 9 30 204800
98764047 allfadeaway A2 Nov. 17, 2020, 11:27 p.m. OK GNU C++11 TESTS 9 30 307200
98715520 00001 A2 Nov. 17, 2020, 3:37 p.m. OK GNU C++11 TESTS 9 30 307200
98705632 jz_597 A2 Nov. 17, 2020, 3:12 p.m. OK GNU C++11 TESTS 9 30 614400
98710082 juruo1086 A2 Nov. 17, 2020, 3:23 p.m. OK GNU C++11 TESTS 9 30 1331200
98775886 alan_zhao_2007 A2 Nov. 18, 2020, 5:23 a.m. OK GNU C++11 TESTS 9 30 3788800
98705977 zhylj A2 Nov. 17, 2020, 3:12 p.m. OK GNU C++11 TESTS 9 30 9113600
98703203 tiger2005 A2 Nov. 17, 2020, 3:06 p.m. OK GNU C++11 TESTS 9 31 102400
98744288 radoslav11 A2 Nov. 17, 2020, 4:49 p.m. OK GNU C++14 TESTS 9 30 409600
98738720 Wi1der A2 Nov. 17, 2020, 4:38 p.m. OK GNU C++14 TESTS 9 30 409600
98731510 hamlet A2 Nov. 17, 2020, 4:20 p.m. OK GNU C++14 TESTS 9 30 409600
98703764 qxforever A2 Nov. 17, 2020, 3:07 p.m. OK GNU C++14 TESTS 9 30 409600
98702348 TheLonelyMoon A2 Nov. 17, 2020, 3:04 p.m. OK GNU C++14 TESTS 9 30 614400
98695379 yhx-12243 A2 Nov. 17, 2020, 2:50 p.m. OK GNU C++14 TESTS 9 30 614400
98733304 DeepJay A2 Nov. 17, 2020, 4:25 p.m. OK GNU C++14 TESTS 9 30 4403200
98722007 purinliang A2 Nov. 17, 2020, 3:55 p.m. OK GNU C++14 TESTS 9 30 7270400
98725529 Witcano A2 Nov. 17, 2020, 4:04 p.m. OK GNU C++14 TESTS 9 31 204800
98770041 zhanggengchen A2 Nov. 18, 2020, 3:16 a.m. OK GNU C++14 TESTS 9 31 307200
98709661 joaom A2 Nov. 17, 2020, 3:22 p.m. OK GNU C++17 TESTS 9 30 307200
98701569 WaterColor2037 A2 Nov. 17, 2020, 3:03 p.m. OK GNU C++17 TESTS 9 30 409600
98716017 cristian1997 A2 Nov. 17, 2020, 3:38 p.m. OK GNU C++17 TESTS 9 30 409600
98699389 Hazyknight A2 Nov. 17, 2020, 2:58 p.m. OK GNU C++17 TESTS 9 30 512000
98738495 jdurie A2 Nov. 17, 2020, 4:38 p.m. OK GNU C++17 TESTS 9 30 512000
98728755 hrsh_panwar A2 Nov. 17, 2020, 4:13 p.m. OK GNU C++17 TESTS 9 30 512000
98719834 Sugarii A2 Nov. 17, 2020, 3:49 p.m. OK GNU C++17 TESTS 9 30 614400
98747627 Ra16bit A2 Nov. 17, 2020, 5:30 p.m. OK GNU C++17 TESTS 9 30 921600
98713477 tsyr8924503 A2 Nov. 17, 2020, 3:32 p.m. OK GNU C++17 TESTS 9 30 1433600
98705993 evenharder A2 Nov. 17, 2020, 3:12 p.m. OK GNU C++17 TESTS 9 31 204800
98776602 nishank.suresh A2 Nov. 18, 2020, 5:35 a.m. OK GNU C++17 (64) TESTS 9 15 307200
98718706 GRT_2018 A2 Nov. 17, 2020, 3:46 p.m. OK GNU C++17 (64) TESTS 9 15 409600
98773984 qdd A2 Nov. 18, 2020, 4:45 a.m. OK GNU C++17 (64) TESTS 9 15 512000
98702701 haruki_K A2 Nov. 17, 2020, 3:05 p.m. OK GNU C++17 (64) TESTS 9 15 614400
98748816 Handsome2004 A2 Nov. 17, 2020, 5:39 p.m. OK GNU C++17 (64) TESTS 9 30 102400
98734978 Ajax A2 Nov. 17, 2020, 4:29 p.m. OK GNU C++17 (64) TESTS 9 30 204800
98756070 LiChenKoh A2 Nov. 17, 2020, 7:18 p.m. OK GNU C++17 (64) TESTS 9 30 307200
98717912 Vasyl_Protsiv A2 Nov. 17, 2020, 3:43 p.m. OK GNU C++17 (64) TESTS 9 30 307200
98700927 tfg A2 Nov. 17, 2020, 3:01 p.m. OK GNU C++17 (64) TESTS 9 30 307200
98766772 june_waves A2 Nov. 18, 2020, 1:39 a.m. OK GNU C++17 (64) TESTS 9 30 409600
98703001 synapse A2 Nov. 17, 2020, 3:06 p.m. OK Go TESTS 9 46 102400
98773135 synapse A2 Nov. 18, 2020, 4:27 a.m. OK Go TESTS 9 46 102400
98706957 mikit A2 Nov. 17, 2020, 3:15 p.m. OK Java 11 TESTS 9 171 0
98705034 mphillotry A2 Nov. 17, 2020, 3:10 p.m. OK Java 11 TESTS 9 202 0
98727068 skittles1412 A2 Nov. 17, 2020, 4:08 p.m. OK Java 11 TESTS 9 202 0
98706746 iakovlev.zakhar A2 Nov. 17, 2020, 3:14 p.m. OK Java 11 TESTS 9 217 0
98762052 soumit915 A2 Nov. 17, 2020, 9:51 p.m. OK Java 11 TESTS 9 218 0
98695348 uwi A2 Nov. 17, 2020, 2:50 p.m. OK Java 11 TESTS 9 233 0
98762369 rreeennnnn A2 Nov. 17, 2020, 10:04 p.m. OK Java 11 TESTS 9 265 1126400
98703386 cwise A2 Nov. 17, 2020, 3:07 p.m. OK Java 8 TESTS 9 124 0
98722014 golions A2 Nov. 17, 2020, 3:55 p.m. OK Java 8 TESTS 9 124 0
98755966 procrastinate7 A2 Nov. 17, 2020, 7:16 p.m. OK Java 8 TESTS 9 124 921600
98707891 BNL A2 Nov. 17, 2020, 3:17 p.m. OK Java 8 TESTS 9 139 1331200
98751378 2020akadaver A2 Nov. 17, 2020, 6:04 p.m. OK Java 8 TESTS 9 140 0
98731240 robinz62 A2 Nov. 17, 2020, 4:19 p.m. OK Java 8 TESTS 9 140 0
98709548 adp527 A2 Nov. 17, 2020, 3:21 p.m. OK Java 8 TESTS 9 140 0
98708799 polyakoff A2 Nov. 17, 2020, 3:19 p.m. OK Java 8 TESTS 9 140 0
98747999 AryssonFigueiredo A2 Nov. 17, 2020, 5:33 p.m. OK Java 8 TESTS 9 170 0
98712700 martins A2 Nov. 17, 2020, 3:30 p.m. OK Java 8 TESTS 9 186 716800
98751847 AryssonFigueiredo A2 Nov. 17, 2020, 6:10 p.m. OK Kotlin TESTS 9 171 204800
98712465 tarattata1 A2 Nov. 17, 2020, 3:29 p.m. OK MS C++ 2017 TESTS 9 46 307200
98701435 pichulia A2 Nov. 17, 2020, 3:02 p.m. OK MS C++ 2017 TESTS 9 61 52121600
98726438 Khas_Profit_LLC A2 Nov. 17, 2020, 4:06 p.m. OK MS C++ 2017 TESTS 9 77 204800
98718546 AnnSuperstar A2 Nov. 17, 2020, 3:45 p.m. OK MS C++ 2017 TESTS 9 77 409600
98707429 gnomina007 A2 Nov. 17, 2020, 3:16 p.m. OK MS C++ 2017 TESTS 9 186 80896000
98714712 terry_u16 A2 Nov. 17, 2020, 3:35 p.m. OK .NET Core C# TESTS 9 108 6860800
98747082 mban259 A2 Nov. 17, 2020, 5:26 p.m. OK .NET Core C# TESTS 9 109 3379200
98702107 keymoon A2 Nov. 17, 2020, 3:04 p.m. OK .NET Core C# TESTS 9 109 3686400
98717483 azukun A2 Nov. 17, 2020, 3:42 p.m. OK .NET Core C# TESTS 9 109 3788800
98708299 Yupiteru A2 Nov. 17, 2020, 3:18 p.m. OK .NET Core C# TESTS 9 124 8601600
98703169 riantkb A2 Nov. 17, 2020, 3:06 p.m. OK .NET Core C# TESTS 9 140 10342400
98709339 pineriver A2 Nov. 17, 2020, 3:21 p.m. OK PyPy 3 TESTS 9 202 5836800
98766554 generic_placeholder_name A2 Nov. 18, 2020, 1:30 a.m. OK PyPy 3 TESTS 9 218 6451200
98709976 TheVan A2 Nov. 17, 2020, 3:22 p.m. OK PyPy 3 TESTS 9 233 6553600
98696672 conqueror_of_tourist A2 Nov. 17, 2020, 2:53 p.m. OK PyPy 3 TESTS 9 233 6656000
98712189 titia A2 Nov. 17, 2020, 3:28 p.m. OK PyPy 3 TESTS 9 249 9318400
98702536 asdsasd A2 Nov. 17, 2020, 3:05 p.m. OK PyPy 3 TESTS 9 265 9523200
98702424 SPD_9X2 A2 Nov. 17, 2020, 3:05 p.m. OK PyPy 3 TESTS 9 265 9523200
98752722 FlakeLCR A2 Nov. 17, 2020, 6:22 p.m. OK PyPy 3 TESTS 9 265 9625600
98715988 FlakeLCR A2 Nov. 17, 2020, 3:38 p.m. OK PyPy 3 TESTS 9 280 9318400
98719458 mkawa2 A2 Nov. 17, 2020, 3:48 p.m. OK PyPy 3 TESTS 9 280 74342400
98697983 nwi A2 Nov. 17, 2020, 2:55 p.m. OK Python 2 TESTS 9 186 409600
98707224 r57shell A2 Nov. 17, 2020, 3:15 p.m. OK Python 3 TESTS 9 140 614400
98694356 sansen A2 Nov. 17, 2020, 2:48 p.m. OK Rust TESTS 9 46 512000
98699956 kobae964 A2 Nov. 17, 2020, 2:59 p.m. OK Rust TESTS 9 46 614400
98701305 GeoffreyY A2 Nov. 17, 2020, 3:02 p.m. OK Rust TESTS 9 124 409600
98711174 ngtkana A2 Nov. 17, 2020, 3:26 p.m. OK Rust TESTS 9 155 512000

remove filters

Back to search problems