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.
Problems
B"You are given a square grid with n rows and n columns. Each cell contains either 0 or 1 . In an operation, you can select a cell of the grid and flip it (from 0 to 1 or 1 to 0 ). Find the minimum number of operations you need to obtain a square that remains the same when rotated 0^{ circ} , 90^{ circ} , 180^{ circ} and 270^{ circ} . The picture below shows an example of all rotations of a grid. The first line contains a single integer t ( 1 <= q t <= q 100 ) -- the number of test cases. The first line of each test case contains a single integer n ( 1 <= q n <= q 100 ) -- the size of the grid. Then n lines follow, each with n characters a_{i,j} ( 0 <= q a_{i,j} <= q 1 ) -- the number written in each cell. For each test case output a single integer -- the minimum number of operations needed to make the square look the same rotated 0^{ circ} , 90^{ circ} , 180^{ circ} and 270^{ circ} . In the first test case, we can perform one operations to make the grid begin{matrix}0 & 1 & 0 1 & 1 & color{red}{1} 0 & 1 & 0 end{matrix} . Now, all rotations of the square are the same. In the second test case, all rotations of the square are already the same, so we don't need any flips. "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
163976456 |
chrisfcoder |
E |
July 13, 2022, 3:32 a.m. |
OK |
C# 10 |
TESTS |
8 |
77 |
3481600 |
|
|
163938381 |
Meekys |
E |
July 12, 2022, 5:24 p.m. |
OK |
C# 10 |
TESTS |
8 |
78 |
3481600 |
|
|
163948592 |
_SA |
E |
July 12, 2022, 6:46 p.m. |
OK |
C# 8 |
TESTS |
8 |
187 |
4403200 |
|
|
163942153 |
NenadDapic |
E |
July 12, 2022, 5:51 p.m. |
OK |
FPC |
TESTS |
8 |
77 |
102400 |
|
|
163973174 |
hung.nv0909 |
E |
July 13, 2022, 2:44 a.m. |
OK |
GNU C11 |
TESTS |
8 |
31 |
0 |
|
|
163935807 |
zwu2021016526 |
E |
July 12, 2022, 5:10 p.m. |
OK |
GNU C11 |
TESTS |
8 |
78 |
0 |
|
|
163941939 |
siddhu_441 |
E |
July 12, 2022, 5:49 p.m. |
OK |
GNU C11 |
TESTS |
8 |
139 |
0 |
|
|
163967203 |
value0 |
E |
July 13, 2022, 1:09 a.m. |
OK |
GNU C++14 |
TESTS |
8 |
0 |
0 |
|
|
163974736 |
pruebausuario231 |
E |
July 13, 2022, 3:07 a.m. |
OK |
GNU C++14 |
TESTS |
8 |
15 |
0 |
|
|
163972419 |
Tin_swag |
E |
July 13, 2022, 2:32 a.m. |
OK |
GNU C++14 |
TESTS |
8 |
15 |
0 |
|
|
163957157 |
confidencemen7 |
E |
July 12, 2022, 8:44 p.m. |
OK |
GNU C++14 |
TESTS |
8 |
15 |
0 |
|
|
163956042 |
ayushnautiyal1110 |
E |
July 12, 2022, 8:21 p.m. |
OK |
GNU C++14 |
TESTS |
8 |
15 |
0 |
|
|
163953417 |
not_ashutosh1845 |
E |
July 12, 2022, 7:42 p.m. |
OK |
GNU C++14 |
TESTS |
8 |
15 |
0 |
|
|
163938245 |
abhay_lavania |
E |
July 12, 2022, 5:23 p.m. |
OK |
GNU C++14 |
TESTS |
8 |
15 |
0 |
|
|
163984753 |
LHK_CN |
E |
July 13, 2022, 5:28 a.m. |
OK |
GNU C++14 |
TESTS |
8 |
15 |
0 |
|
|
163986739 |
kk8 |
E |
July 13, 2022, 5:50 a.m. |
OK |
GNU C++14 |
TESTS |
8 |
15 |
0 |
|
|
163979869 |
hydracody |
E |
July 13, 2022, 4:23 a.m. |
OK |
GNU C++14 |
TESTS |
8 |
15 |
0 |
|
|
163979649 |
vedangc03 |
E |
July 13, 2022, 4:20 a.m. |
OK |
GNU C++17 |
TESTS |
8 |
15 |
0 |
|
|
163978768 |
patidarujjawal |
E |
July 13, 2022, 4:07 a.m. |
OK |
GNU C++17 |
TESTS |
8 |
15 |
0 |
|
|
163978189 |
fru1t |
E |
July 13, 2022, 3:58 a.m. |
OK |
GNU C++17 |
TESTS |
8 |
15 |
0 |
|
|
163974505 |
YashK007 |
E |
July 13, 2022, 3:04 a.m. |
OK |
GNU C++17 |
TESTS |
8 |
15 |
0 |
|
|
163972498 |
Guichena |
E |
July 13, 2022, 2:34 a.m. |
OK |
GNU C++17 |
TESTS |
8 |
15 |
0 |
|
|
163972481 |
ms3 |
E |
July 13, 2022, 2:33 a.m. |
OK |
GNU C++17 |
TESTS |
8 |
15 |
0 |
|
|
163971361 |
link_nlf |
E |
July 13, 2022, 2:16 a.m. |
OK |
GNU C++17 |
TESTS |
8 |
15 |
0 |
|
|
163985123 |
jakkalagirish |
E |
July 13, 2022, 5:32 a.m. |
OK |
GNU C++17 |
TESTS |
8 |
15 |
0 |
|
|
163984530 |
xiaotuanque |
E |
July 13, 2022, 5:26 a.m. |
OK |
GNU C++17 |
TESTS |
8 |
15 |
0 |
|
|
163980902 |
Amazlng |
E |
July 13, 2022, 4:39 a.m. |
OK |
GNU C++17 |
TESTS |
8 |
15 |
0 |
|
|
163961711 |
tamuwarhead |
E |
July 12, 2022, 10:33 p.m. |
OK |
GNU C++17 (64) |
TESTS |
8 |
15 |
0 |
|
|
163982547 |
alif_cse_ju |
E |
July 13, 2022, 5:02 a.m. |
OK |
GNU C++17 (64) |
TESTS |
8 |
15 |
0 |
|
|
163977950 |
JustinRochester |
E |
July 13, 2022, 3:54 a.m. |
OK |
GNU C++17 (64) |
TESTS |
8 |
15 |
0 |
|
|
163966728 |
RunTime_Terror24 |
E |
July 13, 2022, 12:59 a.m. |
OK |
GNU C++17 (64) |
TESTS |
8 |
15 |
0 |
|
|
163945845 |
SakiBee |
E |
July 12, 2022, 6:21 p.m. |
OK |
GNU C++17 (64) |
TESTS |
8 |
15 |
0 |
|
|
163936596 |
Sakib62 |
E |
July 12, 2022, 5:14 p.m. |
OK |
GNU C++17 (64) |
TESTS |
8 |
15 |
0 |
|
|
163935643 |
XHYU61 |
E |
July 12, 2022, 5:10 p.m. |
OK |
GNU C++17 (64) |
TESTS |
8 |
15 |
0 |
|
|
163975426 |
Dkps0081 |
E |
July 13, 2022, 3:17 a.m. |
OK |
GNU C++17 (64) |
TESTS |
8 |
15 |
102400 |
|
|
163970147 |
chenmoooo |
E |
July 13, 2022, 1:58 a.m. |
OK |
GNU C++17 (64) |
TESTS |
8 |
15 |
102400 |
|
|
163966986 |
MoNasr |
E |
July 13, 2022, 1:05 a.m. |
OK |
GNU C++17 (64) |
TESTS |
8 |
15 |
102400 |
|
|
163949189 |
impressionnante |
E |
July 12, 2022, 6:52 p.m. |
OK |
GNU C++20 (64) |
TESTS |
8 |
0 |
0 |
|
|
163974947 |
thinhcute |
E |
July 13, 2022, 3:10 a.m. |
OK |
GNU C++20 (64) |
TESTS |
8 |
0 |
0 |
|
|
163955756 |
Tahim_097 |
E |
July 12, 2022, 8:15 p.m. |
OK |
GNU C++20 (64) |
TESTS |
8 |
0 |
0 |
|
|
163952218 |
Veldora_ |
E |
July 12, 2022, 7:26 p.m. |
OK |
GNU C++20 (64) |
TESTS |
8 |
0 |
0 |
|
|
163950632 |
shubhamjha1313 |
E |
July 12, 2022, 7:08 p.m. |
OK |
GNU C++20 (64) |
TESTS |
8 |
0 |
102400 |
|
|
163945666 |
Gaming |
E |
July 12, 2022, 6:19 p.m. |
OK |
GNU C++20 (64) |
TESTS |
8 |
0 |
102400 |
|
|
163981811 |
RP_21 |
E |
July 13, 2022, 4:52 a.m. |
OK |
GNU C++20 (64) |
TESTS |
8 |
0 |
102400 |
|
|
163984472 |
Ashish_Coder6 |
E |
July 13, 2022, 5:25 a.m. |
OK |
GNU C++20 (64) |
TESTS |
8 |
0 |
102400 |
|
|
163985165 |
RP_21 |
E |
July 13, 2022, 5:33 a.m. |
OK |
GNU C++20 (64) |
TESTS |
8 |
0 |
102400 |
|
|
163984880 |
RP_21 |
E |
July 13, 2022, 5:30 a.m. |
OK |
GNU C++20 (64) |
TESTS |
8 |
15 |
0 |
|
|
163953671 |
Vrutik_2809 |
E |
July 12, 2022, 7:45 p.m. |
OK |
Java 11 |
TESTS |
8 |
170 |
0 |
|
|
163941195 |
NO__OB |
E |
July 12, 2022, 5:44 p.m. |
OK |
Java 11 |
TESTS |
8 |
170 |
0 |
|
|
163937196 |
SleepDeprived |
E |
July 12, 2022, 5:17 p.m. |
OK |
Java 11 |
TESTS |
8 |
171 |
0 |
|
|
163973115 |
aditya2024 |
E |
July 13, 2022, 2:43 a.m. |
OK |
Java 11 |
TESTS |
8 |
186 |
0 |
|
|
163954289 |
Vrutik_2809 |
E |
July 12, 2022, 7:53 p.m. |
OK |
Java 11 |
TESTS |
8 |
186 |
0 |
|
|
163948882 |
_abstract_ |
E |
July 12, 2022, 6:49 p.m. |
OK |
Java 11 |
TESTS |
8 |
186 |
0 |
|
|
163939654 |
iamsoumik |
E |
July 12, 2022, 5:32 p.m. |
OK |
Java 11 |
TESTS |
8 |
186 |
0 |
|
|
163940086 |
gurkaran_s |
E |
July 12, 2022, 5:35 p.m. |
OK |
Java 11 |
TESTS |
8 |
187 |
0 |
|
|
163978199 |
deepaksach |
E |
July 13, 2022, 3:58 a.m. |
OK |
Java 11 |
TESTS |
8 |
187 |
0 |
|
|
163939778 |
Sikander_2000 |
E |
July 12, 2022, 5:33 p.m. |
OK |
Java 11 |
TESTS |
8 |
187 |
0 |
|
|
163956371 |
imvivekthakur |
E |
July 12, 2022, 8:28 p.m. |
OK |
Java 17 |
TESTS |
8 |
186 |
204800 |
|
|
163940512 |
SmartHamster |
E |
July 12, 2022, 5:38 p.m. |
OK |
Java 17 |
TESTS |
8 |
327 |
819200 |
|
|
163965428 |
aspect_129 |
E |
July 13, 2022, 12:30 a.m. |
OK |
Java 8 |
TESTS |
8 |
93 |
0 |
|
|
163940299 |
ruchir28 |
E |
July 12, 2022, 5:37 p.m. |
OK |
Java 8 |
TESTS |
8 |
93 |
0 |
|
|
163971792 |
RetARDed1111 |
E |
July 13, 2022, 2:23 a.m. |
OK |
Java 8 |
TESTS |
8 |
109 |
0 |
|
|
163948995 |
nobita4610 |
E |
July 12, 2022, 6:50 p.m. |
OK |
Java 8 |
TESTS |
8 |
109 |
0 |
|
|
163939872 |
priyaroy3370 |
E |
July 12, 2022, 5:34 p.m. |
OK |
Java 8 |
TESTS |
8 |
109 |
0 |
|
|
163960043 |
rish1896 |
E |
July 12, 2022, 9:49 p.m. |
OK |
Java 8 |
TESTS |
8 |
124 |
0 |
|
|
163950395 |
SN_Infinity |
E |
July 12, 2022, 7:05 p.m. |
OK |
Java 8 |
TESTS |
8 |
140 |
0 |
|
|
163985104 |
Kaldaruly |
E |
July 13, 2022, 5:32 a.m. |
OK |
Java 8 |
TESTS |
8 |
155 |
0 |
|
|
163977484 |
yaswanth_coder |
E |
July 13, 2022, 3:47 a.m. |
OK |
Java 8 |
TESTS |
8 |
155 |
0 |
|
|
163936252 |
coolkhanna31 |
E |
July 12, 2022, 5:12 p.m. |
OK |
Java 8 |
TESTS |
8 |
155 |
0 |
|
|
163938741 |
junehop |
E |
July 12, 2022, 5:26 p.m. |
OK |
JavaScript |
TESTS |
8 |
171 |
2560000 |
|
|
163940921 |
Ariful3671 |
E |
July 12, 2022, 5:42 p.m. |
OK |
Kotlin 1.6 |
TESTS |
8 |
202 |
0 |
|
|
163935043 |
Bloodwyn |
E |
July 12, 2022, 5:07 p.m. |
OK |
Kotlin 1.6 |
TESTS |
8 |
202 |
0 |
|
|
163973990 |
qihnus |
E |
July 13, 2022, 2:57 a.m. |
OK |
Kotlin 1.6 |
TESTS |
8 |
296 |
512000 |
|
|
163976457 |
xiangyi1 |
E |
July 13, 2022, 3:32 a.m. |
OK |
MS C++ 2017 |
TESTS |
8 |
31 |
102400 |
|
|
163970935 |
hHap |
E |
July 13, 2022, 2:10 a.m. |
OK |
MS C++ 2017 |
TESTS |
8 |
31 |
102400 |
|
|
163953796 |
alcogoliki |
E |
July 12, 2022, 7:46 p.m. |
OK |
MS C++ 2017 |
TESTS |
8 |
140 |
409600 |
|
|
163941115 |
ElectRIC.dll |
E |
July 12, 2022, 5:43 p.m. |
OK |
MS C++ 2017 |
TESTS |
8 |
217 |
0 |
|
|
163975641 |
mianbizhe |
E |
July 13, 2022, 3:19 a.m. |
OK |
MS C++ 2017 |
TESTS |
8 |
218 |
0 |
|
|
163945765 |
rsFalse |
E |
July 12, 2022, 6:20 p.m. |
OK |
Perl |
TESTS |
8 |
795 |
1843200 |
|
|
163977296 |
yoralbayev |
E |
July 13, 2022, 3:44 a.m. |
OK |
PHP |
TESTS |
8 |
155 |
0 |
|
|
163938405 |
hritik3878 |
E |
July 12, 2022, 5:24 p.m. |
OK |
PyPy 3 |
TESTS |
8 |
171 |
9011200 |
|
|
163938290 |
grawlixes |
E |
July 12, 2022, 5:24 p.m. |
OK |
PyPy 3 |
TESTS |
8 |
233 |
8499200 |
|
|
163979685 |
rajeshpenugonda6 |
E |
July 13, 2022, 4:21 a.m. |
OK |
PyPy 3 |
TESTS |
8 |
248 |
11776000 |
|
|
163947898 |
sky9313 |
E |
July 12, 2022, 6:39 p.m. |
OK |
PyPy 3 |
TESTS |
8 |
311 |
8192000 |
|
|
163948618 |
kartikeya45 |
E |
July 12, 2022, 6:46 p.m. |
OK |
PyPy 3 |
TESTS |
8 |
311 |
9420800 |
|
|
163942307 |
gotcoding124 |
E |
July 12, 2022, 5:52 p.m. |
OK |
PyPy 3 |
TESTS |
8 |
311 |
9625600 |
|
|
163965156 |
luciaa |
E |
July 13, 2022, 12:23 a.m. |
OK |
PyPy 3 |
TESTS |
8 |
389 |
10854400 |
|
|
163974332 |
rimugi |
E |
July 13, 2022, 3:01 a.m. |
OK |
PyPy 3 |
TESTS |
8 |
389 |
11673600 |
|
|
163935865 |
racernigga |
E |
July 12, 2022, 5:11 p.m. |
OK |
PyPy 3 |
TESTS |
8 |
420 |
11366400 |
|
|
163980837 |
Rose_Barrett_M95 |
E |
July 13, 2022, 4:38 a.m. |
OK |
PyPy 3 |
TESTS |
8 |
451 |
8396800 |
|
|
163970376 |
MistaAsh |
E |
July 13, 2022, 2:01 a.m. |
OK |
PyPy 3-64 |
TESTS |
8 |
93 |
9420800 |
|
|
163979499 |
chan_uuu |
E |
July 13, 2022, 4:18 a.m. |
OK |
PyPy 3-64 |
TESTS |
8 |
109 |
9830400 |
|
|
163936250 |
alexwice |
E |
July 12, 2022, 5:12 p.m. |
OK |
PyPy 3-64 |
TESTS |
8 |
109 |
10854400 |
|
|
163978707 |
Code_Breaker101 |
E |
July 13, 2022, 4:06 a.m. |
OK |
PyPy 3-64 |
TESTS |
8 |
109 |
11980800 |
|
|
163977677 |
mrng |
E |
July 13, 2022, 3:50 a.m. |
OK |
PyPy 3-64 |
TESTS |
8 |
124 |
5222400 |
|
|
163935327 |
hatti |
E |
July 12, 2022, 5:08 p.m. |
OK |
PyPy 3-64 |
TESTS |
8 |
124 |
7475200 |
|
|
163944171 |
AB27 |
E |
July 12, 2022, 6:07 p.m. |
OK |
PyPy 3-64 |
TESTS |
8 |
140 |
10035200 |
|
|
163964625 |
shikamarubyte |
E |
July 13, 2022, 12:08 a.m. |
OK |
PyPy 3-64 |
TESTS |
8 |
155 |
9216000 |
|
|
163949528 |
mayank35 |
E |
July 12, 2022, 6:56 p.m. |
OK |
PyPy 3-64 |
TESTS |
8 |
155 |
14848000 |
|
|
163985744 |
niumeng |
E |
July 13, 2022, 5:39 a.m. |
OK |
PyPy 3-64 |
TESTS |
8 |
171 |
12492800 |
|
|
163956838 |
Kaatil |
E |
July 12, 2022, 8:38 p.m. |
OK |
Python 3 |
TESTS |
8 |
280 |
0 |
|
|
163972623 |
happywater |
E |
July 13, 2022, 2:36 a.m. |
OK |
Python 3 |
TESTS |
8 |
327 |
0 |
|
|
163959468 |
eugalt |
E |
July 12, 2022, 9:35 p.m. |
OK |
Python 3 |
TESTS |
8 |
358 |
0 |
|
|
163941138 |
GouthamSan |
E |
July 12, 2022, 5:43 p.m. |
OK |
Python 3 |
TESTS |
8 |
374 |
0 |
|
|
163936680 |
Bhargav0811 |
E |
July 12, 2022, 5:15 p.m. |
OK |
Python 3 |
TESTS |
8 |
389 |
0 |
|
|
163959827 |
eugalt |
E |
July 12, 2022, 9:44 p.m. |
OK |
Python 3 |
TESTS |
8 |
405 |
0 |
|
|
163967819 |
kirillbk |
E |
July 13, 2022, 1:19 a.m. |
OK |
Python 3 |
TESTS |
8 |
436 |
0 |
|
|
163936694 |
yylele |
E |
July 12, 2022, 5:15 p.m. |
OK |
Python 3 |
TESTS |
8 |
451 |
0 |
|
|
163943676 |
1429_FowL |
E |
July 12, 2022, 6:03 p.m. |
OK |
Python 3 |
TESTS |
8 |
483 |
102400 |
|
|
163958289 |
sayedElgholy |
E |
July 12, 2022, 9:08 p.m. |
OK |
Python 3 |
TESTS |
8 |
499 |
0 |
|
|
163941818 |
googlweknoall |
E |
July 12, 2022, 5:48 p.m. |
OK |
Rust 2021 |
TESTS |
8 |
15 |
307200 |
|
|
remove filters
Back to search problems