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 rectangular grid with n rows and m columns. The cell located on the i -th row from the top and the j -th column from the left has a value a_{ij} written in it. You can perform the following operation any number of times (possibly zero): Note that you can use a cell more than once in different operations. You are interested in X , the sum of all the numbers in the grid. What is the maximum X you can achieve with these operations? 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 , m ( 2 <= n , m <= 10 ). The following n lines contain m integers each, the j -th element in the i -th line is a_{ij} ( -100 <= q a_{ij} <= 100 ). For each testcase, print one integer X , the maximum possible sum of all the values in the grid after applying the operation as many times as you want. In the first test case, there will always be at least one -1 , so the answer is 2 . In the second test case, we can use the operation six times to elements adjacent horizontally and get all numbers to be non-negative. So the answer is: 2 x 1 + 3 x 2 + 3 x 3 + 2 x 4 + 1 x 5 = 30 . '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
98480693 |
tuongvy27082002lqd |
B |
Nov. 15, 2020, 4:09 p.m. |
OK |
FPC |
TESTS |
10 |
30 |
3993600 |
|
|
98518418 |
1v7w |
B |
Nov. 16, 2020, 4:41 a.m. |
OK |
GNU C11 |
TESTS |
10 |
15 |
0 |
|
|
98502520 |
eugalt |
B |
Nov. 15, 2020, 7:29 p.m. |
OK |
GNU C11 |
TESTS |
10 |
15 |
0 |
|
|
98491872 |
syordya |
B |
Nov. 15, 2020, 4:58 p.m. |
OK |
GNU C11 |
TESTS |
10 |
15 |
0 |
|
|
98500093 |
eugalt |
B |
Nov. 15, 2020, 6:44 p.m. |
OK |
GNU C11 |
TESTS |
10 |
30 |
0 |
|
|
98488577 |
timmychiang |
B |
Nov. 15, 2020, 4:43 p.m. |
OK |
GNU C11 |
TESTS |
10 |
30 |
0 |
|
|
98494858 |
snikithasid |
B |
Nov. 15, 2020, 5:39 p.m. |
OK |
GNU C11 |
TESTS |
10 |
31 |
0 |
|
|
98509771 |
allay |
B |
Nov. 15, 2020, 11:18 p.m. |
OK |
GNU C11 |
TESTS |
10 |
31 |
0 |
|
|
98511849 |
liyongle |
B |
Nov. 16, 2020, 12:56 a.m. |
OK |
GNU C++11 |
TESTS |
10 |
15 |
0 |
|
|
98511604 |
LQS |
B |
Nov. 16, 2020, 12:47 a.m. |
OK |
GNU C++11 |
TESTS |
10 |
15 |
0 |
|
|
98510945 |
iwantmytearsback |
B |
Nov. 16, 2020, 12:19 a.m. |
OK |
GNU C++11 |
TESTS |
10 |
15 |
0 |
|
|
98510789 |
loenvom |
B |
Nov. 16, 2020, 12:11 a.m. |
OK |
GNU C++11 |
TESTS |
10 |
15 |
0 |
|
|
98502513 |
BRAINIAC77 |
B |
Nov. 15, 2020, 7:29 p.m. |
OK |
GNU C++11 |
TESTS |
10 |
15 |
0 |
|
|
98484935 |
saiful_alam41 |
B |
Nov. 15, 2020, 4:26 p.m. |
OK |
GNU C++11 |
TESTS |
10 |
15 |
0 |
|
|
98519635 |
cry752264997 |
B |
Nov. 16, 2020, 5:08 a.m. |
OK |
GNU C++11 |
TESTS |
10 |
15 |
0 |
|
|
98518446 |
Jyqjyq1 |
B |
Nov. 16, 2020, 4:42 a.m. |
OK |
GNU C++11 |
TESTS |
10 |
15 |
0 |
|
|
98515330 |
bmosocute |
B |
Nov. 16, 2020, 3:09 a.m. |
OK |
GNU C++11 |
TESTS |
10 |
15 |
0 |
|
|
98514245 |
Spacelessd |
B |
Nov. 16, 2020, 2:34 a.m. |
OK |
GNU C++11 |
TESTS |
10 |
15 |
0 |
|
|
98477819 |
DevangSharma |
B |
Nov. 15, 2020, 3:58 p.m. |
OK |
GNU C++14 |
TESTS |
10 |
15 |
0 |
|
|
98521266 |
sauravkumar_ |
B |
Nov. 16, 2020, 5:44 a.m. |
OK |
GNU C++14 |
TESTS |
10 |
15 |
0 |
|
|
98503196 |
Dweik |
B |
Nov. 15, 2020, 7:43 p.m. |
OK |
GNU C++14 |
TESTS |
10 |
15 |
0 |
|
|
98482043 |
chsanchit |
B |
Nov. 15, 2020, 4:15 p.m. |
OK |
GNU C++14 |
TESTS |
10 |
15 |
0 |
|
|
98481616 |
nonaj |
B |
Nov. 15, 2020, 4:13 p.m. |
OK |
GNU C++14 |
TESTS |
10 |
15 |
0 |
|
|
98505915 |
fair_play |
B |
Nov. 15, 2020, 8:54 p.m. |
OK |
GNU C++14 |
TESTS |
10 |
15 |
0 |
|
|
98490025 |
new_account00 |
B |
Nov. 15, 2020, 4:50 p.m. |
OK |
GNU C++14 |
TESTS |
10 |
15 |
102400 |
|
|
98487765 |
jaippandey |
B |
Nov. 15, 2020, 4:39 p.m. |
OK |
GNU C++14 |
TESTS |
10 |
15 |
8192000 |
|
|
98521661 |
wzyeustia |
B |
Nov. 16, 2020, 5:51 a.m. |
OK |
GNU C++14 |
TESTS |
10 |
30 |
0 |
|
|
98520210 |
TBS_1999 |
B |
Nov. 16, 2020, 5:21 a.m. |
OK |
GNU C++14 |
TESTS |
10 |
30 |
0 |
|
|
98512714 |
Moon_Island |
B |
Nov. 16, 2020, 1:32 a.m. |
OK |
GNU C++17 |
TESTS |
10 |
15 |
0 |
|
|
98520799 |
vin_04 |
B |
Nov. 16, 2020, 5:34 a.m. |
OK |
GNU C++17 |
TESTS |
10 |
15 |
0 |
|
|
98516477 |
shubham7999 |
B |
Nov. 16, 2020, 3:43 a.m. |
OK |
GNU C++17 |
TESTS |
10 |
15 |
0 |
|
|
98515503 |
PaliLo |
B |
Nov. 16, 2020, 3:14 a.m. |
OK |
GNU C++17 |
TESTS |
10 |
15 |
0 |
|
|
98514156 |
Applouz |
B |
Nov. 16, 2020, 2:30 a.m. |
OK |
GNU C++17 |
TESTS |
10 |
15 |
0 |
|
|
98506551 |
Connor07 |
B |
Nov. 15, 2020, 9:14 p.m. |
OK |
GNU C++17 |
TESTS |
10 |
15 |
0 |
|
|
98502692 |
nb_9960 |
B |
Nov. 15, 2020, 7:33 p.m. |
OK |
GNU C++17 |
TESTS |
10 |
15 |
0 |
|
|
98501627 |
ms_anonymous |
B |
Nov. 15, 2020, 7:12 p.m. |
OK |
GNU C++17 |
TESTS |
10 |
15 |
0 |
|
|
98499646 |
Ganesh_aggarwal |
B |
Nov. 15, 2020, 6:37 p.m. |
OK |
GNU C++17 |
TESTS |
10 |
15 |
0 |
|
|
98497876 |
Gestalt_switch |
B |
Nov. 15, 2020, 6:11 p.m. |
OK |
GNU C++17 |
TESTS |
10 |
15 |
0 |
|
|
98507344 |
bindalom |
B |
Nov. 15, 2020, 9:40 p.m. |
OK |
GNU C++17 (64) |
TESTS |
10 |
15 |
0 |
|
|
98504848 |
bashNewbie |
B |
Nov. 15, 2020, 8:24 p.m. |
OK |
GNU C++17 (64) |
TESTS |
10 |
15 |
0 |
|
|
98502817 |
vishnu_sujith_kurup |
B |
Nov. 15, 2020, 7:35 p.m. |
OK |
GNU C++17 (64) |
TESTS |
10 |
15 |
0 |
|
|
98501550 |
over_flow |
B |
Nov. 15, 2020, 7:11 p.m. |
OK |
GNU C++17 (64) |
TESTS |
10 |
15 |
0 |
|
|
98511314 |
AnandOza |
B |
Nov. 16, 2020, 12:35 a.m. |
OK |
GNU C++17 (64) |
TESTS |
10 |
15 |
0 |
|
|
98514029 |
LethalPuppy |
B |
Nov. 16, 2020, 2:26 a.m. |
OK |
GNU C++17 (64) |
TESTS |
10 |
15 |
0 |
|
|
98516982 |
M0riarty |
B |
Nov. 16, 2020, 4:01 a.m. |
OK |
GNU C++17 (64) |
TESTS |
10 |
15 |
0 |
|
|
98517390 |
shyam123 |
B |
Nov. 16, 2020, 4:13 a.m. |
OK |
GNU C++17 (64) |
TESTS |
10 |
15 |
0 |
|
|
98519451 |
emthrm |
B |
Nov. 16, 2020, 5:05 a.m. |
OK |
GNU C++17 (64) |
TESTS |
10 |
15 |
0 |
|
|
98521984 |
alif_cse_ju |
B |
Nov. 16, 2020, 5:58 a.m. |
OK |
GNU C++17 (64) |
TESTS |
10 |
15 |
0 |
|
|
98513894 |
codelegend |
B |
Nov. 16, 2020, 2:21 a.m. |
OK |
Haskell |
TESTS |
10 |
31 |
102400 |
|
|
98505604 |
uc-nuts |
B |
Nov. 15, 2020, 8:45 p.m. |
OK |
Haskell |
TESTS |
10 |
46 |
102400 |
|
|
98498816 |
Mhmmd.itani |
B |
Nov. 15, 2020, 6:24 p.m. |
OK |
Java 11 |
TESTS |
10 |
170 |
0 |
|
|
98515606 |
ms2020 |
B |
Nov. 16, 2020, 3:17 a.m. |
OK |
Java 11 |
TESTS |
10 |
170 |
0 |
|
|
98500036 |
amaansh2398 |
B |
Nov. 15, 2020, 6:43 p.m. |
OK |
Java 11 |
TESTS |
10 |
170 |
0 |
|
|
98496925 |
nick_301 |
B |
Nov. 15, 2020, 5:58 p.m. |
OK |
Java 11 |
TESTS |
10 |
171 |
0 |
|
|
98503593 |
sunnyguan |
B |
Nov. 15, 2020, 7:52 p.m. |
OK |
Java 11 |
TESTS |
10 |
171 |
0 |
|
|
98499226 |
dakshkamboj |
B |
Nov. 15, 2020, 6:31 p.m. |
OK |
Java 11 |
TESTS |
10 |
171 |
0 |
|
|
98508710 |
princewillz2013 |
B |
Nov. 15, 2020, 10:31 p.m. |
OK |
Java 11 |
TESTS |
10 |
186 |
0 |
|
|
98499620 |
skittles1412 |
B |
Nov. 15, 2020, 6:37 p.m. |
OK |
Java 11 |
TESTS |
10 |
186 |
0 |
|
|
98487704 |
gladwin_rojer |
B |
Nov. 15, 2020, 4:39 p.m. |
OK |
Java 11 |
TESTS |
10 |
186 |
0 |
|
|
98521077 |
srijansingh660 |
B |
Nov. 16, 2020, 5:40 a.m. |
OK |
Java 11 |
TESTS |
10 |
186 |
0 |
|
|
98504340 |
overwrite |
B |
Nov. 15, 2020, 8:10 p.m. |
OK |
Java 8 |
TESTS |
10 |
93 |
0 |
|
|
98506494 |
ElectronicsEngineer |
B |
Nov. 15, 2020, 9:12 p.m. |
OK |
Java 8 |
TESTS |
10 |
108 |
0 |
|
|
98499074 |
sumitnitesh123 |
B |
Nov. 15, 2020, 6:28 p.m. |
OK |
Java 8 |
TESTS |
10 |
108 |
0 |
|
|
98487111 |
xXAyushiXx |
B |
Nov. 15, 2020, 4:36 p.m. |
OK |
Java 8 |
TESTS |
10 |
108 |
0 |
|
|
98479306 |
rv6023 |
B |
Nov. 15, 2020, 4:03 p.m. |
OK |
Java 8 |
TESTS |
10 |
109 |
0 |
|
|
98478374 |
ap__singh |
B |
Nov. 15, 2020, 4 p.m. |
OK |
Java 8 |
TESTS |
10 |
109 |
0 |
|
|
98506743 |
rachitpts.2454 |
B |
Nov. 15, 2020, 9:21 p.m. |
OK |
Java 8 |
TESTS |
10 |
109 |
0 |
|
|
98504359 |
RichardBot7000 |
B |
Nov. 15, 2020, 8:10 p.m. |
OK |
Java 8 |
TESTS |
10 |
109 |
0 |
|
|
98503394 |
MrOtter |
B |
Nov. 15, 2020, 7:47 p.m. |
OK |
Java 8 |
TESTS |
10 |
109 |
0 |
|
|
98502780 |
vishu03 |
B |
Nov. 15, 2020, 7:34 p.m. |
OK |
Java 8 |
TESTS |
10 |
124 |
0 |
|
|
98507850 |
koboshi |
B |
Nov. 15, 2020, 9:56 p.m. |
OK |
Kotlin |
TESTS |
10 |
109 |
0 |
|
|
98519569 |
CodingKnight |
B |
Nov. 16, 2020, 5:07 a.m. |
OK |
Kotlin |
TESTS |
10 |
140 |
0 |
|
|
98497175 |
horvat.kamca |
B |
Nov. 15, 2020, 6:01 p.m. |
OK |
Kotlin |
TESTS |
10 |
155 |
102400 |
|
|
98507163 |
koper |
B |
Nov. 15, 2020, 9:33 p.m. |
OK |
Kotlin |
TESTS |
10 |
155 |
1740800 |
|
|
98484036 |
chanter |
B |
Nov. 15, 2020, 4:23 p.m. |
OK |
Kotlin |
TESTS |
10 |
170 |
0 |
|
|
98487884 |
consoleapplication1 |
B |
Nov. 15, 2020, 4:40 p.m. |
OK |
Mono C# |
TESTS |
10 |
62 |
3993600 |
|
|
98479687 |
ravinem1 |
B |
Nov. 15, 2020, 4:05 p.m. |
OK |
Mono C# |
TESTS |
10 |
78 |
3993600 |
|
|
98492249 |
self_develop |
B |
Nov. 15, 2020, 5 p.m. |
OK |
MS C++ |
TESTS |
10 |
15 |
0 |
|
|
98513767 |
winddust |
B |
Nov. 16, 2020, 2:15 a.m. |
OK |
MS C++ |
TESTS |
10 |
31 |
0 |
|
|
98481469 |
tottenham |
B |
Nov. 15, 2020, 4:12 p.m. |
OK |
MS C++ 2017 |
TESTS |
10 |
15 |
0 |
|
|
98493450 |
dmitrySh239 |
B |
Nov. 15, 2020, 5:04 p.m. |
OK |
MS C++ 2017 |
TESTS |
10 |
30 |
0 |
|
|
98483622 |
minigimbob |
B |
Nov. 15, 2020, 4:21 p.m. |
OK |
MS C++ 2017 |
TESTS |
10 |
30 |
0 |
|
|
98488329 |
yaoigod |
B |
Nov. 15, 2020, 4:42 p.m. |
OK |
MS C++ 2017 |
TESTS |
10 |
31 |
0 |
|
|
98521361 |
jkroll87 |
B |
Nov. 16, 2020, 5:46 a.m. |
OK |
MS C++ 2017 |
TESTS |
10 |
31 |
0 |
|
|
98520554 |
jkroll87 |
B |
Nov. 16, 2020, 5:29 a.m. |
OK |
MS C++ 2017 |
TESTS |
10 |
31 |
0 |
|
|
98495840 |
ustaritz |
B |
Nov. 15, 2020, 5:47 p.m. |
OK |
MS C++ 2017 |
TESTS |
10 |
31 |
0 |
|
|
98486724 |
soosungp33 |
B |
Nov. 15, 2020, 4:34 p.m. |
OK |
MS C++ 2017 |
TESTS |
10 |
31 |
0 |
|
|
98478664 |
AstuteJoe |
B |
Nov. 15, 2020, 4:01 p.m. |
OK |
MS C++ 2017 |
TESTS |
10 |
31 |
0 |
|
|
98499068 |
fn-bt |
B |
Nov. 15, 2020, 6:28 p.m. |
OK |
MS C++ 2017 |
TESTS |
10 |
31 |
102400 |
|
|
98489703 |
excdk |
B |
Nov. 15, 2020, 4:48 p.m. |
OK |
.NET Core C# |
TESTS |
10 |
108 |
614400 |
|
|
98505045 |
hxu10 |
B |
Nov. 15, 2020, 8:29 p.m. |
OK |
PyPy 2 |
TESTS |
10 |
124 |
1843200 |
|
|
98498294 |
TheVan |
B |
Nov. 15, 2020, 6:17 p.m. |
OK |
PyPy 3 |
TESTS |
10 |
140 |
1945600 |
|
|
98515661 |
perDAYTwo_A |
B |
Nov. 16, 2020, 3:19 a.m. |
OK |
PyPy 3 |
TESTS |
10 |
155 |
2048000 |
|
|
98515478 |
inkjoy |
B |
Nov. 16, 2020, 3:13 a.m. |
OK |
PyPy 3 |
TESTS |
10 |
155 |
2150400 |
|
|
98504228 |
xodeChemist |
B |
Nov. 15, 2020, 8:07 p.m. |
OK |
PyPy 3 |
TESTS |
10 |
155 |
2252800 |
|
|
98506401 |
yashw_12345 |
B |
Nov. 15, 2020, 9:09 p.m. |
OK |
PyPy 3 |
TESTS |
10 |
155 |
2355200 |
|
|
98512814 |
Coki628 |
B |
Nov. 16, 2020, 1:36 a.m. |
OK |
PyPy 3 |
TESTS |
10 |
155 |
2560000 |
|
|
98503609 |
strivetodeath |
B |
Nov. 15, 2020, 7:52 p.m. |
OK |
PyPy 3 |
TESTS |
10 |
155 |
2662400 |
|
|
98485403 |
bitshifter42 |
B |
Nov. 15, 2020, 4:28 p.m. |
OK |
PyPy 3 |
TESTS |
10 |
156 |
2048000 |
|
|
98515491 |
Sahitya02 |
B |
Nov. 16, 2020, 3:14 a.m. |
OK |
PyPy 3 |
TESTS |
10 |
156 |
2662400 |
|
|
98512788 |
Coki628 |
B |
Nov. 16, 2020, 1:35 a.m. |
OK |
PyPy 3 |
TESTS |
10 |
170 |
2662400 |
|
|
98505129 |
elistark |
B |
Nov. 15, 2020, 8:31 p.m. |
OK |
Python 2 |
TESTS |
10 |
170 |
0 |
|
|
98509278 |
jojogis |
B |
Nov. 15, 2020, 10:54 p.m. |
OK |
Python 3 |
TESTS |
10 |
93 |
307200 |
|
|
98504657 |
rummansadik |
B |
Nov. 15, 2020, 8:18 p.m. |
OK |
Python 3 |
TESTS |
10 |
93 |
307200 |
|
|
98503688 |
eugalt |
B |
Nov. 15, 2020, 7:54 p.m. |
OK |
Python 3 |
TESTS |
10 |
108 |
0 |
|
|
98502441 |
eugalt |
B |
Nov. 15, 2020, 7:28 p.m. |
OK |
Python 3 |
TESTS |
10 |
108 |
0 |
|
|
98495207 |
eugalt |
B |
Nov. 15, 2020, 5:41 p.m. |
OK |
Python 3 |
TESTS |
10 |
108 |
0 |
|
|
98502472 |
_Shashank_ |
B |
Nov. 15, 2020, 7:28 p.m. |
OK |
Python 3 |
TESTS |
10 |
108 |
307200 |
|
|
98498113 |
Wauer |
B |
Nov. 15, 2020, 6:14 p.m. |
OK |
Python 3 |
TESTS |
10 |
108 |
307200 |
|
|
98498082 |
SharmaRaghav |
B |
Nov. 15, 2020, 6:14 p.m. |
OK |
Python 3 |
TESTS |
10 |
108 |
307200 |
|
|
98484292 |
aashitdua |
B |
Nov. 15, 2020, 4:24 p.m. |
OK |
Python 3 |
TESTS |
10 |
108 |
307200 |
|
|
98503320 |
eugalt |
B |
Nov. 15, 2020, 7:46 p.m. |
OK |
Python 3 |
TESTS |
10 |
108 |
2355200 |
|
|
98498052 |
Paranid5 |
B |
Nov. 15, 2020, 6:13 p.m. |
OK |
Rust |
TESTS |
10 |
46 |
0 |
|
|
remove filters
Back to search problems