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 |
|---|---|---|---|---|---|---|
| 2219 | Codeforces Round 1093 (Div. 1) | FINISHED | False | 7200 | 4375496 | April 13, 2026, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 113 ) | E | Weird Chessboard | PROGRAMMING | constructive algorithms math |
Consider a chessboard (a grid) of size (n \times n). You want to place as many chess pieces on this board as possible. These pieces behave in the following way: if we denote the top-left cell by ((1,1)), then a piece placed in cell ((i,j)) can attack every cell ((x,y)) such that (x \ge i) and (y \ge j), except for ((i,j)) itself. For example, on a (10 \times 10) board, a piece placed at ((3,4)) can attack the cells highlighted below: Given a chessboard with some pieces placed on it, we say that a cell is good if the number of pieces that attack that cell is even. Construct a configuration of pieces such that every cell is good, regardless of whether the cell itself contains a piece or not, and the board contains at least (\lfloor \frac{n^2}{10} \rfloor \cdot 3) pieces. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 50)). The description of the test cases follows. The first line of each test case contains an integer (n) ((1 \le n \le 5000)). It is guaranteed that the sum of (n^2) over all test cases is at most (25\,000\,000 = 5000^2). For each test case, print (n) lines. In the (i)-th line, print (n) integers separated by spaces, where a (1) represents that there is a piece in that cell, and a (0) represents that there is not. The (j)-th integer in the (i)-th line corresponds to cell ((i,j)). This example is a chessboard of dimensions (3 \times 3) where every cell is good . Cell ((3, 3)) is good because the cells with pieces ((1, 3), (2, 3), (2, 2), (3, 1)) attack it, and this count is 4, which is even. Cell ((1, 3)) is good because no piece attacks it, so the count of pieces that attack this cell is 0. Cell ((3, 2)) is good , and notice that it is required for that cell to be good even though it does not have a piece. |
| Codeforces Round 1093 (Div. 1, Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 371069211 | ChatGPT4.0 | E | April 14, 2026, 2:06 a.m. | OK | C++20 (GCC 13-64) | TESTS | 29 | 156 | 25190400 | ||
| 371074044 | gshbholanath19 | E | April 14, 2026, 3:40 a.m. | OK | C++20 (GCC 13-64) | TESTS | 29 | 500 | 23449600 | ||
| 371045494 | SATSKY_2025target_LGM | E | April 13, 2026, 6:38 p.m. | OK | C++20 (GCC 13-64) | TESTS | 29 | 1281 | 96665600 | ||
| 371046557 | SATSKY_2025target_LGM | E | April 13, 2026, 6:49 p.m. | OK | C++20 (GCC 13-64) | TESTS | 29 | 1312 | 197120000 | ||
| 371047060 | NanYan | E | April 13, 2026, 6:54 p.m. | OK | C++20 (GCC 13-64) | TESTS | 29 | 1687 | 223948800 | ||
| 371071264 | benben181 | E | April 14, 2026, 2:47 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 29 | 484 | 23552000 | ||
| 371061928 | KALDESH | E | April 13, 2026, 10:38 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 29 | 484 | 23654400 | ||
| 371015865 | tourist | E | April 13, 2026, 4:02 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 29 | 531 | 23654400 | ||
| 371073022 | thanhnguyxn07 | E | April 14, 2026, 3:21 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 29 | 1250 | 50278400 | ||
| 371036839 | jiangly | E | April 13, 2026, 5:34 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 29 | 1343 | 96665600 | ||
| 371037848 | snuke | E | April 13, 2026, 5:40 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 29 | 1343 | 96972800 | ||
| 371039413 | snuke | E | April 13, 2026, 5:50 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 29 | 1390 | 97075200 | ||
| 371044006 | lzyrapx | E | April 13, 2026, 6:25 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 29 | 1453 | 8806400 | ||
| 371076340 | Edu175 | E | April 14, 2026, 4:17 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 29 | 1484 | 200806400 | ||
| 371077583 | Edu175 | E | April 14, 2026, 4:37 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 29 | 1562 | 200908800 |
Back to search problems