Codeforces Round 642 (Div. 3)

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
1353 Codeforces Round 642 (Div. 3) FINISHED False 7200 142356299 May 14, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3360 ) F Decreasing Heights PROGRAMMING brute force dp 2200

B'You are playing one famous sandbox game with the three-dimensional world. The map of the world can be represented as a matrix of size n x m , where the height of the cell (i, j) is a_{i, j} . You are in the cell (1, 1) right now and want to get in the cell (n, m) . You can move only down (from the cell (i, j) to the cell (i + 1, j) ) or right (from the cell (i, j) to the cell (i, j + 1) ). There is an additional restriction: if the height of the current cell is x then you can move only to the cell with height x+1 . Before the first move you can perform several operations. During one operation, you can decrease the height of any cell by one. I.e. you choose some cell (i, j) and assign (set) a_{i, j} := a_{i, j} - 1 . Note that you can make heights less than or equal to zero. Also note that you can decrease the height of the cell (1, 1) . Your task is to find the minimum number of operations you have to perform to obtain at least one suitable path from the cell (1, 1) to the cell (n, m) . It is guaranteed that the answer exists. You have to answer t independent test cases. The first line of the input contains one integer t ( 1 <= t <= 100 ) -- the number of test cases. Then t test cases follow. The first line of the test case contains two integers n and m ( 1 <= n, m <= 100 ) -- the number of rows and the number of columns in the map of the world. The next n lines contain m integers each, where the j -th integer in the i -th line is a_{i, j} ( 1 <= a_{i, j} <= 10^{15} ) -- the height of the cell (i, j) . It is guaranteed that the sum of n (as well as the sum of m ) over all test cases does not exceed 100 ( sum n <= 100; sum m <= 100 ). For each test case, print the answer -- the minimum number of operations you have to perform to obtain at least one suitable p'...

Tutorials

Codeforces Round #642 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
80162069 ruban F May 14, 2020, 5:38 p.m. OK Delphi TESTS 48 1653 23040000 2200
80878884 Frankensten F May 21, 2020, 6:10 p.m. OK GNU C11 TESTS 49 592 614400 2200
80169182 rainboy F May 14, 2020, 7:14 p.m. OK GNU C11 TESTS 48 607 4096000 2200
80191720 rajatnagar F May 15, 2020, 4:56 a.m. OK GNU C11 TESTS 48 608 3891200 2200
80878773 Frankensten F May 21, 2020, 6:08 p.m. OK GNU C11 TESTS 49 655 614400 2200
80197654 wangxy F May 15, 2020, 6:42 a.m. OK GNU C++11 TESTS 48 78 4403200 2200
80161777 ajpiano F May 14, 2020, 5:35 p.m. OK GNU C++11 TESTS 48 171 4096000 2200
81352025 luogu_bot3 F May 25, 2020, 6:06 a.m. OK GNU C++11 TESTS 49 265 409600 2200
80785724 RogueNinja F May 20, 2020, 3:28 p.m. OK GNU C++11 TESTS 49 296 307200 2200
80197860 WaAccept F May 15, 2020, 6:45 a.m. OK GNU C++11 TESTS 48 343 4096000 2200
80157859 4790iop F May 14, 2020, 4:56 p.m. OK GNU C++11 TESTS 48 343 4300800 2200
80803209 Kart F May 20, 2020, 7:35 p.m. OK GNU C++11 TESTS 49 390 204800 2200
80154197 aspirine F May 14, 2020, 4:34 p.m. OK GNU C++11 TESTS 48 390 4300800 2200
80656820 100Coke F May 19, 2020, 5:34 a.m. OK GNU C++11 TESTS 49 421 204800 2200
80272426 Onward F May 16, 2020, 2:26 a.m. OK GNU C++11 TESTS 49 421 4096000 2200
80197706 whitesir F May 15, 2020, 6:43 a.m. OK GNU C++14 TESTS 48 77 4300800 2200
80218636 anubhavp F May 15, 2020, 11:16 a.m. OK GNU C++14 TESTS 48 296 3891200 2200
80815270 vjudge4 F May 21, 2020, 2:23 a.m. OK GNU C++14 TESTS 49 373 409600 2200
80583699 nitvjudge3 F May 18, 2020, 8:33 a.m. OK GNU C++14 TESTS 49 374 3891200 2200
80583620 213ddi F May 18, 2020, 8:32 a.m. OK GNU C++14 TESTS 49 374 3891200 2200
80170663 lsantire F May 14, 2020, 7:39 p.m. OK GNU C++14 TESTS 48 389 4096000 2200
80255387 kinaman F May 15, 2020, 6:46 p.m. OK GNU C++14 TESTS 49 390 3993600 2200
80629706 Rogue33 F May 18, 2020, 6:03 p.m. OK GNU C++14 TESTS 49 436 614400 2200
80697395 SRIKANTH F May 19, 2020, 2:24 p.m. OK GNU C++14 TESTS 49 436 716800 2200
80246871 kp_26 F May 15, 2020, 4:54 p.m. OK GNU C++14 TESTS 49 436 3891200 2200
80876511 pootis F May 21, 2020, 5:35 p.m. OK GNU C++17 TESTS 49 140 1024000 2200
80277328 jkxjkx1031 F May 16, 2020, 4:27 a.m. OK GNU C++17 TESTS 49 234 3993600 2200
81609956 fausturs F May 27, 2020, 11:04 a.m. OK GNU C++17 TESTS 49 249 409600 2200
80181909 janwei F May 15, 2020, 12:50 a.m. OK GNU C++17 TESTS 48 280 4198400 2200
80877712 pootis F May 21, 2020, 5:53 p.m. OK GNU C++17 TESTS 49 295 1024000 2200
80158851 freyes F May 14, 2020, 5:05 p.m. OK GNU C++17 TESTS 48 296 3993600 2200
80151583 lucasturci F May 14, 2020, 4:29 p.m. OK GNU C++17 TESTS 48 296 4096000 2200
80157025 beast_sl F May 14, 2020, 4:50 p.m. OK GNU C++17 TESTS 48 296 4198400 2200
80237933 wery0 F May 15, 2020, 3:05 p.m. OK GNU C++17 TESTS 48 296 4198400 2200
81345803 yplusplusplus F May 25, 2020, 4:19 a.m. OK GNU C++17 TESTS 49 311 204800 2200
80158700 Nson F May 14, 2020, 5:04 p.m. OK GNU C++17 (64) TESTS 48 78 23961600 2200
80158103 Nson F May 14, 2020, 4:59 p.m. OK GNU C++17 (64) TESTS 48 78 23961600 2200
81388924 besieger F May 25, 2020, 1:47 p.m. OK GNU C++17 (64) TESTS 49 93 204800 2200
81387569 besieger F May 25, 2020, 1:31 p.m. OK GNU C++17 (64) TESTS 49 93 204800 2200
80239064 I_love_chickpea F May 15, 2020, 3:18 p.m. OK GNU C++17 (64) TESTS 48 109 4710400 2200
80535576 kvutxdy F May 17, 2020, 3:51 p.m. OK GNU C++17 (64) TESTS 49 155 4505600 2200
81014894 stArliGht F May 23, 2020, 12:39 p.m. OK GNU C++17 (64) TESTS 49 156 307200 2200
80159501 ScarletS F May 14, 2020, 5:11 p.m. OK GNU C++17 (64) TESTS 48 187 4505600 2200
80422165 Falcon__ F May 17, 2020, 12:30 a.m. OK GNU C++17 (64) TESTS 49 218 4505600 2200
80187892 x20 F May 15, 2020, 3:36 a.m. OK GNU C++17 (64) TESTS 48 233 4505600 2200
80161349 synapse F May 14, 2020, 5:31 p.m. OK Go TESTS 48 1684 16179200 2200
81351351 bobib F May 25, 2020, 5:57 a.m. OK Java 11 TESTS 49 857 0 2200
80209229 anhpp F May 15, 2020, 9:22 a.m. OK Java 11 TESTS 48 858 24064000 2200
80169706 byorgey F May 14, 2020, 7:23 p.m. OK Java 11 TESTS 48 997 23859200 2200
80213641 anhtaihsgs F May 15, 2020, 10:18 a.m. OK Java 11 TESTS 48 1107 24064000 2200
80176129 egaeus.code F May 14, 2020, 9:31 p.m. OK Java 11 TESTS 48 1279 23859200 2200
80268336 egaeus.code F May 15, 2020, 11:46 p.m. OK Java 11 TESTS 49 1279 23961600 2200
80209733 CodAR F May 15, 2020, 9:29 a.m. OK Java 11 TESTS 48 1279 24064000 2200
80209622 NayaWala F May 15, 2020, 9:28 a.m. OK Java 11 TESTS 48 1279 24064000 2200
80279980 SCXQSNLZHC F May 16, 2020, 5:14 a.m. OK Java 11 TESTS 49 1294 24473600 2200
80233571 TheSawan F May 15, 2020, 2:13 p.m. OK Java 11 TESTS 48 1325 24064000 2200
80714105 yaoct F May 19, 2020, 5:35 p.m. OK Java 8 TESTS 49 670 0 2200
80622570 an09mous F May 18, 2020, 4:28 p.m. OK Java 8 TESTS 49 732 0 2200
80160209 golions F May 14, 2020, 5:18 p.m. OK Java 8 TESTS 48 826 40038400 2200
80264066 NatInTheHat F May 15, 2020, 9:25 p.m. OK Java 8 TESTS 49 935 21196800 2200
80439713 aranjuda F May 17, 2020, 6:33 a.m. OK Java 8 TESTS 49 1107 20684800 2200
80207363 aman28rwt F May 15, 2020, 8:59 a.m. OK Java 8 TESTS 48 1122 21196800 2200
80207206 aman28rwt F May 15, 2020, 8:57 a.m. OK Java 8 TESTS 48 1123 21196800 2200
80212764 Samez F May 15, 2020, 10:07 a.m. OK Java 8 TESTS 48 1138 20582400 2200
80207053 aman28rwt F May 15, 2020, 8:55 a.m. OK Java 8 TESTS 48 1138 21299200 2200
80255196 anupamm98 F May 15, 2020, 6:44 p.m. OK Java 8 TESTS 49 1153 20582400 2200
80276882 Spheniscine F May 16, 2020, 4:19 a.m. OK Kotlin TESTS 49 1013 22937600 2200
80277065 Spheniscine F May 16, 2020, 4:22 a.m. OK Kotlin TESTS 49 1013 23040000 2200
80277046 Spheniscine F May 16, 2020, 4:21 a.m. OK Kotlin TESTS 49 1014 23040000 2200
80195242 Spheniscine F May 15, 2020, 6:07 a.m. OK Kotlin TESTS 48 1294 22835200 2200
81004172 MadMax F May 23, 2020, 10:12 a.m. OK Kotlin TESTS 49 1341 0 2200
80165027 r57shell F May 14, 2020, 6:15 p.m. OK MS C++ TESTS 48 234 4505600 2200
80174342 r57shell F May 14, 2020, 8:49 p.m. OK MS C++ TESTS 48 265 4300800 2200
80165280 r57shell F May 14, 2020, 6:18 p.m. OK MS C++ TESTS 48 295 4300800 2200
80240338 vjudge1 F May 15, 2020, 3:32 p.m. OK MS C++ 2017 TESTS 48 608 3891200 2200
80737355 Najmus_Sakib_Rashid F May 20, 2020, 3:20 a.m. OK MS C++ 2017 TESTS 49 655 512000 2200
80309622 0Mordecai0 F May 16, 2020, 11:30 a.m. OK MS C++ 2017 TESTS 49 733 3891200 2200
80989731 kapil16garg F May 23, 2020, 6:35 a.m. OK MS C++ 2017 TESTS 49 857 204800 2200
80968965 kapil16garg F May 22, 2020, 8:34 p.m. OK MS C++ 2017 TESTS 49 858 409600 2200
80181239 Bediver F May 15, 2020, 12:28 a.m. OK MS C++ 2017 TESTS 48 889 4198400 2200
80181261 Bediver F May 15, 2020, 12:29 a.m. OK MS C++ 2017 TESTS 48 904 3891200 2200
80206636 reikiriyama F May 15, 2020, 8:49 a.m. OK MS C++ 2017 TESTS 48 935 3891200 2200
80292714 hwqconceptnick F May 16, 2020, 8:04 a.m. OK MS C++ 2017 TESTS 49 936 3891200 2200
80257673 pajenegod F May 15, 2020, 7:19 p.m. OK PyPy 2 TESTS 49 1029 30617600 2200
80544471 pajenegod F May 17, 2020, 5:55 p.m. OK PyPy 2 TESTS 49 1216 31232000 2200
80258190 pajenegod F May 15, 2020, 7:26 p.m. OK PyPy 2 TESTS 49 1216 31232000 2200
80548132 pajenegod F May 17, 2020, 6:51 p.m. OK PyPy 2 TESTS 49 1231 31232000 2200
80258115 pajenegod F May 15, 2020, 7:25 p.m. OK PyPy 2 TESTS 49 1232 31232000 2200
80230674 pajenegod F May 15, 2020, 1:40 p.m. OK PyPy 2 TESTS 48 1279 30822400 2200
80230822 pajenegod F May 15, 2020, 1:42 p.m. OK PyPy 2 TESTS 48 1294 30924800 2200
80231865 pajenegod F May 15, 2020, 1:54 p.m. OK PyPy 2 TESTS 48 1310 30208000 2200
80231544 pajenegod F May 15, 2020, 1:50 p.m. OK PyPy 2 TESTS 48 1310 30412800 2200
80230579 pajenegod F May 15, 2020, 1:38 p.m. OK PyPy 2 TESTS 48 1310 30822400 2200
81428540 gintoki_s F May 26, 2020, 1:27 a.m. OK PyPy 3 TESTS 49 1777 28672000 2200
80161431 keep__calm F May 14, 2020, 5:32 p.m. OK PyPy 3 TESTS 48 1824 47820800 2200
80161528 keep__calm F May 14, 2020, 5:33 p.m. OK PyPy 3 TESTS 48 1840 48128000 2200
80201283 keep__calm F May 15, 2020, 7:34 a.m. OK PyPy 3 TESTS 48 1840 49868800 2200
80161473 keep__calm F May 14, 2020, 5:32 p.m. OK PyPy 3 TESTS 48 1856 47923200 2200
80165194 keep__calm F May 14, 2020, 6:17 p.m. OK PyPy 3 TESTS 48 1856 49049600 2200
80161264 keep__calm F May 14, 2020, 5:30 p.m. OK PyPy 3 TESTS 48 1887 50278400 2200
80172752 keep__calm F May 14, 2020, 8:17 p.m. OK PyPy 3 TESTS 48 2121 29900800 2200
80184659 sansen F May 15, 2020, 2:20 a.m. OK Rust TESTS 48 748 4505600 2200
81420024 pandrei F May 25, 2020, 8:25 p.m. OK Rust TESTS 49 857 409600 2200
80887270 garciparedes F May 21, 2020, 8:39 p.m. OK Rust TESTS 49 1107 307200 2200
80184911 sansen F May 15, 2020, 2:28 a.m. OK Rust TESTS 48 1170 4300800 2200

remove filters

Back to search problems