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 matrix a consisting of positive integers. It has n rows and m columns. Construct a matrix b consisting of positive integers. It should have the same size as a , and the following conditions should be met: We can show that the answer always exists. The first line contains two integers n and m ( 2 <= n,m <= 500 ). Each of the following n lines contains m integers. The j -th integer in the i -th line is a_{i,j} ( 1 <= a_{i,j} <= 16 ). The output should contain n lines each containing m integers. The j -th integer in the i -th line should be b_{i,j} . In the first example, the matrix a can be used as the matrix b , because the absolute value of the difference between numbers in any adjacent pair of cells is 1 = 1^4 . In the third example: '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
107235873 |
ruban |
D |
Feb. 12, 2021, 6:23 p.m. |
OK |
Delphi |
TESTS |
27 |
108 |
15769600 |
|
2200 |
107234499 |
ruban |
D |
Feb. 12, 2021, 6:02 p.m. |
OK |
FPC |
TESTS |
27 |
842 |
15769600 |
|
2200 |
107238256 |
a_b__c |
D |
Feb. 12, 2021, 7:01 p.m. |
OK |
GNU C11 |
TESTS |
27 |
904 |
0 |
|
2200 |
107247342 |
yzx1798106406 |
D |
Feb. 13, 2021, 12:31 a.m. |
OK |
GNU C++11 |
TESTS |
27 |
31 |
1024000 |
|
2200 |
107224172 |
Sanzenkai |
D |
Feb. 12, 2021, 4:35 p.m. |
OK |
GNU C++11 |
TESTS |
27 |
31 |
1024000 |
|
2200 |
107231610 |
EternalEpic |
D |
Feb. 12, 2021, 5:31 p.m. |
OK |
GNU C++11 |
TESTS |
27 |
31 |
2150400 |
|
2200 |
107247206 |
dingdingsb |
D |
Feb. 13, 2021, 12:22 a.m. |
OK |
GNU C++11 |
TESTS |
27 |
31 |
4198400 |
|
2200 |
107221672 |
SxyLimit |
D |
Feb. 12, 2021, 4:25 p.m. |
OK |
GNU C++11 |
TESTS |
27 |
31 |
17817600 |
|
2200 |
107232477 |
qdnoip |
D |
Feb. 12, 2021, 5:39 p.m. |
OK |
GNU C++11 |
TESTS |
27 |
46 |
0 |
|
2200 |
107230103 |
QwQcOrZ |
D |
Feb. 12, 2021, 5:21 p.m. |
OK |
GNU C++11 |
TESTS |
27 |
46 |
0 |
|
2200 |
107232428 |
VictorW |
D |
Feb. 12, 2021, 5:38 p.m. |
OK |
GNU C++11 |
TESTS |
27 |
61 |
0 |
|
2200 |
107249709 |
TwilightShadow |
D |
Feb. 13, 2021, 2:32 a.m. |
OK |
GNU C++11 |
TESTS |
27 |
61 |
0 |
|
2200 |
107229616 |
suxxsfe |
D |
Feb. 12, 2021, 5:19 p.m. |
OK |
GNU C++11 |
TESTS |
27 |
61 |
0 |
|
2200 |
107249146 |
NIGULASIOUYANG |
D |
Feb. 13, 2021, 2:09 a.m. |
OK |
GNU C++14 |
TESTS |
27 |
77 |
0 |
|
2200 |
107227762 |
zzm824 |
D |
Feb. 12, 2021, 4:47 p.m. |
OK |
GNU C++14 |
TESTS |
27 |
77 |
1024000 |
|
2200 |
107230740 |
Semonya |
D |
Feb. 12, 2021, 5:24 p.m. |
OK |
GNU C++14 |
TESTS |
27 |
78 |
0 |
|
2200 |
107252946 |
bkifhr6 |
D |
Feb. 13, 2021, 4:21 a.m. |
OK |
GNU C++14 |
TESTS |
27 |
78 |
2048000 |
|
2200 |
107247392 |
PC_E1052 |
D |
Feb. 13, 2021, 12:34 a.m. |
OK |
GNU C++14 |
TESTS |
27 |
92 |
1024000 |
|
2200 |
107239691 |
theartofwar |
D |
Feb. 12, 2021, 7:29 p.m. |
OK |
GNU C++14 |
TESTS |
27 |
92 |
1024000 |
|
2200 |
107247666 |
nandonathaniel |
D |
Feb. 13, 2021, 12:50 a.m. |
OK |
GNU C++14 |
TESTS |
27 |
93 |
0 |
|
2200 |
107250066 |
HappyChau0v0 |
D |
Feb. 13, 2021, 2:46 a.m. |
OK |
GNU C++14 |
TESTS |
27 |
93 |
0 |
|
2200 |
107249074 |
tourist_teacher |
D |
Feb. 13, 2021, 2:06 a.m. |
OK |
GNU C++14 |
TESTS |
27 |
93 |
0 |
|
2200 |
107246610 |
Dan13llljws |
D |
Feb. 12, 2021, 11:44 p.m. |
OK |
GNU C++14 |
TESTS |
27 |
93 |
0 |
|
2200 |
107219650 |
2qbingxuan |
D |
Feb. 12, 2021, 4:16 p.m. |
OK |
GNU C++17 |
TESTS |
27 |
77 |
204800 |
|
2200 |
107250785 |
feiko |
D |
Feb. 13, 2021, 3:13 a.m. |
OK |
GNU C++17 |
TESTS |
27 |
77 |
1024000 |
|
2200 |
107248117 |
200815147 |
D |
Feb. 13, 2021, 1:17 a.m. |
OK |
GNU C++17 |
TESTS |
27 |
78 |
0 |
|
2200 |
107224507 |
ButterflyDew |
D |
Feb. 12, 2021, 4:36 p.m. |
OK |
GNU C++17 |
TESTS |
27 |
78 |
1024000 |
|
2200 |
107231538 |
Lain |
D |
Feb. 12, 2021, 5:31 p.m. |
OK |
GNU C++17 |
TESTS |
27 |
78 |
1024000 |
|
2200 |
107228640 |
harsh639 |
D |
Feb. 12, 2021, 4:49 p.m. |
OK |
GNU C++17 |
TESTS |
27 |
78 |
1024000 |
|
2200 |
107252141 |
minhnguyenxuan60 |
D |
Feb. 13, 2021, 3:56 a.m. |
OK |
GNU C++17 |
TESTS |
27 |
93 |
0 |
|
2200 |
107255621 |
DimmyT |
D |
Feb. 13, 2021, 5:30 a.m. |
OK |
GNU C++17 |
TESTS |
27 |
93 |
0 |
|
2200 |
107252254 |
sushil123 |
D |
Feb. 13, 2021, 3:59 a.m. |
OK |
GNU C++17 |
TESTS |
27 |
93 |
0 |
|
2200 |
107252221 |
Zap |
D |
Feb. 13, 2021, 3:58 a.m. |
OK |
GNU C++17 |
TESTS |
27 |
93 |
0 |
|
2200 |
107223677 |
Alphagocc |
D |
Feb. 12, 2021, 4:33 p.m. |
OK |
GNU C++17 (64) |
TESTS |
27 |
31 |
2764800 |
|
2200 |
107234019 |
silverfish |
D |
Feb. 12, 2021, 5:55 p.m. |
OK |
GNU C++17 (64) |
TESTS |
27 |
61 |
0 |
|
2200 |
107249077 |
Crz-Willis |
D |
Feb. 13, 2021, 2:06 a.m. |
OK |
GNU C++17 (64) |
TESTS |
27 |
61 |
0 |
|
2200 |
107232025 |
Tuyile |
D |
Feb. 12, 2021, 5:35 p.m. |
OK |
GNU C++17 (64) |
TESTS |
27 |
61 |
0 |
|
2200 |
107253192 |
zerver52 |
D |
Feb. 13, 2021, 4:29 a.m. |
OK |
GNU C++17 (64) |
TESTS |
27 |
61 |
1126400 |
|
2200 |
107218674 |
haengsyo |
D |
Feb. 12, 2021, 4:12 p.m. |
OK |
GNU C++17 (64) |
TESTS |
27 |
61 |
2355200 |
|
2200 |
107250301 |
L1ngYu233 |
D |
Feb. 13, 2021, 2:55 a.m. |
OK |
GNU C++17 (64) |
TESTS |
27 |
62 |
0 |
|
2200 |
107256327 |
Arceus03 |
D |
Feb. 13, 2021, 5:44 a.m. |
OK |
GNU C++17 (64) |
TESTS |
27 |
62 |
0 |
|
2200 |
107256143 |
LoserOfSWUST |
D |
Feb. 13, 2021, 5:40 a.m. |
OK |
GNU C++17 (64) |
TESTS |
27 |
62 |
0 |
|
2200 |
107241139 |
timreizin |
D |
Feb. 12, 2021, 8:04 p.m. |
OK |
GNU C++17 (64) |
TESTS |
27 |
62 |
0 |
|
2200 |
107256107 |
pohzipohzi |
D |
Feb. 13, 2021, 5:39 a.m. |
OK |
Go |
TESTS |
27 |
78 |
4505600 |
|
2200 |
107231804 |
0x3F |
D |
Feb. 12, 2021, 5:33 p.m. |
OK |
Go |
TESTS |
27 |
124 |
0 |
|
2200 |
107232199 |
0x3F |
D |
Feb. 12, 2021, 5:36 p.m. |
OK |
Go |
TESTS |
27 |
139 |
0 |
|
2200 |
107255658 |
sarthakmanna |
D |
Feb. 13, 2021, 5:30 a.m. |
OK |
Java 11 |
TESTS |
27 |
218 |
0 |
|
2200 |
107245018 |
BlueBirdie |
D |
Feb. 12, 2021, 10:12 p.m. |
OK |
Java 11 |
TESTS |
27 |
234 |
0 |
|
2200 |
107231370 |
nick_301 |
D |
Feb. 12, 2021, 5:29 p.m. |
OK |
Java 11 |
TESTS |
27 |
248 |
0 |
|
2200 |
107238176 |
gssakash |
D |
Feb. 12, 2021, 7 p.m. |
OK |
Java 11 |
TESTS |
27 |
248 |
0 |
|
2200 |
107237318 |
baba_yagga |
D |
Feb. 12, 2021, 6:47 p.m. |
OK |
Java 11 |
TESTS |
27 |
249 |
0 |
|
2200 |
107233705 |
PetrNguyen |
D |
Feb. 12, 2021, 5:52 p.m. |
OK |
Java 11 |
TESTS |
27 |
249 |
0 |
|
2200 |
107225686 |
def_not_alt |
D |
Feb. 12, 2021, 4:41 p.m. |
OK |
Java 11 |
TESTS |
27 |
249 |
0 |
|
2200 |
107225591 |
Apfeloxid |
D |
Feb. 12, 2021, 4:40 p.m. |
OK |
Java 11 |
TESTS |
27 |
249 |
0 |
|
2200 |
107231704 |
Akram-Adel |
D |
Feb. 12, 2021, 5:32 p.m. |
OK |
Java 11 |
TESTS |
27 |
265 |
0 |
|
2200 |
107225455 |
_merlin_ |
D |
Feb. 12, 2021, 4:40 p.m. |
OK |
Java 11 |
TESTS |
27 |
265 |
0 |
|
2200 |
107240901 |
reennn |
D |
Feb. 12, 2021, 7:58 p.m. |
OK |
Java 8 |
TESTS |
27 |
155 |
0 |
|
2200 |
107233765 |
naitikvarshney |
D |
Feb. 12, 2021, 5:52 p.m. |
OK |
Java 8 |
TESTS |
27 |
155 |
0 |
|
2200 |
107242117 |
Snow |
D |
Feb. 12, 2021, 8:29 p.m. |
OK |
Java 8 |
TESTS |
27 |
156 |
0 |
|
2200 |
107237240 |
Whiplash99 |
D |
Feb. 12, 2021, 6:46 p.m. |
OK |
Java 8 |
TESTS |
27 |
156 |
3481600 |
|
2200 |
107223116 |
TheSawan |
D |
Feb. 12, 2021, 4:31 p.m. |
OK |
Java 8 |
TESTS |
27 |
186 |
0 |
|
2200 |
107228793 |
polyakoff |
D |
Feb. 12, 2021, 4:49 p.m. |
OK |
Java 8 |
TESTS |
27 |
186 |
0 |
|
2200 |
107233380 |
Agnimandur |
D |
Feb. 12, 2021, 5:48 p.m. |
OK |
Java 8 |
TESTS |
27 |
187 |
0 |
|
2200 |
107232002 |
martins |
D |
Feb. 12, 2021, 5:34 p.m. |
OK |
Java 8 |
TESTS |
27 |
187 |
3379200 |
|
2200 |
107236816 |
akshaygupta26 |
D |
Feb. 12, 2021, 6:38 p.m. |
OK |
Java 8 |
TESTS |
27 |
187 |
3481600 |
|
2200 |
107250513 |
Extends |
D |
Feb. 13, 2021, 3:03 a.m. |
OK |
Java 8 |
TESTS |
27 |
202 |
0 |
|
2200 |
107248983 |
Spheniscine |
D |
Feb. 13, 2021, 2:02 a.m. |
OK |
Kotlin |
TESTS |
27 |
171 |
1228800 |
|
2200 |
107230160 |
koboshi |
D |
Feb. 12, 2021, 5:21 p.m. |
OK |
Kotlin |
TESTS |
27 |
218 |
5836800 |
|
2200 |
107235325 |
Scotty_pwnz |
D |
Feb. 12, 2021, 6:14 p.m. |
OK |
Kotlin |
TESTS |
27 |
249 |
8908800 |
|
2200 |
107246331 |
koper |
D |
Feb. 12, 2021, 11:26 p.m. |
OK |
Kotlin |
TESTS |
27 |
280 |
10752000 |
|
2200 |
107218795 |
Potassium |
D |
Feb. 12, 2021, 4:13 p.m. |
OK |
Kotlin |
TESTS |
27 |
296 |
409600 |
|
2200 |
107240572 |
P___ |
D |
Feb. 12, 2021, 7:50 p.m. |
OK |
MS C++ 2017 |
TESTS |
27 |
139 |
307200 |
|
2200 |
107225681 |
VClZ |
D |
Feb. 12, 2021, 4:41 p.m. |
OK |
MS C++ 2017 |
TESTS |
27 |
202 |
8192000 |
|
2200 |
107231255 |
jackcaptain |
D |
Feb. 12, 2021, 5:28 p.m. |
OK |
MS C++ 2017 |
TESTS |
27 |
295 |
2048000 |
|
2200 |
107239770 |
getN1ght |
D |
Feb. 12, 2021, 7:31 p.m. |
OK |
MS C++ 2017 |
TESTS |
27 |
296 |
0 |
|
2200 |
107231847 |
jonitox |
D |
Feb. 12, 2021, 5:33 p.m. |
OK |
MS C++ 2017 |
TESTS |
27 |
296 |
1024000 |
|
2200 |
107235601 |
grey |
D |
Feb. 12, 2021, 6:18 p.m. |
OK |
MS C++ 2017 |
TESTS |
27 |
327 |
4403200 |
|
2200 |
107220466 |
terry_u16 |
D |
Feb. 12, 2021, 4:20 p.m. |
OK |
.NET Core C# |
TESTS |
27 |
124 |
6144000 |
|
2200 |
107222599 |
kuuso |
D |
Feb. 12, 2021, 4:29 p.m. |
OK |
.NET Core C# |
TESTS |
27 |
140 |
8396800 |
|
2200 |
107235110 |
rsFalse |
D |
Feb. 12, 2021, 6:11 p.m. |
OK |
Perl |
TESTS |
27 |
156 |
2764800 |
|
2200 |
107240550 |
beethoven97 |
D |
Feb. 12, 2021, 7:49 p.m. |
OK |
PyPy 2 |
TESTS |
27 |
140 |
9932800 |
|
2200 |
107230617 |
shehebe |
D |
Feb. 12, 2021, 5:24 p.m. |
OK |
PyPy 2 |
TESTS |
27 |
171 |
9830400 |
|
2200 |
107246951 |
lebron87 |
D |
Feb. 13, 2021, 12:06 a.m. |
OK |
PyPy 2 |
TESTS |
27 |
264 |
13926400 |
|
2200 |
107226800 |
rishabnahar2025 |
D |
Feb. 12, 2021, 4:44 p.m. |
OK |
PyPy 2 |
TESTS |
27 |
327 |
12390400 |
|
2200 |
107254152 |
not_tehlka |
D |
Feb. 13, 2021, 4:57 a.m. |
OK |
PyPy 3 |
TESTS |
27 |
140 |
8499200 |
|
2200 |
107219343 |
manish.17 |
D |
Feb. 12, 2021, 4:15 p.m. |
OK |
PyPy 3 |
TESTS |
27 |
155 |
8294400 |
|
2200 |
107249145 |
rivnam |
D |
Feb. 13, 2021, 2:09 a.m. |
OK |
PyPy 3 |
TESTS |
27 |
156 |
8499200 |
|
2200 |
107256158 |
feelme |
D |
Feb. 13, 2021, 5:40 a.m. |
OK |
PyPy 3 |
TESTS |
27 |
171 |
8396800 |
|
2200 |
107221155 |
shuyefan |
D |
Feb. 12, 2021, 4:22 p.m. |
OK |
PyPy 3 |
TESTS |
27 |
186 |
10854400 |
|
2200 |
107229965 |
voidf |
D |
Feb. 12, 2021, 5:20 p.m. |
OK |
PyPy 3 |
TESTS |
27 |
233 |
11161600 |
|
2200 |
107229552 |
jimm89 |
D |
Feb. 12, 2021, 5:19 p.m. |
OK |
PyPy 3 |
TESTS |
27 |
249 |
11264000 |
|
2200 |
107247052 |
googol_S0 |
D |
Feb. 13, 2021, 12:13 a.m. |
OK |
PyPy 3 |
TESTS |
27 |
296 |
9420800 |
|
2200 |
107219781 |
VTifand |
D |
Feb. 12, 2021, 4:17 p.m. |
OK |
PyPy 3 |
TESTS |
27 |
311 |
7065600 |
|
2200 |
107229995 |
Satwik_Tiwari |
D |
Feb. 12, 2021, 5:20 p.m. |
OK |
PyPy 3 |
TESTS |
27 |
311 |
16076800 |
|
2200 |
107227631 |
gmunkhbaatarmn |
D |
Feb. 12, 2021, 4:47 p.m. |
OK |
Python 3 |
TESTS |
27 |
311 |
2048000 |
|
2200 |
107226304 |
onepiecehoki |
D |
Feb. 12, 2021, 4:43 p.m. |
OK |
Python 3 |
TESTS |
27 |
327 |
6246400 |
|
2200 |
107255369 |
sh1194 |
D |
Feb. 13, 2021, 5:24 a.m. |
OK |
Python 3 |
TESTS |
27 |
514 |
819200 |
|
2200 |
107245765 |
IngaleAnkur10 |
D |
Feb. 12, 2021, 10:51 p.m. |
OK |
Python 3 |
TESTS |
27 |
514 |
8089600 |
|
2200 |
107234650 |
samyaksrivastava9 |
D |
Feb. 12, 2021, 6:04 p.m. |
OK |
Python 3 |
TESTS |
27 |
529 |
819200 |
|
2200 |
107241425 |
satwiksayan123 |
D |
Feb. 12, 2021, 8:12 p.m. |
OK |
Python 3 |
TESTS |
27 |
670 |
6246400 |
|
2200 |
107220585 |
zheland |
D |
Feb. 12, 2021, 4:20 p.m. |
OK |
Rust |
TESTS |
27 |
46 |
1024000 |
|
2200 |
107224536 |
hiratai |
D |
Feb. 12, 2021, 4:36 p.m. |
OK |
Rust |
TESTS |
27 |
61 |
2457600 |
|
2200 |
remove filters
Back to search problems