Codeforces Round 1025 (Div. 2)

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
2109 Codeforces Round 1025 (Div. 2) FINISHED False 8100 28913123 May 17, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 270 ) F Penguin Steps PROGRAMMING binary search dfs and similar flows graphs shortest paths

Mouf, the clever master of Darkness, and Fouad, the brave champion of Light, have entered the Grid Realm once more. This time, they have found the exit, but it is guarded by fierce monsters! They must fight with their bare hands instead of summoning monsters! Mouf and Fouad are standing on an (n \times n) grid. Each cell ((i, j)) has a value (a_{i,j}) and a color. The color of a cell is white if (c_{i,j} = 0) and black if (c_{i,j} = 1). Mouf starts at the top-left corner ((1, 1)), and Fouad starts at the bottom-left corner ((n, 1)). Both are trying to reach the exit cell at ((r, n)). A path is defined as a sequence of adjacent cells (sharing a horizontal or vertical edge). The cost of a path is the maximum value of (a_{i, j}) among all cells included in the path (including the first and last cells). Let: (\mathrm{dis}_M) denote the minimum possible cost of a valid path from Mouf's starting position ((1, 1)) to the exit ((r, n)); (\mathrm{dis}_F) denote the minimum possible cost of a valid path from Fouad's starting position ((n, 1)) to the exit ((r, n)). Before moving, Mouf can perform up to (k) operations. In each operation, he may select any black cell and increment its value by (1) (possibly choosing the same cell multiple times). Mouf wants to maximize (\mathrm{dis}_F) while ensuring that his own cost (\mathrm{dis}_M) remains unchanged (as if he performed no operations). If Mouf acts optimally, what are the values of (\mathrm{dis}_M) and (\mathrm{dis}_F)? Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^3)). The description of the test cases follows. The first line of each test case contains three integers (n), (r), and (k) ((2 \le n \le 300), (1 \le r \le n), (0 \le k \le 10^6)) — the length of the grid, the row number of the exit cell, and the number of allowed operations. The

Tutorials

Codeforces Round 1025 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
320156172 Osirix_ F May 17, 2025, 9:05 p.m. OK C++20 (GCC 13-64) TESTS 76 280 512000
320140713 natsugiri F May 17, 2025, 6:16 p.m. OK C++20 (GCC 13-64) TESTS 76 436 1638400
320142983 kaiboy F May 17, 2025, 6:30 p.m. OK C++20 (GCC 13-64) TESTS 76 609 8294400
320161179 _Khaled_Kamal F May 17, 2025, 11:11 p.m. OK C++20 (GCC 13-64) TESTS 76 686 20992000
320164015 MinhQuangCVP F May 18, 2025, 12:51 a.m. OK C++23 (GCC 14-64, msys2) TESTS 76 312 4505600
320158569 LoKl F May 17, 2025, 9:53 p.m. OK C++23 (GCC 14-64, msys2) TESTS 76 374 1331200
320149104 A_G F May 17, 2025, 7:27 p.m. OK C++23 (GCC 14-64, msys2) TESTS 76 406 204800
320145061 innocentkitten F May 17, 2025, 6:46 p.m. OK C++23 (GCC 14-64, msys2) TESTS 76 421 11059200
320145137 lnsuyn F May 17, 2025, 6:47 p.m. OK C++23 (GCC 14-64, msys2) TESTS 76 2452 8294400
320132601 antontrygubO_o F May 17, 2025, 4:47 p.m. OK C++23 (GCC 14-64, msys2) TESTS 76 2499 7168000
320140001 DanielAnker F May 17, 2025, 6:13 p.m. OK Rust 2021 TESTS 76 593 21811200

remove filters

Back to search problems