Codeforces Round 1082 (Div. 1)

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
2201 Codeforces Round 1082 (Div. 1) FINISHED False 9000 4548323 Feb. 23, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 257 ) F1 Monotone Monochrome Matrices (Medium Version) PROGRAMMING data structures

This is the medium version of the problem. The difference between the versions is that in this version, the constraints on (n) and (q) are larger. You can hack only if you solved all versions of this problem. A monochrome matrix of size (n \times n) is a matrix of (n) rows and (n) columns, where each cell is colored either black or white. Let the color of cell ((r,c)) in a monochrome matrix (C) be denoted as (Cr,c). Let's call such a matrix (C) monotone if it satisfies the following condition: There exist no two rows (1 \le i \lt j \le n) and two columns (1 \le k \lt l \le n) that satisfy the following three conditions: (Ci,k=Cj,l); (Cj,k=Ci,l); (Ci,k \neq Cj,k). (Ci,k=Cj,l); (Cj,k=Ci,l); (Ci,k \neq Cj,k). There is a monochrome matrix (M) of size (n \times n), where all cells are initially white. Please solve (q) queries of the following kind: (r\;c): Change the color of the cell ((r,c)) in (M) to black . Then, determine if (M) is monotone or not. For each query, it is guaranteed that the color of the cell ((r,c)) was white before the query. Do note that the updates are persistent. In other words, the change in color from one query affects the later queries as well. 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 two integers (n) and (q) ((2 \le n \le 200\,000), (1 \le q \le \min(n^2,200\,000))). Each of the (q) following lines contains two integers (r_i), (c_i) denoting the (i)-th query ((1 \le r_i,c_i \le n)). For each query, it is guaranteed that the color of the cell ((r,c)) was white before the query. It is guaranteed that the sum of (n) over all test cases does not exceed (200\,000). It is guaranteed that the sum of $$$q$$

Tutorials

Codeforces Round 1082 (Div. 1, Div. 2) Complete Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
364101028 orzchenhaoxuan F1 Feb. 23, 2026, 4:57 p.m. OK C++17 (GCC 7-32) TESTS 48 140 102400
364099295 t1e1 F1 Feb. 23, 2026, 4:51 p.m. OK C++17 (GCC 7-32) TESTS 48 140 49356800
364101823 thu_khoa_chuyen_hoa F1 Feb. 23, 2026, 4:59 p.m. OK C++17 (GCC 7-32) TESTS 48 156 4915200
364082434 potato167 F1 Feb. 23, 2026, 4:01 p.m. OK C++17 (GCC 7-32) TESTS 48 171 204800
364100028 LiFar F1 Feb. 23, 2026, 4:53 p.m. OK C++17 (GCC 7-32) TESTS 48 171 9625600
364111647 Taha90411 F1 Feb. 23, 2026, 6:25 p.m. OK C++17 (GCC 7-32) TESTS 48 203 2867200
364109622 temporary1 F1 Feb. 23, 2026, 6:08 p.m. OK C++17 (GCC 7-32) TESTS 48 250 4300800
364141120 keisuke6 F1 Feb. 24, 2026, 1:52 a.m. OK C++17 (GCC 7-32) TESTS 48 468 20684800
364092818 Kasane_Teto F1 Feb. 23, 2026, 4:30 p.m. OK C++17 (GCC 7-32) TESTS 48 1296 22118400
364146812 Acheronlt F1 Feb. 24, 2026, 3:47 a.m. OK C++20 (GCC 13-64) TESTS 48 109 102400
364119777 ya_ssh F1 Feb. 23, 2026, 7:48 p.m. OK C++20 (GCC 13-64) TESTS 48 109 102400
364112915 turneja F1 Feb. 23, 2026, 6:37 p.m. OK C++20 (GCC 13-64) TESTS 48 109 24166400
364098732 CleinCc F1 Feb. 23, 2026, 4:49 p.m. OK C++20 (GCC 13-64) TESTS 48 109 24166400
364102135 cuom1999 F1 Feb. 23, 2026, 5 p.m. OK C++20 (GCC 13-64) TESTS 48 125 102400
364084777 GekkouHe F1 Feb. 23, 2026, 4:07 p.m. OK C++20 (GCC 13-64) TESTS 48 125 24166400
364120842 Rafi22 F1 Feb. 23, 2026, 8:01 p.m. OK C++20 (GCC 13-64) TESTS 48 125 40140800
364096066 Z-301 F1 Feb. 23, 2026, 4:40 p.m. OK C++20 (GCC 13-64) TESTS 48 125 40140800
364101046 Rubikun F1 Feb. 23, 2026, 4:57 p.m. OK C++20 (GCC 13-64) TESTS 48 140 1024000
364072011 tourist F1 Feb. 23, 2026, 3:37 p.m. OK C++20 (GCC 13-64) TESTS 48 140 2560000
364080736 tickcross.y F1 Feb. 23, 2026, 3:56 p.m. OK C++23 (GCC 14-64, msys2) TESTS 48 78 6144000
364106683 BurnedChicken F1 Feb. 23, 2026, 5:45 p.m. OK C++23 (GCC 14-64, msys2) TESTS 48 93 409600
364100768 rgnerdplayer F1 Feb. 23, 2026, 4:56 p.m. OK C++23 (GCC 14-64, msys2) TESTS 48 109 102400
364150673 Aldk F1 Feb. 24, 2026, 4:56 a.m. OK C++23 (GCC 14-64, msys2) TESTS 48 109 40140800
364108408 OIer_kzc F1 Feb. 23, 2026, 5:58 p.m. OK C++23 (GCC 14-64, msys2) TESTS 48 125 102400
364108350 GOTKAKO F1 Feb. 23, 2026, 5:57 p.m. OK C++23 (GCC 14-64, msys2) TESTS 48 125 102400
364098194 Joler_ F1 Feb. 23, 2026, 4:48 p.m. OK C++23 (GCC 14-64, msys2) TESTS 48 125 102400
364088996 whu_loser F1 Feb. 23, 2026, 4:19 p.m. OK C++23 (GCC 14-64, msys2) TESTS 48 125 102400
364095618 Sayonara_Eri F1 Feb. 23, 2026, 4:39 p.m. OK C++23 (GCC 14-64, msys2) TESTS 48 125 307200
364102130 RockSnow F1 Feb. 23, 2026, 5 p.m. OK C++23 (GCC 14-64, msys2) TESTS 48 125 1126400
364089100 omaltsev F1 Feb. 23, 2026, 4:19 p.m. OK Haskell TESTS 48 1562 46284800
364119931 Tlatoani F1 Feb. 23, 2026, 7:50 p.m. OK Kotlin 2.2 TESTS 48 1218 61849600
364138100 smilences F1 Feb. 24, 2026, 12:34 a.m. OK PyPy 3-64 TESTS 48 234 20377600
364080021 p_a_r_k_j_u_n_e F1 Feb. 23, 2026, 3:55 p.m. OK PyPy 3-64 TESTS 48 484 24576000
364152185 abhinav4710 F1 Feb. 24, 2026, 5:22 a.m. OK PyPy 3-64 TESTS 48 500 12595200
364091178 Mon_ster F1 Feb. 23, 2026, 4:25 p.m. OK Rust 2024 TESTS 48 62 17920000
364128846 Darknef F1 Feb. 23, 2026, 9:34 p.m. OK Rust 2024 TESTS 48 1921 34611200

remove filters

Back to search problems