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 |
---|---|---|---|---|---|---|
1749 | Educational Codeforces Round 138 (Rated for Div. 2) | FINISHED | False | 7200 | 70903463 | Oct. 20, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 1795 ) | E | Cactus Wall | PROGRAMMING | dfs and similar graphs shortest paths |
B"Monocarp is playing Minecraft and wants to build a wall of cacti. He wants to build it on a field of sand of the size of n x m cells. Initially, there are cacti in some cells of the field. Note that, in Minecraft, cacti cannot grow on cells adjacent to each other by side -- and the initial field meets this restriction. Monocarp can plant new cacti (they must also fulfil the aforementioned condition). He can't chop down any of the cacti that are already growing on the field -- he doesn't have an axe, and the cacti are too prickly for his hands. Monocarp believes that the wall is complete if there is no path from the top row of the field to the bottom row, such that: Your task is to plant the minimum number of cacti to build a wall (or to report that this is impossible). The first line contains a single integer t ( 1 <= t <= 10^3 ) -- number of test cases. The first line of each test case contains two integers n and m ( 2 <= n, m <= 2 cdot 10^5 ; n x m <= 4 cdot 10^5 ) -- the number of rows and columns, respectively. Then n rows follow, i -th row contains a string s_i of length m , where s_{i, j} is '#', if a cactus grows at the intersection of the i -th row and the j -th column. Otherwise, s_{i, j} is '.'. The sum of n x m over all test cases does not exceed 4 cdot 10^5 . For each test case, print NO in the first line if it is impossible to build a cactus wall without breaking the rules. Otherwise, print YES in the first line, then print n lines of m characters each -- the field itself, where the j -th character of the i -th line is equal to '#', if there is a cactus on the intersection of the i -th row and the j -th column, otherwise it is '.'. If there are multiple optimal answers, print any of them. "... |
108269 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
177218825 | DmitriyAnikeyev | E | Oct. 20, 2022, 5:22 p.m. | OK | C# 10 | TESTS | 42 | 483 | 93900800 | ||
177205049 | vashweek | E | Oct. 20, 2022, 4:20 p.m. | OK | D | TESTS | 42 | 967 | 126771200 | ||
177215238 | chro4896 | E | Oct. 20, 2022, 4:56 p.m. | OK | GNU C11 | TESTS | 42 | 187 | 17408000 | ||
177217431 | GrigoriySol1902 | E | Oct. 20, 2022, 5:11 p.m. | OK | GNU C++14 | TESTS | 42 | 46 | 2457600 | ||
177255181 | komeiji_koishi514 | E | Oct. 21, 2022, 3:45 a.m. | OK | GNU C++14 | TESTS | 42 | 46 | 70758400 | ||
177210404 | 10_01666 | E | Oct. 20, 2022, 4:33 p.m. | OK | GNU C++14 | TESTS | 42 | 61 | 104550400 | ||
177260599 | Etamsylate | E | Oct. 21, 2022, 5:14 a.m. | OK | GNU C++14 | TESTS | 42 | 62 | 5734400 | ||
177219072 | M0stapha_Taha | E | Oct. 20, 2022, 5:24 p.m. | OK | GNU C++14 | TESTS | 42 | 77 | 15564800 | ||
177233486 | Bedo_Sayed | E | Oct. 20, 2022, 8:03 p.m. | OK | GNU C++14 | TESTS | 42 | 77 | 35328000 | ||
177224531 | ghostwriter | E | Oct. 20, 2022, 6:14 p.m. | OK | GNU C++14 | TESTS | 42 | 78 | 10444800 | ||
177223979 | mindol | E | Oct. 20, 2022, 6:08 p.m. | OK | GNU C++14 | TESTS | 42 | 78 | 13926400 | ||
177213155 | foammm | E | Oct. 20, 2022, 4:44 p.m. | OK | GNU C++14 | TESTS | 42 | 93 | 14540800 | ||
177254976 | glq_C | E | Oct. 21, 2022, 3:42 a.m. | OK | GNU C++14 | TESTS | 42 | 109 | 32563200 | ||
177249428 | Bucketsmith | E | Oct. 21, 2022, 1:59 a.m. | OK | GNU C++17 | TESTS | 42 | 46 | 4096000 | ||
177252477 | velpro. | E | Oct. 21, 2022, 2:58 a.m. | OK | GNU C++17 | TESTS | 42 | 46 | 7987200 | ||
177227894 | DiegoGarcia | E | Oct. 20, 2022, 6:49 p.m. | OK | GNU C++17 | TESTS | 42 | 46 | 7987200 | ||
177252769 | zja601 | E | Oct. 21, 2022, 3:04 a.m. | OK | GNU C++17 | TESTS | 42 | 46 | 7987200 | ||
177256420 | dgsvygd | E | Oct. 21, 2022, 4:07 a.m. | OK | GNU C++17 | TESTS | 42 | 46 | 8089600 | ||
177239223 | Knight_12 | E | Oct. 20, 2022, 9:35 p.m. | OK | GNU C++17 | TESTS | 42 | 46 | 8192000 | ||
177227840 | the_computer_jock | E | Oct. 20, 2022, 6:48 p.m. | OK | GNU C++17 | TESTS | 42 | 46 | 9420800 | ||
177244610 | null_awe | E | Oct. 21, 2022, 12:03 a.m. | OK | GNU C++17 | TESTS | 42 | 46 | 11059200 | ||
177205382 | NullXD | E | Oct. 20, 2022, 4:21 p.m. | OK | GNU C++17 | TESTS | 42 | 46 | 13312000 | ||
177214929 | Bobocan | E | Oct. 20, 2022, 4:54 p.m. | OK | GNU C++17 | TESTS | 42 | 46 | 13721600 | ||
177210084 | ttttan | E | Oct. 20, 2022, 4:33 p.m. | OK | GNU C++17 (64) | TESTS | 42 | 31 | 6860800 | ||
177213354 | alan8585 | E | Oct. 20, 2022, 4:45 p.m. | OK | GNU C++17 (64) | TESTS | 42 | 46 | 6860800 | ||
177258754 | batiay | E | Oct. 21, 2022, 4:46 a.m. | OK | GNU C++17 (64) | TESTS | 42 | 46 | 9420800 | ||
177216018 | cuiaoxiang | E | Oct. 20, 2022, 5:01 p.m. | OK | GNU C++17 (64) | TESTS | 42 | 46 | 11878400 | ||
177227308 | Andreasyan | E | Oct. 20, 2022, 6:43 p.m. | OK | GNU C++17 (64) | TESTS | 42 | 46 | 14131200 | ||
177224220 | Coki628 | E | Oct. 20, 2022, 6:11 p.m. | OK | GNU C++17 (64) | TESTS | 42 | 46 | 14336000 | ||
177217599 | Rosed | E | Oct. 20, 2022, 5:12 p.m. | OK | GNU C++17 (64) | TESTS | 42 | 46 | 18534400 | ||
177234949 | apoorv_me | E | Oct. 20, 2022, 8:25 p.m. | OK | GNU C++17 (64) | TESTS | 42 | 46 | 19353600 | ||
177219594 | huangxiaohua | E | Oct. 20, 2022, 5:28 p.m. | OK | GNU C++17 (64) | TESTS | 42 | 46 | 26419200 | ||
177219745 | huangxiaohua | E | Oct. 20, 2022, 5:29 p.m. | OK | GNU C++17 (64) | TESTS | 42 | 61 | 26419200 | ||
177215840 | NRolly | E | Oct. 20, 2022, 4:59 p.m. | OK | GNU C++20 (64) | TESTS | 42 | 31 | 4198400 | ||
177241743 | acfinity | E | Oct. 20, 2022, 10:36 p.m. | OK | GNU C++20 (64) | TESTS | 42 | 31 | 9420800 | ||
177202290 | panyaoyu1999 | E | Oct. 20, 2022, 4:13 p.m. | OK | GNU C++20 (64) | TESTS | 42 | 31 | 9420800 | ||
177251927 | xxafhixx | E | Oct. 21, 2022, 2:48 a.m. | OK | GNU C++20 (64) | TESTS | 42 | 31 | 9728000 | ||
177247675 | Setsuna | E | Oct. 21, 2022, 1:19 a.m. | OK | GNU C++20 (64) | TESTS | 42 | 31 | 10649600 | ||
177247467 | _BottomCoder_ | E | Oct. 21, 2022, 1:14 a.m. | OK | GNU C++20 (64) | TESTS | 42 | 46 | 7475200 | ||
177247447 | _BottomCoder_ | E | Oct. 21, 2022, 1:13 a.m. | OK | GNU C++20 (64) | TESTS | 42 | 46 | 7475200 | ||
177262480 | LuoHaiDong | E | Oct. 21, 2022, 5:38 a.m. | OK | GNU C++20 (64) | TESTS | 42 | 46 | 9420800 | ||
177262446 | LuoHaiDong | E | Oct. 21, 2022, 5:38 a.m. | OK | GNU C++20 (64) | TESTS | 42 | 46 | 9420800 | ||
177239261 | ahmad_alghadban | E | Oct. 20, 2022, 9:36 p.m. | OK | GNU C++20 (64) | TESTS | 42 | 46 | 9625600 | ||
177204451 | That_Salamander | E | Oct. 20, 2022, 4:19 p.m. | OK | MS C++ 2017 | TESTS | 42 | 218 | 14336000 | ||
177220024 | misorin | E | Oct. 20, 2022, 5:31 p.m. | OK | PyPy 3 | TESTS | 42 | 249 | 22630400 | ||
177219833 | misorin | E | Oct. 20, 2022, 5:30 p.m. | OK | PyPy 3-64 | TESTS | 42 | 218 | 38809600 | ||
177218272 | misorin | E | Oct. 20, 2022, 5:17 p.m. | OK | PyPy 3-64 | TESTS | 42 | 233 | 39321600 | ||
177217909 | misorin | E | Oct. 20, 2022, 5:14 p.m. | OK | PyPy 3-64 | TESTS | 42 | 248 | 29388800 | ||
177220604 | misorin | E | Oct. 20, 2022, 5:36 p.m. | OK | PyPy 3-64 | TESTS | 42 | 249 | 43008000 | ||
177217089 | misorin | E | Oct. 20, 2022, 5:08 p.m. | OK | PyPy 3-64 | TESTS | 42 | 296 | 55398400 | ||
177224822 | zouyu9631 | E | Oct. 20, 2022, 6:17 p.m. | OK | PyPy 3-64 | TESTS | 42 | 514 | 76083200 | ||
177204304 | mkawa2 | E | Oct. 20, 2022, 4:18 p.m. | OK | PyPy 3-64 | TESTS | 42 | 530 | 73216000 | ||
177224718 | zouyu9631 | E | Oct. 20, 2022, 6:16 p.m. | OK | PyPy 3-64 | TESTS | 42 | 546 | 76390400 | ||
177223495 | roaris | E | Oct. 20, 2022, 6:03 p.m. | OK | PyPy 3-64 | TESTS | 42 | 623 | 66560000 | ||
177221492 | huangxw | E | Oct. 20, 2022, 5:44 p.m. | OK | PyPy 3-64 | TESTS | 42 | 623 | 83865600 | ||
177257325 | Sempr | E | Oct. 21, 2022, 4:22 a.m. | OK | Rust 2021 | TESTS | 42 | 61 | 15257600 | ||
177257279 | Sempr | E | Oct. 21, 2022, 4:22 a.m. | OK | Rust 2021 | TESTS | 42 | 62 | 15257600 | ||
177263595 | orz_liuwei | E | Oct. 21, 2022, 5:52 a.m. | OK | Rust 2021 | TESTS | 42 | 108 | 32972800 | ||
177263050 | orz_liuwei | E | Oct. 21, 2022, 5:45 a.m. | OK | Rust 2021 | TESTS | 42 | 109 | 32972800 | ||
177205083 | Heltion | E | Oct. 20, 2022, 4:20 p.m. | OK | Rust 2021 | TESTS | 42 | 296 | 38604800 |
Back to search problems