Codeforces Round 1051 (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
2143 Codeforces Round 1051 (Div. 2) FINISHED False 7200 18285923 Sept. 17, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 6349 ) D1 Inversion Graph Coloring (Easy Version) PROGRAMMING binary search data structures dp two pointers

This is the easy version of the problem. The difference between the versions is that in this version, (n \le 300). You can hack only if you solved all versions of this problem. A sequence (b_1, b_2, \ldots, b_k) is called good if there exists a coloring of each index (i) in red or blue such that for every pair of indices (i < j) with (b_i > b_j), the colors assigned to (i) and (j) are different. You are given a sequence (a_1, a_2, \ldots, a_n). Compute the number of good subsequences of the sequence, including the empty subsequence(^{\text{∗}}). Since the answer can be very large, output it modulo (10^9 + 7). (^{\text{∗}})A sequence (b) is a subsequence of a sequence (a) if (b) can be obtained from (a) by the deletion of several (possibly, zero or all) element from arbitrary positions. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 100)). The description of the test cases follows. The first line contains an integer (n) ((1 \leq n \leq 300)) — the length of the sequence The second line contains (n) integers (a_1, a_2, \ldots, a_n) ((1 \le a_i \le n)) — the contents of the sequence. It is guaranteed that the sum of (n) over all test cases does not exceed (300). For each test case, output a single line containing the number of good subsequences modulo (10^9 + 7). In the first test case, the subsequences that are not good are (4, 3, 1), (4, 2, 1), and (4, 2, 3, 1). Since there are (16) subsequences in total, this means there are (16 - 3 = 13) good subsequences. In the third test case, every subsequence is good.

Tutorials

Codeforces Round 1051 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
339149460 shg0830 D1 Sept. 17, 2025, 4:17 p.m. OK C++17 (GCC 7-32) TESTS 16 46 0
339148902 Senthil_01 D1 Sept. 17, 2025, 4:16 p.m. OK C++17 (GCC 7-32) TESTS 16 46 0
339203850 cirnovlove D1 Sept. 18, 2025, 4:49 a.m. OK C++17 (GCC 7-32) TESTS 16 46 102400
339151068 _Leon D1 Sept. 17, 2025, 4:22 p.m. OK C++17 (GCC 7-32) TESTS 16 46 48332800
339154880 anik2000s D1 Sept. 17, 2025, 4:32 p.m. OK C++17 (GCC 7-32) TESTS 16 61 0
339143023 Jimanbanashi D1 Sept. 17, 2025, 4 p.m. OK C++17 (GCC 7-32) TESTS 16 61 48640000
339199766 torn4dom4n D1 Sept. 18, 2025, 3:36 a.m. OK C++17 (GCC 7-32) TESTS 16 61 72396800
339191231 Regisdes D1 Sept. 18, 2025, 1:28 a.m. OK C++17 (GCC 7-32) TESTS 16 62 0
339170596 TsotneSV D1 Sept. 17, 2025, 6:38 p.m. OK C++17 (GCC 7-32) TESTS 16 62 0
339153204 TheRealJson D1 Sept. 17, 2025, 4:27 p.m. OK C++17 (GCC 7-32) TESTS 16 62 0
339190922 volcano_2025 D1 Sept. 18, 2025, 1:20 a.m. OK C++20 (GCC 13-64) TESTS 16 46 0
339179869 seekworser D1 Sept. 17, 2025, 8:40 p.m. OK C++20 (GCC 13-64) TESTS 16 46 0
339174468 NotFound D1 Sept. 17, 2025, 7:21 p.m. OK C++20 (GCC 13-64) TESTS 16 46 0
339167613 Galaxy_Ivan D1 Sept. 17, 2025, 6:12 p.m. OK C++20 (GCC 13-64) TESTS 16 46 0
339161490 BaarishBoy D1 Sept. 17, 2025, 5:29 p.m. OK C++20 (GCC 13-64) TESTS 16 46 0
339145678 stdb_laster D1 Sept. 17, 2025, 4:07 p.m. OK C++20 (GCC 13-64) TESTS 16 46 0
339190101 TheRedStone D1 Sept. 18, 2025, 1 a.m. OK C++20 (GCC 13-64) TESTS 16 46 204800
339171069 cacteyy D1 Sept. 17, 2025, 6:43 p.m. OK C++20 (GCC 13-64) TESTS 16 61 0
339149271 kerembozkaya D1 Sept. 17, 2025, 4:17 p.m. OK C++20 (GCC 13-64) TESTS 16 61 0
339147026 xgnd D1 Sept. 17, 2025, 4:10 p.m. OK C++20 (GCC 13-64) TESTS 16 61 0
339208279 LHaooo D1 Sept. 18, 2025, 5:49 a.m. OK C++23 (GCC 14-64, msys2) TESTS 16 46 0
339201385 JahonaliX D1 Sept. 18, 2025, 4:03 a.m. OK C++23 (GCC 14-64, msys2) TESTS 16 46 0
339196939 ljh537ljh D1 Sept. 18, 2025, 2:57 a.m. OK C++23 (GCC 14-64, msys2) TESTS 16 46 0
339195171 Van_Co_Duy_Nhat D1 Sept. 18, 2025, 2:34 a.m. OK C++23 (GCC 14-64, msys2) TESTS 16 46 0
339191174 Yuanyin26 D1 Sept. 18, 2025, 1:27 a.m. OK C++23 (GCC 14-64, msys2) TESTS 16 46 0
339184664 snowdust D1 Sept. 17, 2025, 10:35 p.m. OK C++23 (GCC 14-64, msys2) TESTS 16 46 204800
339206975 Algodding D1 Sept. 18, 2025, 5:34 a.m. OK C++23 (GCC 14-64, msys2) TESTS 16 46 2355200
339200343 Mohammad_Hacker D1 Sept. 18, 2025, 3:44 a.m. OK C++23 (GCC 14-64, msys2) TESTS 16 46 8089600
339201606 hundunlilun1 D1 Sept. 18, 2025, 4:07 a.m. OK C++23 (GCC 14-64, msys2) TESTS 16 46 32460800
339193261 danio1029 D1 Sept. 18, 2025, 2:02 a.m. OK C++23 (GCC 14-64, msys2) TESTS 16 46 32460800
339153659 yrkondane D1 Sept. 17, 2025, 4:28 p.m. OK GNU C11 TESTS 16 124 1433600
339144909 pengin_2000 D1 Sept. 17, 2025, 4:04 p.m. OK GNU C11 TESTS 16 156 819200
339146419 tranquyetthang281 D1 Sept. 17, 2025, 4:09 p.m. OK Go TESTS 16 109 819200
339176232 MaxBuzz D1 Sept. 17, 2025, 7:44 p.m. OK Java 21 TESTS 16 249 1126400
339171620 MaxBuzz D1 Sept. 17, 2025, 6:48 p.m. OK Java 21 TESTS 16 281 819200
339153555 david_jeldi D1 Sept. 17, 2025, 4:28 p.m. OK Java 21 TESTS 16 311 1228800
339148425 Samyajit125 D1 Sept. 17, 2025, 4:14 p.m. OK Java 21 TESTS 16 327 409600
339161328 MaxBuzz D1 Sept. 17, 2025, 5:28 p.m. OK Java 21 TESTS 16 327 614400
339161085 vineetiwari D1 Sept. 17, 2025, 5:27 p.m. OK Java 21 TESTS 16 343 819200
339155959 siddnt D1 Sept. 17, 2025, 4:34 p.m. OK Java 21 TESTS 16 343 1126400
339153907 Harshith125 D1 Sept. 17, 2025, 4:29 p.m. OK Java 21 TESTS 16 374 1024000
339153199 nikhil.chahar_cs23 D1 Sept. 17, 2025, 4:27 p.m. OK Java 21 TESTS 16 374 1024000
339160608 nabina1395 D1 Sept. 17, 2025, 5:24 p.m. OK Java 21 TESTS 16 437 146022400
339155227 jishan5544 D1 Sept. 17, 2025, 4:32 p.m. OK Java 8 TESTS 16 281 0
339145922 kasiru_69 D1 Sept. 17, 2025, 4:07 p.m. OK Java 8 TESTS 16 281 78336000
339154846 bhawnapannu27 D1 Sept. 17, 2025, 4:31 p.m. OK Java 8 TESTS 16 390 0
339177717 yashbansal99 D1 Sept. 17, 2025, 8:06 p.m. OK Java 8 TESTS 16 405 154112000
339146375 enan_mahmud D1 Sept. 17, 2025, 4:09 p.m. OK Java 8 TESTS 16 577 0
339195964 testtest111ksjfrdvn D1 Sept. 18, 2025, 2:45 a.m. OK Java 8 TESTS 16 625 264294400
339150132 Cyros D1 Sept. 17, 2025, 4:19 p.m. OK PyPy 2 TESTS 16 359 12492800
339151729 AL_Qiswa D1 Sept. 17, 2025, 4:23 p.m. OK PyPy 3 TESTS 16 358 13004800
339202720 KhoiLe2010 D1 Sept. 18, 2025, 4:28 a.m. OK PyPy 3 TESTS 16 374 13004800
339143977 lihanitastic_47 D1 Sept. 17, 2025, 4:02 p.m. OK PyPy 3 TESTS 16 609 9523200
339155672 honeybutterwaffle D1 Sept. 17, 2025, 4:33 p.m. OK PyPy 3 TESTS 16 1546 225792000
339153269 Arivoli D1 Sept. 17, 2025, 4:28 p.m. OK PyPy 3 TESTS 16 1624 16896000
339177974 DT4V D1 Sept. 17, 2025, 8:10 p.m. OK PyPy 3-64 TESTS 16 186 7577600
339191238 czjnbb D1 Sept. 18, 2025, 1:28 a.m. OK PyPy 3-64 TESTS 16 187 6144000
339180635 VladIvanov D1 Sept. 17, 2025, 8:53 p.m. OK PyPy 3-64 TESTS 16 202 6553600
339149943 GreySpecter D1 Sept. 17, 2025, 4:18 p.m. OK PyPy 3-64 TESTS 16 218 3276800
339165214 34z12000 D1 Sept. 17, 2025, 5:54 p.m. OK PyPy 3-64 TESTS 16 233 9728000
339162459 helltractor D1 Sept. 17, 2025, 5:35 p.m. OK PyPy 3-64 TESTS 16 249 8396800
339147183 anry09 D1 Sept. 17, 2025, 4:11 p.m. OK PyPy 3-64 TESTS 16 265 3174400
339154027 Kyrillos_Ashraf D1 Sept. 17, 2025, 4:29 p.m. OK PyPy 3-64 TESTS 16 327 3174400
339184150 TNTNTN D1 Sept. 17, 2025, 10:19 p.m. OK PyPy 3-64 TESTS 16 389 17612800
339184382 mathsplanck D1 Sept. 17, 2025, 10:26 p.m. OK PyPy 3-64 TESTS 16 390 17612800
339151265 avdhoot001 D1 Sept. 17, 2025, 4:22 p.m. OK Python 3 TESTS 16 1093 3993600
339154839 shreyynshh D1 Sept. 17, 2025, 4:31 p.m. OK Python 3 TESTS 16 1812 3788800
339155342 Old_Newbie_1 D1 Sept. 17, 2025, 4:33 p.m. OK Python 3 TESTS 16 1859 2457600
339146614 Sanskar55 D1 Sept. 17, 2025, 4:09 p.m. OK Python 3 TESTS 16 2202 3584000
339151025 MDelPiero D1 Sept. 17, 2025, 4:21 p.m. OK Python 3 TESTS 16 2265 2150400
339154131 abhinavnayak21 D1 Sept. 17, 2025, 4:30 p.m. OK Python 3 TESTS 16 2374 2355200
339154742 Hem08 D1 Sept. 17, 2025, 4:31 p.m. OK Python 3 TESTS 16 2656 4300800
339146938 Grinder_69 D1 Sept. 17, 2025, 4:10 p.m. OK Ruby 3 TESTS 16 2265 10444800
339167252 WORTH D1 Sept. 17, 2025, 6:09 p.m. OK Rust 2024 TESTS 16 249 113971200

remove filters

Back to search problems