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 |
---|---|---|---|---|---|---|
1375 | Codeforces Global Round 9 | FINISHED | False | 9000 | 143478911 | July 4, 2020, 2:45 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 17377 ) | B | Neighbor Grid | PROGRAMMING | constructive algorithms greedy |
B'You are given a grid with n rows and m columns, where each cell has a non-negative integer written on it. We say the grid is good if for each cell the following condition holds: if it has a number k > 0 written on it, then exactly k of its neighboring cells have a number greater than 0 written on them. Note that if the number in the cell is 0 , there is no such restriction on neighboring cells. You are allowed to take any number in the grid and increase it by 1 . You may apply this operation as many times as you want, to any numbers you want. Perform some operations (possibly zero) to make the grid good, or say that it is impossible. If there are multiple possible answers, you may find any of them. Two cells are considered to be neighboring if they have a common edge. The input consists of multiple test cases. The first line contains an integer t ( 1 <= t <= 5000 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains two integers n and m ( 2 <= n, m <= 300 ) -- the number of rows and columns, respectively. The following n lines contain m integers each, the j -th element in the i -th line a_{i, j} is the number written in the j -th cell of the i -th row ( 0 <= a_{i, j} <= 10^9 ). It is guaranteed that the sum of n cdot m over all test cases does not exceed 10^5 . If it is impossible to obtain a good grid, print a single line containing "NO". Otherwise, print a single line containing "YES", followed by n lines each containing m integers, which describe the final state of the grid. This final grid should be obtainable from the initial one by applying some operations (possibly zero). If there are multiple possible answers, you may print any of them. In the first test case, we can obtain the resulting grid by increasing the number in row 2 , column 3$$'... |
79731 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
86021413 | fpc_coder | B | July 5, 2020, 3:50 a.m. | OK | FPC | TESTS | 21 | 420 | 3788800 | ||
85975915 | RaviVK | B | July 4, 2020, 4:14 p.m. | OK | GNU C11 | TESTS | 21 | 483 | 3686400 | ||
85964280 | Asib27 | B | July 4, 2020, 3:44 p.m. | OK | GNU C11 | TESTS | 21 | 483 | 3993600 | ||
85957712 | anujsinghal | B | July 4, 2020, 3:30 p.m. | OK | GNU C11 | TESTS | 21 | 483 | 4403200 | ||
85993753 | SimpleCramp | B | July 4, 2020, 5:07 p.m. | OK | GNU C11 | TESTS | 21 | 483 | 4710400 | ||
85983327 | akash456 | B | July 4, 2020, 4:37 p.m. | OK | GNU C11 | TESTS | 21 | 498 | 3686400 | ||
85963709 | PARTHA_04 | B | July 4, 2020, 3:43 p.m. | OK | GNU C11 | TESTS | 21 | 499 | 4710400 | ||
85979398 | Israt_Jahan_Nahin | B | July 4, 2020, 4:25 p.m. | OK | GNU C11 | TESTS | 21 | 514 | 3686400 | ||
85969388 | VILLAIN18 | B | July 4, 2020, 3:57 p.m. | OK | GNU C11 | TESTS | 21 | 514 | 3993600 | ||
85975536 | SUNNY24 | B | July 4, 2020, 4:13 p.m. | OK | GNU C11 | TESTS | 21 | 514 | 4096000 | ||
85980072 | mrashid_5919 | B | July 4, 2020, 4:27 p.m. | OK | GNU C11 | TESTS | 21 | 514 | 4710400 | ||
86026186 | fujian | B | July 5, 2020, 5:39 a.m. | OK | GNU C++11 | TESTS | 21 | 30 | 4608000 | ||
86017885 | DWAE86 | B | July 5, 2020, 2:03 a.m. | OK | GNU C++11 | TESTS | 21 | 31 | 4300800 | ||
85977554 | laugher | B | July 4, 2020, 4:19 p.m. | OK | GNU C++11 | TESTS | 21 | 31 | 4300800 | ||
85959955 | _cbio_ | B | July 4, 2020, 3:35 p.m. | OK | GNU C++11 | TESTS | 21 | 31 | 4505600 | ||
85973417 | xin_chen | B | July 4, 2020, 4:07 p.m. | OK | GNU C++11 | TESTS | 21 | 31 | 4812800 | ||
85960662 | Skypower | B | July 4, 2020, 3:36 p.m. | OK | GNU C++11 | TESTS | 21 | 31 | 6144000 | ||
86017128 | shengzihang | B | July 5, 2020, 1:31 a.m. | OK | GNU C++11 | TESTS | 21 | 31 | 76800000 | ||
86022178 | SOSCHINA | B | July 5, 2020, 4:10 a.m. | OK | GNU C++11 | TESTS | 21 | 46 | 3686400 | ||
86003995 | sogrub | B | July 4, 2020, 6:44 p.m. | OK | GNU C++11 | TESTS | 21 | 46 | 3891200 | ||
86018997 | woriazzc | B | July 5, 2020, 2:41 a.m. | OK | GNU C++11 | TESTS | 21 | 46 | 4096000 | ||
86004284 | vishnu_m | B | July 4, 2020, 6:48 p.m. | OK | GNU C++14 | TESTS | 21 | 31 | 4096000 | ||
86001358 | archangel12 | B | July 4, 2020, 6:09 p.m. | OK | GNU C++14 | TESTS | 21 | 46 | 3686400 | ||
85983263 | ace789 | B | July 4, 2020, 4:36 p.m. | OK | GNU C++14 | TESTS | 21 | 46 | 3686400 | ||
85976796 | macrony | B | July 4, 2020, 4:17 p.m. | OK | GNU C++14 | TESTS | 21 | 46 | 3686400 | ||
86001708 | Yash_Sharma8415 | B | July 4, 2020, 6:13 p.m. | OK | GNU C++14 | TESTS | 21 | 46 | 3686400 | ||
86007540 | vampire4u | B | July 4, 2020, 7:45 p.m. | OK | GNU C++14 | TESTS | 21 | 46 | 3686400 | ||
86013002 | ahcaira | B | July 4, 2020, 10:14 p.m. | OK | GNU C++14 | TESTS | 21 | 46 | 3686400 | ||
86017647 | Priyank | B | July 5, 2020, 1:54 a.m. | OK | GNU C++14 | TESTS | 21 | 46 | 3686400 | ||
86026628 | detergent | B | July 5, 2020, 5:47 a.m. | OK | GNU C++14 | TESTS | 21 | 46 | 3788800 | ||
86007628 | Timer_011 | B | July 4, 2020, 7:47 p.m. | OK | GNU C++14 | TESTS | 21 | 46 | 3788800 | ||
85986630 | 60D9 | B | July 4, 2020, 4:47 p.m. | OK | GNU C++17 | TESTS | 21 | 46 | 3686400 | ||
86005761 | nor | B | July 4, 2020, 7:14 p.m. | OK | GNU C++17 | TESTS | 21 | 46 | 3686400 | ||
85965563 | 0Kushagra0 | B | July 4, 2020, 3:47 p.m. | OK | GNU C++17 | TESTS | 21 | 46 | 3686400 | ||
85968637 | avi_dak_hyd | B | July 4, 2020, 3:55 p.m. | OK | GNU C++17 | TESTS | 21 | 46 | 3686400 | ||
85959257 | shirshbansal | B | July 4, 2020, 3:33 p.m. | OK | GNU C++17 | TESTS | 21 | 46 | 3686400 | ||
85964365 | Polaris_CodeForce | B | July 4, 2020, 3:45 p.m. | OK | GNU C++17 | TESTS | 21 | 46 | 3686400 | ||
85958442 | fake_name | B | July 4, 2020, 3:32 p.m. | OK | GNU C++17 | TESTS | 21 | 46 | 3686400 | ||
86014486 | __rand__ | B | July 4, 2020, 11:18 p.m. | OK | GNU C++17 | TESTS | 21 | 46 | 3788800 | ||
86013495 | skylinebaby | B | July 4, 2020, 10:34 p.m. | OK | GNU C++17 | TESTS | 21 | 46 | 3788800 | ||
86013939 | liveoverflow | B | July 4, 2020, 10:53 p.m. | OK | GNU C++17 | TESTS | 21 | 46 | 3788800 | ||
85967940 | naman19vyas | B | July 4, 2020, 3:53 p.m. | OK | GNU C++17 (64) | TESTS | 21 | 31 | 4403200 | ||
86015404 | 19992147 | B | July 5, 2020, 12:06 a.m. | OK | GNU C++17 (64) | TESTS | 21 | 31 | 4505600 | ||
86026051 | aryanc403 | B | July 5, 2020, 5:37 a.m. | OK | GNU C++17 (64) | TESTS | 21 | 31 | 5120000 | ||
86022207 | m.hasan01 | B | July 5, 2020, 4:11 a.m. | OK | GNU C++17 (64) | TESTS | 21 | 31 | 5324800 | ||
86025295 | Sakhiya07 | B | July 5, 2020, 5:22 a.m. | OK | GNU C++17 (64) | TESTS | 21 | 31 | 5734400 | ||
86006875 | 3BS_AS | B | July 4, 2020, 7:33 p.m. | OK | GNU C++17 (64) | TESTS | 21 | 46 | 4300800 | ||
85958621 | meteorexx | B | July 4, 2020, 3:32 p.m. | OK | GNU C++17 (64) | TESTS | 21 | 46 | 4300800 | ||
85963474 | killer4639 | B | July 4, 2020, 3:43 p.m. | OK | GNU C++17 (64) | TESTS | 21 | 46 | 4300800 | ||
85963692 | Alexfj08 | B | July 4, 2020, 3:43 p.m. | OK | GNU C++17 (64) | TESTS | 21 | 46 | 4300800 | ||
85967034 | digitcrusher | B | July 4, 2020, 3:51 p.m. | OK | GNU C++17 (64) | TESTS | 21 | 46 | 4300800 | ||
85964157 | Aidar.Babanov | B | July 4, 2020, 3:44 p.m. | OK | Go | TESTS | 21 | 530 | 10649600 | ||
85958577 | avijit_agarwal | B | July 4, 2020, 3:32 p.m. | OK | Java 11 | TESTS | 21 | 187 | 23756800 | ||
85965991 | saikaushik | B | July 4, 2020, 3:48 p.m. | OK | Java 11 | TESTS | 21 | 202 | 23859200 | ||
85958003 | amit_chas | B | July 4, 2020, 3:31 p.m. | OK | Java 11 | TESTS | 21 | 202 | 23859200 | ||
85957940 | Apass.Jack | B | July 4, 2020, 3:30 p.m. | OK | Java 11 | TESTS | 21 | 202 | 23859200 | ||
86005176 | In_The_Name_Of_Love | B | July 4, 2020, 7:03 p.m. | OK | Java 11 | TESTS | 21 | 202 | 23961600 | ||
85962139 | vishesh1999gupta | B | July 4, 2020, 3:40 p.m. | OK | Java 11 | TESTS | 21 | 202 | 23961600 | ||
86022480 | decoder_1671 | B | July 5, 2020, 4:20 a.m. | OK | Java 11 | TESTS | 21 | 202 | 24064000 | ||
86000671 | skittles1412 | B | July 4, 2020, 6:02 p.m. | OK | Java 11 | TESTS | 21 | 217 | 23756800 | ||
86015306 | bubbl | B | July 5, 2020, midnight | OK | Java 11 | TESTS | 21 | 217 | 23961600 | ||
86001149 | singhdhanwant | B | July 4, 2020, 6:07 p.m. | OK | Java 11 | TESTS | 21 | 217 | 24166400 | ||
86014965 | shivamnarware | B | July 4, 2020, 11:41 p.m. | OK | Java 8 | TESTS | 21 | 124 | 20480000 | ||
86011880 | bluesky111 | B | July 4, 2020, 9:35 p.m. | OK | Java 8 | TESTS | 21 | 124 | 20480000 | ||
86008939 | new_thread | B | July 4, 2020, 8:14 p.m. | OK | Java 8 | TESTS | 21 | 124 | 20480000 | ||
85976981 | Pranay2516 | B | July 4, 2020, 4:18 p.m. | OK | Java 8 | TESTS | 21 | 124 | 20480000 | ||
86014831 | ijxjdjd | B | July 4, 2020, 11:35 p.m. | OK | Java 8 | TESTS | 21 | 124 | 20582400 | ||
86010579 | TriumphantEggplant | B | July 4, 2020, 8:54 p.m. | OK | Java 8 | TESTS | 21 | 124 | 20582400 | ||
85986529 | Bhavya_Arora | B | July 4, 2020, 4:46 p.m. | OK | Java 8 | TESTS | 21 | 124 | 20582400 | ||
85982802 | rishabh99 | B | July 4, 2020, 4:35 p.m. | OK | Java 8 | TESTS | 21 | 124 | 20582400 | ||
85973950 | harsh1334 | B | July 4, 2020, 4:09 p.m. | OK | Java 8 | TESTS | 21 | 124 | 20684800 | ||
85987604 | internship_dilado | B | July 4, 2020, 4:50 p.m. | OK | Java 8 | TESTS | 21 | 124 | 20787200 | ||
86015960 | Spheniscine | B | July 5, 2020, 12:33 a.m. | OK | Kotlin | TESTS | 21 | 155 | 22323200 | ||
86015798 | Spheniscine | B | July 5, 2020, 12:26 a.m. | OK | Kotlin | TESTS | 21 | 171 | 22323200 | ||
85974875 | slemus | B | July 4, 2020, 4:11 p.m. | OK | Kotlin | TESTS | 21 | 468 | 21708800 | ||
85983659 | Glamdring | B | July 4, 2020, 4:38 p.m. | OK | Kotlin | TESTS | 21 | 498 | 21708800 | ||
85973299 | agent-10 | B | July 4, 2020, 4:07 p.m. | OK | Kotlin | TESTS | 21 | 514 | 21708800 | ||
86026116 | treasuryonly | B | July 5, 2020, 5:38 a.m. | OK | Mono C# | TESTS | 21 | 93 | 13004800 | ||
85991785 | Myeongjoon | B | July 4, 2020, 5:02 p.m. | OK | Mono C# | TESTS | 21 | 218 | 11776000 | ||
85971308 | faxse | B | July 4, 2020, 4:02 p.m. | OK | Mono C# | TESTS | 21 | 264 | 19456000 | ||
85976784 | mustafa7 | B | July 4, 2020, 4:17 p.m. | OK | Mono C# | TESTS | 21 | 483 | 11673600 | ||
85971036 | hedgedog | B | July 4, 2020, 4:01 p.m. | OK | Mono C# | TESTS | 21 | 483 | 15257600 | ||
85967616 | Backs | B | July 4, 2020, 3:52 p.m. | OK | Mono C# | TESTS | 21 | 514 | 31948800 | ||
85987307 | mbakalov | B | July 4, 2020, 4:49 p.m. | OK | Mono C# | TESTS | 21 | 608 | 11673600 | ||
86024547 | sudarshan333u | B | July 5, 2020, 5:07 a.m. | OK | MS C++ | TESTS | 21 | 109 | 4300800 | ||
85984236 | tarattata1 | B | July 4, 2020, 4:39 p.m. | OK | MS C++ 2017 | TESTS | 21 | 61 | 4505600 | ||
85969011 | scka | B | July 4, 2020, 3:56 p.m. | OK | MS C++ 2017 | TESTS | 21 | 62 | 4096000 | ||
85971202 | hwqconceptnick | B | July 4, 2020, 4:02 p.m. | OK | MS C++ 2017 | TESTS | 21 | 62 | 4505600 | ||
86012332 | P___ | B | July 4, 2020, 9:49 p.m. | OK | MS C++ 2017 | TESTS | 21 | 62 | 4505600 | ||
86017437 | Cube219 | B | July 5, 2020, 1:45 a.m. | OK | MS C++ 2017 | TESTS | 21 | 62 | 4710400 | ||
85968016 | BingHui | B | July 4, 2020, 3:53 p.m. | OK | MS C++ 2017 | TESTS | 21 | 62 | 5017600 | ||
85984656 | Egoryu | B | July 4, 2020, 4:41 p.m. | OK | MS C++ 2017 | TESTS | 21 | 77 | 4096000 | ||
85993890 | Momosama | B | July 4, 2020, 5:08 p.m. | OK | MS C++ 2017 | TESTS | 21 | 109 | 4096000 | ||
86014855 | gbanuel3 | B | July 4, 2020, 11:36 p.m. | OK | MS C++ 2017 | TESTS | 21 | 109 | 4403200 | ||
86025357 | skymin | B | July 5, 2020, 5:23 a.m. | OK | MS C++ 2017 | TESTS | 21 | 109 | 4505600 | ||
86002170 | raj1307 | B | July 4, 2020, 6:18 p.m. | OK | PyPy 2 | TESTS | 21 | 187 | 29184000 | ||
85982101 | Mukundan314 | B | July 4, 2020, 4:33 p.m. | OK | PyPy 2 | TESTS | 21 | 217 | 28467200 | ||
85957196 | _aLso | B | July 4, 2020, 3:29 p.m. | OK | PyPy 2 | TESTS | 21 | 233 | 31436800 | ||
85974371 | mo-hit | B | July 4, 2020, 4:10 p.m. | OK | PyPy 2 | TESTS | 21 | 296 | 35532800 | ||
85967333 | Satwik_Tiwari | B | July 4, 2020, 3:51 p.m. | OK | PyPy 2 | TESTS | 21 | 311 | 31436800 | ||
85971535 | lebron87 | B | July 4, 2020, 4:03 p.m. | OK | PyPy 2 | TESTS | 21 | 982 | 31334400 | ||
85976657 | gintoki_s | B | July 4, 2020, 4:17 p.m. | OK | PyPy 3 | TESTS | 21 | 248 | 25497600 | ||
86020798 | neterukun | B | July 5, 2020, 3:31 a.m. | OK | PyPy 3 | TESTS | 21 | 280 | 29696000 | ||
85968077 | kcdchopin | B | July 4, 2020, 3:53 p.m. | OK | PyPy 3 | TESTS | 21 | 295 | 27750400 | ||
86024265 | 2019ucp1350 | B | July 5, 2020, 5:01 a.m. | OK | PyPy 3 | TESTS | 21 | 296 | 29900800 | ||
86014542 | thekushalghosh | B | July 4, 2020, 11:21 p.m. | OK | PyPy 3 | TESTS | 21 | 311 | 29900800 | ||
85957530 | goldang | B | July 4, 2020, 3:30 p.m. | OK | PyPy 3 | TESTS | 21 | 311 | 29900800 | ||
85970578 | YMSeah | B | July 4, 2020, 4 p.m. | OK | PyPy 3 | TESTS | 21 | 312 | 29388800 | ||
86008661 | Blue_Gene | B | July 4, 2020, 8:08 p.m. | OK | PyPy 3 | TESTS | 21 | 312 | 29593600 | ||
86001609 | dcshin | B | July 4, 2020, 6:12 p.m. | OK | PyPy 3 | TESTS | 21 | 312 | 29900800 | ||
85984233 | GoatTimeDavis | B | July 4, 2020, 4:39 p.m. | OK | PyPy 3 | TESTS | 21 | 327 | 28979200 | ||
85979733 | Ekinak | B | July 4, 2020, 4:26 p.m. | OK | Python 2 | TESTS | 21 | 343 | 6963200 | ||
85961014 | elqver | B | July 4, 2020, 3:37 p.m. | OK | Python 3 | TESTS | 21 | 280 | 7680000 | ||
85961814 | shiv_99 | B | July 4, 2020, 3:39 p.m. | OK | Python 3 | TESTS | 21 | 311 | 7475200 | ||
85960484 | ralf_ralf | B | July 4, 2020, 3:36 p.m. | OK | Python 3 | TESTS | 21 | 311 | 7475200 | ||
85983032 | ash16win | B | July 4, 2020, 4:36 p.m. | OK | Python 3 | TESTS | 21 | 311 | 9216000 | ||
85974447 | TolimanStaR | B | July 4, 2020, 4:10 p.m. | OK | Python 3 | TESTS | 21 | 342 | 7372800 | ||
86024669 | saiakhilt50 | B | July 5, 2020, 5:10 a.m. | OK | Python 3 | TESTS | 21 | 343 | 7475200 | ||
85968046 | 17ucc044 | B | July 4, 2020, 3:53 p.m. | OK | Python 3 | TESTS | 21 | 343 | 7782400 | ||
85964319 | pallav12 | B | July 4, 2020, 3:45 p.m. | OK | Python 3 | TESTS | 21 | 358 | 6963200 | ||
86026416 | _.THUNDER._ | B | July 5, 2020, 5:43 a.m. | OK | Python 3 | TESTS | 21 | 358 | 7577600 | ||
86008521 | goelshashank007 | B | July 4, 2020, 8:05 p.m. | OK | Python 3 | TESTS | 21 | 358 | 7577600 | ||
85989567 | yuxxxx | B | July 4, 2020, 4:56 p.m. | OK | Ruby | TESTS | 21 | 654 | 49152000 | ||
86015479 | t_uchida | B | July 5, 2020, 12:10 a.m. | OK | Rust | TESTS | 21 | 451 | 3993600 | ||
85958644 | bqn | B | July 4, 2020, 3:32 p.m. | OK | Rust | TESTS | 21 | 498 | 4915200 |
Back to search problems