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 |
|---|---|---|---|---|---|---|
| 2057 | Hello 2025 | FINISHED | False | 9000 | 40404322 | Jan. 4, 2025, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 717 ) | G | Secret Message | PROGRAMMING | constructive algorithms math |
Every Saturday, Alexander B., a teacher of parallel X, writes a secret message to Alexander G., a teacher of parallel B, in the evening. Since Alexander G. is giving a lecture at that time and the message is very important, Alexander B. has to write this message on an interactive online board. The interactive online board is a grid consisting of (n) rows and (m) columns, where each cell is (1 \times 1) in size. Some cells of this board are already filled in, and it is impossible to write a message in them; such cells are marked with the symbol " . ", while the remaining cells are called free and are marked with the symbol " # ". Let us introduce two characteristics of the online board: (s) is the number of free cells. (p) is the perimeter of the grid figure formed by the union of free cells. Let (A) be the set of free cells. Your goal is to find a set of cells (S \subseteq A) that satisfies the following properties: (|S| \le \frac{1}{5} \cdot (s+p)). Any cell from (A) either lies in (S) or shares a side with some cell from (S). We can show that at least one set (S) satisfying these properties exists; you are required to find any suitable one. The first line contains the number (t) ((1 \le t \le 80\,000)) — the number of test cases. In the first line of each test case, the numbers (n) and (m) ((1 \le n, m \le 2 \cdot 10^6)) — the dimensions of the grid are given. The following (n) lines contain the description of the grid. It is guaranteed that the sum of (n \cdot m) across all test cases does not exceed (2 \cdot 10^6). For each test case, output (n) lines consisting of (m) symbols, where each symbol encodes the state of the cell: " # " — the cell is in (A) but not in (S); " S " — the cell is in both (A) and (S); " . " — the cell is neither in (A) nor in (S). In the first example, (s=5) and (p=12), thus the number of cells in (S) must |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 299684618 | PEIMUDA | G | Jan. 4, 2025, 4:56 p.m. | OK | C++17 (GCC 7-32) | TESTS | 47 | 421 | 48128000 | ||
| 299705650 | AliShahali1382 | G | Jan. 4, 2025, 8:24 p.m. | OK | C++17 (GCC 7-32) | TESTS | 47 | 421 | 139264000 | ||
| 299712569 | specter12325 | G | Jan. 4, 2025, 11:11 p.m. | OK | C++17 (GCC 7-32) | TESTS | 47 | 453 | 137830400 | ||
| 299698298 | vlomaczk | G | Jan. 4, 2025, 6:59 p.m. | OK | C++17 (GCC 7-32) | TESTS | 47 | 453 | 137830400 | ||
| 299696657 | skywalkert | G | Jan. 4, 2025, 6:45 p.m. | OK | C++17 (GCC 7-32) | TESTS | 47 | 499 | 18124800 | ||
| 299686838 | alireza_kaviani | G | Jan. 4, 2025, 5 p.m. | OK | C++17 (GCC 7-32) | TESTS | 47 | 577 | 251596800 | ||
| 299717928 | Tomarange | G | Jan. 5, 2025, 2:23 a.m. | OK | C++17 (GCC 7-32) | TESTS | 47 | 593 | 6041600 | ||
| 299696581 | Potassium | G | Jan. 4, 2025, 6:44 p.m. | OK | C++17 (GCC 7-32) | TESTS | 47 | 702 | 140595200 | ||
| 299707754 | KroosTheKeenGlint | G | Jan. 4, 2025, 9:01 p.m. | OK | C++17 (GCC 7-32) | TESTS | 47 | 796 | 73728000 | ||
| 299727256 | TianyiWei | G | Jan. 5, 2025, 5:20 a.m. | OK | C++17 (GCC 7-32) | TESTS | 47 | 858 | 119705600 | ||
| 299696812 | ttamx | G | Jan. 4, 2025, 6:47 p.m. | OK | C++20 (GCC 13-64) | TESTS | 47 | 249 | 60416000 | ||
| 299698348 | A_G | G | Jan. 4, 2025, 6:59 p.m. | OK | C++20 (GCC 13-64) | TESTS | 47 | 265 | 60211200 | ||
| 299717937 | pipi20020818 | G | Jan. 5, 2025, 2:23 a.m. | OK | C++20 (GCC 13-64) | TESTS | 47 | 311 | 124313600 | ||
| 299686561 | VladProg | G | Jan. 4, 2025, 5 p.m. | OK | C++20 (GCC 13-64) | TESTS | 47 | 312 | 60211200 | ||
| 299728501 | Tobo | G | Jan. 5, 2025, 5:33 a.m. | OK | C++20 (GCC 13-64) | TESTS | 47 | 312 | 154521600 | ||
| 299700934 | kotatsugame | G | Jan. 4, 2025, 7:25 p.m. | OK | C++20 (GCC 13-64) | TESTS | 47 | 327 | 93081600 | ||
| 299699725 | kotatsugame | G | Jan. 4, 2025, 7:13 p.m. | OK | C++20 (GCC 13-64) | TESTS | 47 | 343 | 67481600 | ||
| 299685666 | HIR180 | G | Jan. 4, 2025, 4:58 p.m. | OK | C++20 (GCC 13-64) | TESTS | 47 | 374 | 164249600 | ||
| 299718890 | adam01 | G | Jan. 5, 2025, 2:47 a.m. | OK | C++20 (GCC 13-64) | TESTS | 47 | 405 | 124620800 | ||
| 299701807 | Fysty | G | Jan. 4, 2025, 7:35 p.m. | OK | C++20 (GCC 13-64) | TESTS | 47 | 421 | 64614400 | ||
| 299685903 | bruhh | G | Jan. 4, 2025, 4:58 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 47 | 171 | 66867200 | ||
| 299724514 | RUSLVN | G | Jan. 5, 2025, 4:40 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 47 | 218 | 124416000 | ||
| 299720564 | cmk666 | G | Jan. 5, 2025, 3:25 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 47 | 233 | 141619200 | ||
| 299722250 | AgafonovArtem | G | Jan. 5, 2025, 3:59 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 47 | 250 | 60313600 | ||
| 299701625 | tkacper | G | Jan. 4, 2025, 7:33 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 47 | 281 | 124416000 | ||
| 299715211 | w2y51c318 | G | Jan. 5, 2025, 12:55 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 47 | 296 | 98201600 | ||
| 299716756 | dongyc666 | G | Jan. 5, 2025, 1:51 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 47 | 296 | 137830400 | ||
| 299694499 | Benq | G | Jan. 4, 2025, 6:29 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 47 | 312 | 154726400 | ||
| 299685269 | dyppp | G | Jan. 4, 2025, 4:57 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 47 | 343 | 129536000 | ||
| 299705274 | 415411 | G | Jan. 4, 2025, 8:19 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 47 | 343 | 155648000 |
Back to search problems