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
( 384 ) F2 Monotone Monochrome Matrices (Hard Version) PROGRAMMING data structures

This is the hard version of the problem. The difference between the versions is that in this version, the constraints on (n) and (q) are very large. 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 \color{red}{2\,000\,000}), (1 \le q \le \min(n^2,\color{red}{2\,000\,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 $$$\color{red}{2\,000

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
364082229 potato167 F2 Feb. 23, 2026, 4 p.m. OK C++17 (GCC 7-32) TESTS 52 1015 36249600
364101715 orzchenhaoxuan F2 Feb. 23, 2026, 4:59 p.m. OK C++17 (GCC 7-32) TESTS 52 1078 28160000
364100297 t1e1 F2 Feb. 23, 2026, 4:54 p.m. OK C++17 (GCC 7-32) TESTS 52 1093 92569600
364109706 temporary1 F2 Feb. 23, 2026, 6:08 p.m. OK C++17 (GCC 7-32) TESTS 52 1937 42188800
364141819 keisuke6 F2 Feb. 24, 2026, 2:07 a.m. OK C++17 (GCC 7-32) TESTS 52 3468 151347200
364122629 momo_chutney F2 Feb. 23, 2026, 8:23 p.m. OK C++20 (GCC 13-64) TESTS 52 781 20275200
364112958 turneja F2 Feb. 23, 2026, 6:37 p.m. OK C++20 (GCC 13-64) TESTS 52 828 24166400
364120726 Rafi22 F2 Feb. 23, 2026, 8 p.m. OK C++20 (GCC 13-64) TESTS 52 828 40140800
364117969 BRUHHHHHHH F2 Feb. 23, 2026, 7:28 p.m. OK C++20 (GCC 13-64) TESTS 52 859 36249600
364096028 Z-301 F2 Feb. 23, 2026, 4:40 p.m. OK C++20 (GCC 13-64) TESTS 52 859 40140800
364084737 GekkouHe F2 Feb. 23, 2026, 4:07 p.m. OK C++20 (GCC 13-64) TESTS 52 890 24064000
364101145 Rubikun F2 Feb. 23, 2026, 4:57 p.m. OK C++20 (GCC 13-64) TESTS 52 890 44339200
364098822 CleinCc F2 Feb. 23, 2026, 4:50 p.m. OK C++20 (GCC 13-64) TESTS 52 906 24166400
364113076 MCJPSS F2 Feb. 23, 2026, 6:38 p.m. OK C++20 (GCC 13-64) TESTS 52 906 64204800
364148611 shqrky F2 Feb. 24, 2026, 4:19 a.m. OK C++20 (GCC 13-64) TESTS 52 906 86630400
364086552 tickcross.y F2 Feb. 23, 2026, 4:12 p.m. OK C++23 (GCC 14-64, msys2) TESTS 52 296 42188800
364106968 BurnedChicken F2 Feb. 23, 2026, 5:47 p.m. OK C++23 (GCC 14-64, msys2) TESTS 52 531 36454400
364153680 beaaaan F2 Feb. 24, 2026, 5:44 a.m. OK C++23 (GCC 14-64, msys2) TESTS 52 812 36352000
364108321 rgnerdplayer F2 Feb. 23, 2026, 5:57 p.m. OK C++23 (GCC 14-64, msys2) TESTS 52 828 20275200
364110537 njwrz F2 Feb. 23, 2026, 6:15 p.m. OK C++23 (GCC 14-64, msys2) TESTS 52 828 32153600
364102770 DeoMuonCodeNuaDau F2 Feb. 23, 2026, 5:02 p.m. OK C++23 (GCC 14-64, msys2) TESTS 52 828 48128000
364102092 alexwice F2 Feb. 23, 2026, 5 p.m. OK C++23 (GCC 14-64, msys2) TESTS 52 843 20275200
364091163 whu_loser F2 Feb. 23, 2026, 4:25 p.m. OK C++23 (GCC 14-64, msys2) TESTS 52 843 28364800
364113310 mfaiz_1 F2 Feb. 23, 2026, 6:41 p.m. OK C++23 (GCC 14-64, msys2) TESTS 52 859 20275200
364108454 OIer_kzc F2 Feb. 23, 2026, 5:58 p.m. OK C++23 (GCC 14-64, msys2) TESTS 52 859 20275200
364126379 __baozii__ F2 Feb. 23, 2026, 9:05 p.m. OK Kotlin 2.2 TESTS 52 1093 84992000
364138112 smilences F2 Feb. 24, 2026, 12:34 a.m. OK PyPy 3-64 TESTS 52 1343 155443200
364092846 p_a_r_k_j_u_n_e F2 Feb. 23, 2026, 4:30 p.m. OK PyPy 3-64 TESTS 52 1515 183091200
364142045 smilences F2 Feb. 24, 2026, 2:12 a.m. OK PyPy 3-64 TESTS 52 3484 79872000
364094990 Mon_ster F2 Feb. 23, 2026, 4:37 p.m. OK Rust 2024 TESTS 52 328 105984000

remove filters

Back to search problems