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 |
---|---|---|---|---|---|---|
1638 | Codeforces Round 771 (Div. 2) | FINISHED | False | 7200 | 92417063 | Feb. 14, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 4287 ) | D | Big Brush | PROGRAMMING | dfs and similar greedy implementation |
B"You found a painting on a canvas of size n x m . The canvas can be represented as a grid with n rows and m columns. Each cell has some color. Cell (i, j) has color c_{i,j} . Near the painting you also found a brush in the shape of a 2 x 2 square, so the canvas was surely painted in the following way: initially, no cell was painted. Then, the following painting operation has been performed some number of times: All cells must be painted at least once. A cell can be painted multiple times. In this case, its final color will be the last one. Find any sequence of at most nm operations that could have led to the painting you found or state that it's impossible. The first line of input contains two integers n and m ( 2 <= n, m <= 1000 ) -- the dimensions of the canvas. On the i -th of the next n lines of input, there will be m integers. The j -th of them is a_{i,j} ( 1 <= a_{i,j} <= nm ) -- the color of cell (i, j) . If there is no solution, print a single integer -1 . Otherwise, on the first line, print one integer q ( 1 <= q <= nm ) -- the number of operations. Next, print the operations in order. On the k -th of the next q lines, print three integers i , j , c ( 1 <= i < n , 1 <= j < m , 1 <= c <= nm ) -- the description of the k -th operation. If there are multiple solutions, print any. In the first test case, the solution is not unique. Here's one of them: In the second test case, there is no way one could obtain the given painting, thus the answer is -1 . "... |
Codeforces Round #771 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
146472453 | Sigma-Sagittarius | D | Feb. 15, 2022, 4:30 a.m. | OK | FPC | TESTS | 51 | 2293 | 197529600 | ||
146471168 | Sigma-Sagittarius | D | Feb. 15, 2022, 4:11 a.m. | OK | FPC | TESTS | 51 | 2417 | 197529600 | ||
146458554 | ztfgsxdgyt | D | Feb. 14, 2022, 10:56 p.m. | OK | GNU C11 | TESTS | 51 | 296 | 26726400 | ||
146425369 | YangTY | D | Feb. 14, 2022, 4:28 p.m. | OK | GNU C++14 | TESTS | 51 | 265 | 44032000 | ||
146464564 | Yamamoto_1919 | D | Feb. 15, 2022, 2:17 a.m. | OK | GNU C++14 | TESTS | 51 | 576 | 27136000 | ||
146422646 | chaber | D | Feb. 14, 2022, 4:21 p.m. | OK | GNU C++14 | TESTS | 51 | 577 | 32051200 | ||
146467128 | liujiameng | D | Feb. 15, 2022, 3:07 a.m. | OK | GNU C++14 | TESTS | 51 | 592 | 17100800 | ||
146467782 | ktimur | D | Feb. 15, 2022, 3:19 a.m. | OK | GNU C++14 | TESTS | 51 | 592 | 24166400 | ||
146476114 | 42i196 | D | Feb. 15, 2022, 5:20 a.m. | OK | GNU C++14 | TESTS | 51 | 608 | 20070400 | ||
146422148 | snewptl | D | Feb. 14, 2022, 4:19 p.m. | OK | GNU C++14 | TESTS | 51 | 608 | 31232000 | ||
146446092 | wangtz0607 | D | Feb. 14, 2022, 7:15 p.m. | OK | GNU C++14 | TESTS | 51 | 623 | 26624000 | ||
146471219 | haha_ha | D | Feb. 15, 2022, 4:12 a.m. | OK | GNU C++14 | TESTS | 51 | 623 | 33894400 | ||
146428165 | kgqy | D | Feb. 14, 2022, 4:34 p.m. | OK | GNU C++14 | TESTS | 51 | 624 | 31232000 | ||
146461322 | hehapig | D | Feb. 15, 2022, 12:53 a.m. | OK | GNU C++17 | TESTS | 51 | 592 | 32358400 | ||
146426602 | l1l1l1l1 | D | Feb. 14, 2022, 4:31 p.m. | OK | GNU C++17 | TESTS | 51 | 592 | 55500800 | ||
146451728 | weak_child1 | D | Feb. 14, 2022, 8:17 p.m. | OK | GNU C++17 | TESTS | 51 | 608 | 20480000 | ||
146424960 | donghuahc | D | Feb. 14, 2022, 4:27 p.m. | OK | GNU C++17 | TESTS | 51 | 608 | 23552000 | ||
146456280 | vlad107 | D | Feb. 14, 2022, 9:45 p.m. | OK | GNU C++17 | TESTS | 51 | 608 | 24678400 | ||
146455145 | forgothandle | D | Feb. 14, 2022, 9:21 p.m. | OK | GNU C++17 | TESTS | 51 | 608 | 24678400 | ||
146461988 | Sakura_mw | D | Feb. 15, 2022, 1:13 a.m. | OK | GNU C++17 | TESTS | 51 | 608 | 27238400 | ||
146427244 | Temirulan | D | Feb. 14, 2022, 4:33 p.m. | OK | GNU C++17 | TESTS | 51 | 608 | 27238400 | ||
146473098 | flying_doraemon | D | Feb. 15, 2022, 4:40 a.m. | OK | GNU C++17 | TESTS | 51 | 608 | 28467200 | ||
146472909 | flying_doraemon | D | Feb. 15, 2022, 4:37 a.m. | OK | GNU C++17 | TESTS | 51 | 608 | 28467200 | ||
146469304 | Old_ileln | D | Feb. 15, 2022, 3:44 a.m. | OK | GNU C++17 (64) | TESTS | 51 | 498 | 23756800 | ||
146454173 | lightseba | D | Feb. 14, 2022, 9:01 p.m. | OK | GNU C++17 (64) | TESTS | 51 | 514 | 23654400 | ||
146458302 | thilio | D | Feb. 14, 2022, 10:47 p.m. | OK | GNU C++17 (64) | TESTS | 51 | 514 | 24473600 | ||
146476845 | Emilan | D | Feb. 15, 2022, 5:29 a.m. | OK | GNU C++17 (64) | TESTS | 51 | 514 | 33894400 | ||
146467565 | handlecurrentinuse | D | Feb. 15, 2022, 3:15 a.m. | OK | GNU C++17 (64) | TESTS | 51 | 529 | 23449600 | ||
146452361 | Ayalla | D | Feb. 14, 2022, 8:28 p.m. | OK | GNU C++17 (64) | TESTS | 51 | 530 | 32051200 | ||
146419279 | zykkezi | D | Feb. 14, 2022, 4:11 p.m. | OK | GNU C++17 (64) | TESTS | 51 | 530 | 60211200 | ||
146422326 | tokyo_69 | D | Feb. 14, 2022, 4:20 p.m. | OK | GNU C++17 (64) | TESTS | 51 | 545 | 19251200 | ||
146423136 | bored_kid | D | Feb. 14, 2022, 4:22 p.m. | OK | GNU C++17 (64) | TESTS | 51 | 545 | 19251200 | ||
146421912 | leeh18 | D | Feb. 14, 2022, 4:19 p.m. | OK | GNU C++17 (64) | TESTS | 51 | 545 | 23449600 | ||
146457986 | -Elliot- | D | Feb. 14, 2022, 10:35 p.m. | OK | GNU C++20 (64) | TESTS | 51 | 187 | 16896000 | ||
146457661 | -Elliot- | D | Feb. 14, 2022, 10:25 p.m. | OK | GNU C++20 (64) | TESTS | 51 | 374 | 16896000 | ||
146456440 | -Elliot- | D | Feb. 14, 2022, 9:50 p.m. | OK | GNU C++20 (64) | TESTS | 51 | 389 | 16896000 | ||
146452257 | -Elliot- | D | Feb. 14, 2022, 8:27 p.m. | OK | GNU C++20 (64) | TESTS | 51 | 389 | 17100800 | ||
146456694 | -Elliot- | D | Feb. 14, 2022, 9:57 p.m. | OK | GNU C++20 (64) | TESTS | 51 | 390 | 16896000 | ||
146456460 | -Elliot- | D | Feb. 14, 2022, 9:50 p.m. | OK | GNU C++20 (64) | TESTS | 51 | 390 | 16896000 | ||
146457378 | -Elliot- | D | Feb. 14, 2022, 10:17 p.m. | OK | GNU C++20 (64) | TESTS | 51 | 390 | 16998400 | ||
146456474 | -Elliot- | D | Feb. 14, 2022, 9:51 p.m. | OK | GNU C++20 (64) | TESTS | 51 | 405 | 16998400 | ||
146452145 | -Elliot- | D | Feb. 14, 2022, 8:25 p.m. | OK | GNU C++20 (64) | TESTS | 51 | 405 | 17100800 | ||
146427113 | MohamedAdel | D | Feb. 14, 2022, 4:32 p.m. | OK | GNU C++20 (64) | TESTS | 51 | 405 | 19251200 | ||
146445716 | clyring | D | Feb. 14, 2022, 7:13 p.m. | OK | Haskell | TESTS | 51 | 2807 | 215347200 | ||
146475352 | ND_ | D | Feb. 15, 2022, 5:10 a.m. | OK | Java 11 | TESTS | 51 | 888 | 51916800 | ||
146475589 | ND_ | D | Feb. 15, 2022, 5:13 a.m. | OK | Java 11 | TESTS | 51 | 951 | 52019200 | ||
146460408 | robinz62 | D | Feb. 15, 2022, 12:21 a.m. | OK | Java 11 | TESTS | 51 | 997 | 64204800 | ||
146445455 | Yuki_B | D | Feb. 14, 2022, 7:11 p.m. | OK | Java 11 | TESTS | 51 | 1060 | 52224000 | ||
146425702 | Clark_Kent | D | Feb. 14, 2022, 4:29 p.m. | OK | Java 11 | TESTS | 51 | 1138 | 50380800 | ||
146448328 | Restricted | D | Feb. 14, 2022, 7:34 p.m. | OK | Java 11 | TESTS | 51 | 1357 | 121446400 | ||
146451811 | MrOtter | D | Feb. 14, 2022, 8:19 p.m. | OK | Java 11 | TESTS | 51 | 1528 | 67072000 | ||
146447832 | Restricted | D | Feb. 14, 2022, 7:29 p.m. | OK | Java 11 | TESTS | 51 | 2230 | 169164800 | ||
146445235 | Isfandiyor | D | Feb. 14, 2022, 7:11 p.m. | OK | Java 11 | TESTS | 51 | 2636 | 66252800 | ||
146452371 | 0124getU | D | Feb. 14, 2022, 8:28 p.m. | OK | Java 11 | TESTS | 51 | 2683 | 165683200 | ||
146425910 | Aabhas99 | D | Feb. 14, 2022, 4:29 p.m. | OK | Java 8 | TESTS | 51 | 982 | 117350400 | ||
146477597 | AS_1729 | D | Feb. 15, 2022, 5:39 a.m. | OK | Java 8 | TESTS | 51 | 1013 | 124211200 | ||
146453141 | ZerooCool | D | Feb. 14, 2022, 8:42 p.m. | OK | Java 8 | TESTS | 51 | 1591 | 108441600 | ||
146468288 | ytu_czl | D | Feb. 15, 2022, 3:28 a.m. | OK | Java 8 | TESTS | 51 | 1981 | 175411200 | ||
146421276 | LXl491214 | D | Feb. 14, 2022, 4:17 p.m. | OK | MS C++ 2017 | TESTS | 51 | 717 | 29081600 | ||
146450375 | r57shell | D | Feb. 14, 2022, 7:58 p.m. | OK | MS C++ 2017 | TESTS | 51 | 748 | 26828800 | ||
146460506 | Agumon | D | Feb. 15, 2022, 12:25 a.m. | OK | MS C++ 2017 | TESTS | 51 | 998 | 141414400 | ||
146466866 | ComPhyPark | D | Feb. 15, 2022, 3:02 a.m. | OK | MS C++ 2017 | TESTS | 51 | 1309 | 36147200 | ||
146448486 | r57shell | D | Feb. 14, 2022, 7:36 p.m. | OK | MS C++ 2017 | TESTS | 51 | 1497 | 26828800 | ||
146457588 | abdelrahman_rashed | D | Feb. 14, 2022, 10:23 p.m. | OK | MS C++ 2017 | TESTS | 51 | 2589 | 36044800 | ||
146450948 | FlakeLCR | D | Feb. 14, 2022, 8:06 p.m. | OK | PyPy 2 | TESTS | 51 | 1855 | 126873600 | ||
146449944 | FlakeLCR | D | Feb. 14, 2022, 7:53 p.m. | OK | PyPy 2 | TESTS | 51 | 1856 | 132915200 | ||
146450807 | FlakeLCR | D | Feb. 14, 2022, 8:04 p.m. | OK | PyPy 2 | TESTS | 51 | 2011 | 121446400 | ||
146445011 | 1_2_3_4_5_9 | D | Feb. 14, 2022, 7:10 p.m. | OK | PyPy 2 | TESTS | 51 | 2121 | 231424000 | ||
146446573 | OLOGY | D | Feb. 14, 2022, 7:18 p.m. | OK | PyPy 2 | TESTS | 51 | 2277 | 222208000 | ||
146446282 | OLOGY | D | Feb. 14, 2022, 7:16 p.m. | OK | PyPy 2 | TESTS | 51 | 2293 | 234803200 | ||
146459204 | FlakeLCR | D | Feb. 14, 2022, 11:34 p.m. | OK | PyPy 3 | TESTS | 51 | 904 | 140902400 | ||
146468622 | ruimina | D | Feb. 15, 2022, 3:33 a.m. | OK | PyPy 3 | TESTS | 51 | 1668 | 108851200 | ||
146450582 | kazamasmile | D | Feb. 14, 2022, 8:01 p.m. | OK | PyPy 3 | TESTS | 51 | 1668 | 154316800 | ||
146448489 | immike | D | Feb. 14, 2022, 7:36 p.m. | OK | PyPy 3 | TESTS | 51 | 1855 | 132198400 | ||
146448299 | kazamasmile | D | Feb. 14, 2022, 7:34 p.m. | OK | PyPy 3 | TESTS | 51 | 1856 | 139980800 | ||
146444969 | manish.17 | D | Feb. 14, 2022, 7:09 p.m. | OK | PyPy 3 | TESTS | 51 | 1887 | 151142400 | ||
146450448 | jerdno | D | Feb. 14, 2022, 7:59 p.m. | OK | PyPy 3 | TESTS | 51 | 2058 | 205004800 | ||
146448426 | akshitm16 | D | Feb. 14, 2022, 7:35 p.m. | OK | PyPy 3 | TESTS | 51 | 2089 | 166707200 | ||
146450735 | FlakeLCR | D | Feb. 14, 2022, 8:03 p.m. | OK | PyPy 3 | TESTS | 51 | 2090 | 133939200 | ||
146448228 | akshitm16 | D | Feb. 14, 2022, 7:33 p.m. | OK | PyPy 3 | TESTS | 51 | 2215 | 166400000 | ||
146459113 | FlakeLCR | D | Feb. 14, 2022, 11:31 p.m. | OK | PyPy 3-64 | TESTS | 51 | 795 | 155340800 | ||
146458618 | FlakeLCR | D | Feb. 14, 2022, 10:57 p.m. | OK | PyPy 3-64 | TESTS | 51 | 1528 | 152576000 | ||
146458308 | FlakeLCR | D | Feb. 14, 2022, 10:47 p.m. | OK | PyPy 3-64 | TESTS | 51 | 1606 | 152064000 | ||
146458645 | FlakeLCR | D | Feb. 14, 2022, 10:58 p.m. | OK | PyPy 3-64 | TESTS | 51 | 1716 | 152985600 | ||
146450721 | FlakeLCR | D | Feb. 14, 2022, 8:03 p.m. | OK | PyPy 3-64 | TESTS | 51 | 1808 | 143872000 | ||
146458665 | FlakeLCR | D | Feb. 14, 2022, 10:59 p.m. | OK | PyPy 3-64 | TESTS | 51 | 1840 | 152576000 | ||
146458785 | bpdolson | D | Feb. 14, 2022, 11:04 p.m. | OK | PyPy 3-64 | TESTS | 51 | 2214 | 244940800 | ||
146458278 | FlakeLCR | D | Feb. 14, 2022, 10:46 p.m. | OK | PyPy 3-64 | TESTS | 51 | 2495 | 192819200 | ||
146450384 | FlakeLCR | D | Feb. 14, 2022, 7:59 p.m. | OK | PyPy 3-64 | TESTS | 51 | 2901 | 189337600 | ||
146447344 | plevande | D | Feb. 14, 2022, 7:24 p.m. | OK | PyPy 3-64 | TESTS | 51 | 2979 | 210841600 | ||
146447551 | qwerty787788 | D | Feb. 14, 2022, 7:26 p.m. | OK | Rust 2021 | TESTS | 51 | 764 | 46387200 | ||
146446874 | qwerty787788 | D | Feb. 14, 2022, 7:20 p.m. | OK | Rust 2021 | TESTS | 51 | 764 | 46387200 |
Back to search problems