Codeforces Round 1032 (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
2121 Codeforces Round 1032 (Div. 3) FINISHED False 8100 26234723 June 17, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 2215 ) H Ice Baby PROGRAMMING binary search brute force data structures dp implementation sortings

The longest non-decreasing subsequence of an array of integers (a_1, a_2, \ldots, a_n) is the longest sequence of indices (1 \leq i_1 < i_2 < \ldots < i_k \leq n) such that (a_{i_1} \leq a_{i_2} \leq \ldots \leq a_{i_k}). The length of the sequence is defined as the number of elements in the sequence. For example, the length of the longest non-decreasing subsequence of the array (a = 3, 1, 4, 1, 2) is (3). You are given two arrays of integers (l_1, l_2, \ldots, l_n) and (r_1, r_2, \ldots, r_n). For each (1 \le k \le n), solve the following problem: Consider all arrays of integers (a) of length (k), such that for each (1 \leq i \leq k), it holds that (l_i \leq a_i \leq r_i). Find the maximum length of the longest non-decreasing subsequence among all such arrays. Each test consists of multiple test cases. The first line contains a single integer (t) ((1 \leq t \leq 10^4)) — the number of test cases. The description of the test cases follows. The first line of each test case contains a single integer (n) ((1 \leq n \leq 2 \cdot 10^5)) — the length of the arrays (l) and (r). The next (n) lines of each test case contain two integers (l_i) and (r_i) ((1 \leq l_i \leq r_i \leq 10^9)). It is guaranteed that the sum of (n) across all test cases does not exceed (2 \cdot 10^5). For each test case, output (n) integers: for each (k) from (1) to (n), output the maximum length of the longest non-decreasing subsequence among all suitable arrays. In the first test case, the only possible array is (a = 1). The length of the longest non-decreasing subsequence of this array is (1). In the second test case, for (k = 2), no matter how we choose the values of (a_1) and (a_2), the condition (a_1 > a_2) will always hold. Therefore, the answer for (k = 2) will be (1). In the third test case, for (k = 4), we can choose the array $$$a

Tutorials

Codeforces Round 1032 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
324929114 og.kostya H June 17, 2025, 5:31 p.m. OK C# 10 TESTS 26 265 8294400
324929177 og.kostya H June 17, 2025, 5:32 p.m. OK C# 13 TESTS 26 312 9830400
324956541 mainnahihoo H June 17, 2025, 10:13 p.m. OK C++17 (GCC 7-32) TESTS 26 218 3072000
324949383 Din_ED H June 17, 2025, 7:53 p.m. OK C++17 (GCC 7-32) TESTS 26 234 4300800
324942605 __RS__ H June 17, 2025, 6:33 p.m. OK C++17 (GCC 7-32) TESTS 26 249 3072000
324944532 hmms127 H June 17, 2025, 6:53 p.m. OK C++17 (GCC 7-32) TESTS 26 249 6246400
324975834 999663 H June 18, 2025, 4:26 a.m. OK C++17 (GCC 7-32) TESTS 26 250 2969600
324955612 mayankhere567 H June 17, 2025, 9:47 p.m. OK C++17 (GCC 7-32) TESTS 26 250 3072000
324926383 tokitsukaze H June 17, 2025, 5:12 p.m. OK C++17 (GCC 7-32) TESTS 26 250 3891200
324923146 Code937 H June 17, 2025, 4:54 p.m. OK C++17 (GCC 7-32) TESTS 26 250 19148800
324925718 tuanha H June 17, 2025, 5:07 p.m. OK C++17 (GCC 7-32) TESTS 26 264 1843200
324959559 transfeft H June 18, 2025, 12:02 a.m. OK C++17 (GCC 7-32) TESTS 26 264 3072000
324926604 ngsihnoc H June 17, 2025, 5:14 p.m. OK C++20 (GCC 13-64) TESTS 26 171 6758400
324975358 valavshonok H June 18, 2025, 4:20 a.m. OK C++20 (GCC 13-64) TESTS 26 186 6758400
324949360 altayeb_132 H June 17, 2025, 7:53 p.m. OK C++20 (GCC 13-64) TESTS 26 186 8396800
324970536 zuiyuyu H June 18, 2025, 3:25 a.m. OK C++20 (GCC 13-64) TESTS 26 187 6758400
324946287 Nxxlt H June 17, 2025, 7:14 p.m. OK C++20 (GCC 13-64) TESTS 26 187 6758400
324941823 fanhuaxingyu H June 17, 2025, 6:25 p.m. OK C++20 (GCC 13-64) TESTS 26 187 6758400
324956710 fazliddin2001 H June 17, 2025, 10:18 p.m. OK C++20 (GCC 13-64) TESTS 26 202 6758400
324956198 MEDAA H June 17, 2025, 10:02 p.m. OK C++20 (GCC 13-64) TESTS 26 202 6758400
324951156 876pol H June 17, 2025, 8:21 p.m. OK C++20 (GCC 13-64) TESTS 26 202 6758400
324949693 Magrig8 H June 17, 2025, 7:57 p.m. OK C++20 (GCC 13-64) TESTS 26 202 6758400
324960770 xzc426_0vo H June 18, 2025, 12:40 a.m. OK C++23 (GCC 14-64, msys2) TESTS 26 187 6860800
324940506 jackle H June 17, 2025, 6:13 p.m. OK C++23 (GCC 14-64, msys2) TESTS 26 187 6860800
324948109 moderax_drax H June 17, 2025, 7:37 p.m. OK C++23 (GCC 14-64, msys2) TESTS 26 187 7577600
324962041 sanbi52 H June 18, 2025, 1:09 a.m. OK C++23 (GCC 14-64, msys2) TESTS 26 187 8396800
324956361 ZeppZeppelin H June 17, 2025, 10:07 p.m. OK C++23 (GCC 14-64, msys2) TESTS 26 187 10035200
324979491 ucode.vn H June 18, 2025, 5:05 a.m. OK C++23 (GCC 14-64, msys2) TESTS 26 202 6758400
324961357 MinhQuangCVP H June 18, 2025, 12:54 a.m. OK C++23 (GCC 14-64, msys2) TESTS 26 202 6758400
324940803 alyalnmr H June 17, 2025, 6:16 p.m. OK C++23 (GCC 14-64, msys2) TESTS 26 202 6758400
324938330 Folka H June 17, 2025, 5:53 p.m. OK C++23 (GCC 14-64, msys2) TESTS 26 202 6758400
324973380 Heshi H June 18, 2025, 3:58 a.m. OK C++23 (GCC 14-64, msys2) TESTS 26 202 6860800
324938434 kasiru_69 H June 17, 2025, 5:54 p.m. OK Java 8 TESTS 26 890 4505600
324980350 rocker2801 H June 18, 2025, 5:14 a.m. OK Node.js TESTS 26 1405 100454400
324967807 DeadMan69 H June 18, 2025, 2:47 a.m. OK PyPy 3-64 TESTS 26 546 22425600
324978392 kamio-misuzu H June 18, 2025, 4:54 a.m. OK PyPy 3-64 TESTS 26 593 52940800
324976868 kamio-misuzu H June 18, 2025, 4:38 a.m. OK PyPy 3-64 TESTS 26 655 55193600
324971705 hxu10 H June 18, 2025, 3:39 a.m. OK PyPy 3-64 TESTS 26 781 73625600
324926767 krism H June 17, 2025, 5:15 p.m. OK PyPy 3-64 TESTS 26 1124 66048000
324927070 krism H June 17, 2025, 5:17 p.m. OK PyPy 3-64 TESTS 26 1140 64307200
324977585 kamio-misuzu H June 18, 2025, 4:45 a.m. OK PyPy 3-64 TESTS 26 1280 77209600
324950411 Ayis137 H June 17, 2025, 8:08 p.m. OK PyPy 3-64 TESTS 26 1968 395673600
324950231 Ayis137 H June 17, 2025, 8:06 p.m. OK PyPy 3-64 TESTS 26 1983 132812800

remove filters

Back to search problems