Codeforces Round 1092 (Unrated, Div. 1, Based on THUPC 2026 — Finals)

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
2215 Codeforces Round 1092 (Unrated, Div. 1, Based on THUPC 2026 — Finals) FINISHED False 10800 4494296 April 12, 2026, 5:35 a.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 67 ) G Maze PROGRAMMING trees

There is an ((n+2) \times (n+2)) grid, where both coordinates range from (0) to (n+1) inclusive. The outermost cells of the grid are all obstacle cells. In addition, there are (m) more obstacle cells in the grid. The (i)-th obstacle cell is located at ((x_i, y_i)). It is guaranteed that all obstacles (including the outer boundary cells) are 4-connected. That is, you can move between any two obstacle cells by moving up, down, left, or right through other obstacle cells. Little L is walking in this maze. He cannot step into any obstacle cell at any time. If Little L is at position ((x, y)), he can make the following moves: Move orthogonally to an adjacent cell ((x+1,y)), ((x-1,y)), ((x,y+1)), or ((x,y-1)) with a cost of (2). Move diagonally to an adjacent cell ((x+1,y+1)), ((x+1,y-1)), ((x-1,y+1)), or ((x-1,y-1)) with a cost of (3). There are (q) queries. For each query, you are given a starting point and an ending point. You need to find the minimum total cost for Little L to travel from the starting point to the ending point. If it is impossible to reach the ending point, output (-1). The first line of the input contains three integers (n), (m), and (q) ((1 \le n \le 10^5), (1 \le m, q \le 3 \cdot 10^5)). The next (m) lines each contain two integers (x_i) and (y_i) — the coordinates of the (i)-th obstacle cell. It is guaranteed that all obstacle coordinates are distinct, and that all obstacles (including the outer boundary cells) are 4-connected. The next (q) lines each contain four integers (s_x), (s_y), (t_x), and (t_y) — a query with starting point ((s_x, s_y)) and ending point ((t_x, t_y)). It is guaranteed that neither ((s_x,s_y)) nor ((t_x,t_y)) is an obstacle. For each query, output a single integer — the minimum cost to travel from the starting point to the ending point. Or print (-1) if it is impos

Tutorials

152930

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
370878677 wwqq88 G April 13, 2026, 12:55 a.m. OK C++17 (GCC 7-32) TESTS 26 1734 389632000
370826021 wwqq88 G April 12, 2026, 1:08 p.m. OK C++17 (GCC 7-32) TESTS 26 1812 120832000
370824595 Wonter G April 12, 2026, 12:56 p.m. OK C++20 (GCC 13-64) TESTS 26 1500 130457600
370883414 gopal.thecoder G April 13, 2026, 3:29 a.m. OK C++23 (GCC 14-64, msys2) TESTS 26 1375 130560000
370861167 maroonrk G April 12, 2026, 6:37 p.m. OK C++23 (GCC 14-64, msys2) TESTS 26 1500 200089600

remove filters

Back to search problems