Codeforces Round 1071 (Div. 3)

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
2179 Codeforces Round 1071 (Div. 3) FINISHED False 9000 9904523 Dec. 23, 2025, 2:45 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 1196 ) G Blackslex and Penguin Migration PROGRAMMING brute force interactive math

This is an interactive problem. The species of penguins that Blackslex is researching lives on an island that is a grid with (n) rows and (n) columns. Exactly one penguin lives in each one cell of the grid. He labelled each penguin as an integer from (1) to (n^2). After some time, some penguins migrated to another cell. After migration, every penguin will still be in some cell on the grid, and every cell contains exactly one penguin. He needs the current position of every penguin. To do so, he can ask a penguin how far another penguin is from it. Formally, for a possible grid (x) representing the position of all penguins, denote (\operatorname{dist}(x, i, j)) as the Manhattan distance of the penguin (i) to the penguin (j) in (x)(^{\text{∗}}). There is a hidden grid (a) with (n) rows and (n) columns. You need to find a grid (b) that satisfies (b) has (n) rows and (n) columns. Each cell of (b) contains an integer from (1) to (n^2), which is a penguin's label. Each integer will be in a single cell. For all (1 \leq i, j \leq n^2), it holds that (\operatorname{dist}(a, i, j) = \operatorname{dist}(b, i, j)). To do so, you may make the following query no more than (3n^2 + 150) times. Given (i), (j) ((1 \leq i, j \leq n^2)), receive the value of (\operatorname{dist}(a, i, j)). (^{\text{∗}})Let (r_i), (c_i) denote the row and column that the penguin (i) is in, and denote the same for (r_j), (c_j), then the Manhattan distance is (|r_i - r_j| + |c_i - c_j|). Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \leq t \leq 200)). The description of the test cases follows. The first line of each test case contains a single integer (n) ((2 \leq n \leq 100)) — the size of the island. It is guaranteed that the total sum of all values of (n) across all test cases does not exce

Tutorials

Codeforces Round 1071 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
355012137 Nisikto G Dec. 25, 2025, 6:10 a.m. OK C++17 (GCC 7-32) TESTS 7 140 102400
355003744 Pandit_Jwalit G Dec. 25, 2025, 3:47 a.m. OK C++17 (GCC 7-32) TESTS 7 187 0
354871844 akshat202 G Dec. 23, 2025, 10:14 p.m. OK C++17 (GCC 7-32) TESTS 7 203 0
354976731 hruif G Dec. 24, 2025, 5:55 p.m. OK C++17 (GCC 7-32) TESTS 7 234 0
354933297 arda G Dec. 24, 2025, 12:03 p.m. OK C++17 (GCC 7-32) TESTS 7 234 0
354872999 phoenix0112 G Dec. 23, 2025, 10:50 p.m. OK C++17 (GCC 7-32) TESTS 7 234 0
354916885 SomilP G Dec. 24, 2025, 9:51 a.m. OK C++17 (GCC 7-32) TESTS 7 250 0
354911122 _delin G Dec. 24, 2025, 9:07 a.m. OK C++17 (GCC 7-32) TESTS 7 250 0
354877508 shadow9236 G Dec. 24, 2025, 1:36 a.m. OK C++17 (GCC 7-32) TESTS 7 250 102400
354874021 andreasn G Dec. 23, 2025, 11:25 p.m. OK C++17 (GCC 7-32) TESTS 7 265 0
354953267 agr_pranjal G Dec. 24, 2025, 2:31 p.m. OK C++20 (GCC 13-64) TESTS 7 125 0
354954949 Palbudir G Dec. 24, 2025, 2:44 p.m. OK C++20 (GCC 13-64) TESTS 7 140 0
354927259 ssabarinath293 G Dec. 24, 2025, 11:16 a.m. OK C++20 (GCC 13-64) TESTS 7 140 0
354877151 yeminghan G Dec. 24, 2025, 1:25 a.m. OK C++20 (GCC 13-64) TESTS 7 140 102400
355010642 b_AHA_r G Dec. 25, 2025, 5:52 a.m. OK C++20 (GCC 13-64) TESTS 7 156 0
354967860 ajeetsingha2255 G Dec. 24, 2025, 4:30 p.m. OK C++20 (GCC 13-64) TESTS 7 156 0
355008114 dazai05 G Dec. 25, 2025, 5:15 a.m. OK C++20 (GCC 13-64) TESTS 7 171 0
354950855 creesh_krx G Dec. 24, 2025, 2:12 p.m. OK C++20 (GCC 13-64) TESTS 7 171 0
354934108 madanesv G Dec. 24, 2025, 12:10 p.m. OK C++20 (GCC 13-64) TESTS 7 171 0
354910328 moneydonotjiggle G Dec. 24, 2025, 9 a.m. OK C++20 (GCC 13-64) TESTS 7 171 0
354942481 Hz___ G Dec. 24, 2025, 1:12 p.m. OK C++23 (GCC 14-64, msys2) TESTS 7 78 0
354910383 criticalcoding G Dec. 24, 2025, 9:01 a.m. OK C++23 (GCC 14-64, msys2) TESTS 7 78 0
354946197 satvikmittal638 G Dec. 24, 2025, 1:39 p.m. OK C++23 (GCC 14-64, msys2) TESTS 7 93 0
354946454 Parkkkkkcw G Dec. 24, 2025, 1:40 p.m. OK C++23 (GCC 14-64, msys2) TESTS 7 109 0
354868185 ammahmed004 G Dec. 23, 2025, 8:55 p.m. OK C++23 (GCC 14-64, msys2) TESTS 7 140 0
354924970 kmjp G Dec. 24, 2025, 10:58 a.m. OK C++23 (GCC 14-64, msys2) TESTS 7 140 307200
354998854 Varun-Gupta G Dec. 25, 2025, 1:12 a.m. OK C++23 (GCC 14-64, msys2) TESTS 7 156 0
354877641 Kylume G Dec. 24, 2025, 1:41 a.m. OK C++23 (GCC 14-64, msys2) TESTS 7 156 512000
354886572 chensunyishuo G Dec. 24, 2025, 4:47 a.m. OK C++23 (GCC 14-64, msys2) TESTS 7 156 4096000
355009587 Amit_Khedar G Dec. 25, 2025, 5:37 a.m. OK C++23 (GCC 14-64, msys2) TESTS 7 171 0
355001580 Ritwin G Dec. 25, 2025, 2:45 a.m. OK GNU C11 TESTS 7 1078 8499200
354945360 Yousef_Badr G Dec. 24, 2025, 1:33 p.m. OK Java 21 TESTS 7 1250 716800
354992828 dzhi G Dec. 24, 2025, 9:31 p.m. OK Java 21 TESTS 7 1671 1228800
354941940 Yousef_Badr G Dec. 24, 2025, 1:08 p.m. OK Java 21 TESTS 7 1703 1331200
354942229 Yousef_Badr G Dec. 24, 2025, 1:10 p.m. OK Java 21 TESTS 7 1953 2355200
355000561 golions G Dec. 25, 2025, 2:14 a.m. OK Java 8 TESTS 7 953 0
354916554 Mischievius G Dec. 24, 2025, 9:49 a.m. OK PyPy 3-64 TESTS 7 453 9523200
354958263 _Kee G Dec. 24, 2025, 3:10 p.m. OK PyPy 3-64 TESTS 7 1109 8806400
354873802 IcyGirl G Dec. 23, 2025, 11:20 p.m. OK PyPy 3-64 TESTS 7 1203 8601600
355005037 Emikooh G Dec. 25, 2025, 4:17 a.m. OK PyPy 3-64 TESTS 7 1234 8089600
354907726 hdisjc G Dec. 24, 2025, 8:40 a.m. OK PyPy 3-64 TESTS 7 1265 9830400
355001972 twosquares G Dec. 25, 2025, 2:57 a.m. OK PyPy 3-64 TESTS 7 1343 9932800
354935280 RUTHVIK0811 G Dec. 24, 2025, 12:19 p.m. OK PyPy 3-64 TESTS 7 1359 9625600
354877371 Haire G Dec. 24, 2025, 1:32 a.m. OK PyPy 3-64 TESTS 7 1375 9216000
354871969 gdstw G Dec. 23, 2025, 10:18 p.m. OK PyPy 3-64 TESTS 7 1375 10035200
354874588 gardengnome G Dec. 23, 2025, 11:47 p.m. OK PyPy 3-64 TESTS 7 1531 14745600
354878112 mxq G Dec. 24, 2025, 1:56 a.m. OK Python 3 TESTS 7 1171 2252800
354954314 Spheniscine G Dec. 24, 2025, 2:39 p.m. OK Rust 2021 TESTS 7 265 0
354926266 urectanc G Dec. 24, 2025, 11:08 a.m. OK Rust 2024 TESTS 7 187 0

remove filters

Back to search problems