Codeforces Round 1049 (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
2140 Codeforces Round 1049 (Div. 2) FINISHED False 7200 18977123 Sept. 9, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 2085 ) E1 Prime Gaming (Easy Version) PROGRAMMING bitmasks combinatorics dp

This is the easy version of the problem. The difference between the versions is that in this version, (m \le 2). You can hack only if you solved all versions of this problem. A valid configuration is defined as an arrangement of (n) piles of stones such that: The number of stones in each pile is an integer between (1) and (m) (both inclusive). Given a valid configuration of (n) piles of stones, some indices from (1) to (n) are marked as good . Alice and Bob start playing a game taking (n-1) turns alternately with Alice going first. In each turn, they have to perform the following operation: Choose any integer (i) such that (1 \le i \le p) (where (p) is the number of piles left) and (i) is good , and remove the (i)-th pile completely. Note that after performing the operation once, the number of piles decreases by (1) and the remaining piles are re-indexed. The game will end when there is only one pile left. It is guaranteed that the index (1) is always good. Let (x) denote the number of stones in the final remaining pile. Alice wants to maximize (x), whereas Bob wants to minimize it. Both Alice and Bob play optimally. Find the sum of (x) over all the possible valid configurations modulo (10 ^ 9 + 7). Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^4)). The description of the test cases follows. The first line of each testcase contains two integers (n) ((1 \le n \le 20)) and (m) ((1 \le m \le 2)) — the number of piles and the upper bound on the number of stones in a pile. The second line of each testcase contains a single integer (k) ((1 \le k \le n)) — the number of indices marked as good. The third line of each testcase contains (k) integers (c_1,c_2,\ldots,c_k) ((1=c_1<c_2<\ldots<c_k\le n)) — the good indices. It is guaranteed that (1) is always a good index (i.e. $$$c_1=1

Tutorials

Codeforces Round 1049 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
337840510 -firefly- E1 Sept. 9, 2025, 4:19 p.m. OK C# 13 TESTS 61 171 9011200
337856277 VaHiX E1 Sept. 9, 2025, 5:43 p.m. OK C++17 (GCC 7-32) TESTS 61 77 102400
337867697 weebyes E1 Sept. 9, 2025, 7:31 p.m. OK C++17 (GCC 7-32) TESTS 61 93 0
337847130 pyromon E1 Sept. 9, 2025, 4:33 p.m. OK C++17 (GCC 7-32) TESTS 61 93 0
337840723 ONE_LAST_SHOT E1 Sept. 9, 2025, 4:20 p.m. OK C++17 (GCC 7-32) TESTS 61 93 17715200
337878966 Papaulo E1 Sept. 9, 2025, 10:55 p.m. OK C++17 (GCC 7-32) TESTS 61 93 22118400
337838671 Khushi_agr E1 Sept. 9, 2025, 4:15 p.m. OK C++17 (GCC 7-32) TESTS 61 109 0
337845141 CuteJerry E1 Sept. 9, 2025, 4:29 p.m. OK C++17 (GCC 7-32) TESTS 61 109 3481600
337845869 asdasdqwer E1 Sept. 9, 2025, 4:30 p.m. OK C++17 (GCC 7-32) TESTS 61 109 6656000
337847209 TT_FAN E1 Sept. 9, 2025, 4:33 p.m. OK C++17 (GCC 7-32) TESTS 61 109 8704000
337846419 adb126 E1 Sept. 9, 2025, 4:31 p.m. OK C++17 (GCC 7-32) TESTS 61 124 0
337847340 Avknih E1 Sept. 9, 2025, 4:33 p.m. OK C++20 (GCC 13-64) TESTS 61 93 0
337846451 navinzoro7 E1 Sept. 9, 2025, 4:32 p.m. OK C++20 (GCC 13-64) TESTS 61 93 0
337841421 _Bibekshah E1 Sept. 9, 2025, 4:21 p.m. OK C++20 (GCC 13-64) TESTS 61 93 102400
337846412 Announcement E1 Sept. 9, 2025, 4:31 p.m. OK C++20 (GCC 13-64) TESTS 61 93 4608000
337847102 dingdong E1 Sept. 9, 2025, 4:33 p.m. OK C++20 (GCC 13-64) TESTS 61 93 9830400
337845562 XYSND E1 Sept. 9, 2025, 4:30 p.m. OK C++20 (GCC 13-64) TESTS 61 93 11468800
337850651 Calculatelove E1 Sept. 9, 2025, 5:04 p.m. OK C++20 (GCC 13-64) TESTS 61 93 88268800
337855333 Inkyo E1 Sept. 9, 2025, 5:36 p.m. OK C++20 (GCC 13-64) TESTS 61 108 102400
337847536 iordache_ E1 Sept. 9, 2025, 4:33 p.m. OK C++20 (GCC 13-64) TESTS 61 108 102400
337844898 SardorbekDev E1 Sept. 9, 2025, 4:29 p.m. OK C++20 (GCC 13-64) TESTS 61 108 102400
337866629 Gemini__ E1 Sept. 9, 2025, 7:19 p.m. OK C++23 (GCC 14-64, msys2) TESTS 61 77 102400
337891804 424479543 E1 Sept. 10, 2025, 3:14 a.m. OK C++23 (GCC 14-64, msys2) TESTS 61 77 512000
337856762 Monjur_Hossain_Shovon43 E1 Sept. 9, 2025, 5:47 p.m. OK C++23 (GCC 14-64, msys2) TESTS 61 92 102400
337847215 Flowing_Light E1 Sept. 9, 2025, 4:33 p.m. OK C++23 (GCC 14-64, msys2) TESTS 61 92 102400
337898627 yinyao E1 Sept. 10, 2025, 4:53 a.m. OK C++23 (GCC 14-64, msys2) TESTS 61 92 44134400
337845896 yugvarshney930 E1 Sept. 9, 2025, 4:30 p.m. OK C++23 (GCC 14-64, msys2) TESTS 61 93 0
337841420 rejoansardar E1 Sept. 9, 2025, 4:21 p.m. OK C++23 (GCC 14-64, msys2) TESTS 61 93 0
337858018 Oxitocina E1 Sept. 9, 2025, 5:57 p.m. OK C++23 (GCC 14-64, msys2) TESTS 61 93 102400
337851307 skebeb E1 Sept. 9, 2025, 5:08 p.m. OK C++23 (GCC 14-64, msys2) TESTS 61 93 102400
337847968 IMoroz E1 Sept. 9, 2025, 4:34 p.m. OK C++23 (GCC 14-64, msys2) TESTS 61 93 102400
337846252 Cybuster E1 Sept. 9, 2025, 4:31 p.m. OK D TESTS 61 124 2662400
337846899 Gassa E1 Sept. 9, 2025, 4:32 p.m. OK D TESTS 61 187 3174400
337885058 MaxBuzz E1 Sept. 10, 2025, 1:15 a.m. OK Java 21 TESTS 61 374 4608000
337872957 vineetiwari E1 Sept. 9, 2025, 8:46 p.m. OK Java 21 TESTS 61 1062 239923200
337838364 kapilkundu1380 E1 Sept. 9, 2025, 4:15 p.m. OK Java 8 TESTS 61 327 0
337842162 TuanKiet2004 E1 Sept. 9, 2025, 4:23 p.m. OK Kotlin 1.7 TESTS 61 733 152473600
337838693 robiulawal1aa E1 Sept. 9, 2025, 4:15 p.m. OK Kotlin 2.2 TESTS 61 421 0
337867906 ikrpprppp E1 Sept. 9, 2025, 7:34 p.m. OK Kotlin 2.2 TESTS 61 608 1638400
337847239 AxJx41 E1 Sept. 9, 2025, 4:33 p.m. OK PyPy 3-64 TESTS 61 358 14643200
337853160 KawaiiKlee E1 Sept. 9, 2025, 5:20 p.m. OK PyPy 3-64 TESTS 61 389 14745600
337865859 Nikrien E1 Sept. 9, 2025, 7:11 p.m. OK PyPy 3-64 TESTS 61 640 19148800
337838317 smz.26 E1 Sept. 9, 2025, 4:15 p.m. OK PyPy 3-64 TESTS 61 749 26112000
337845172 Pulkit_gupta E1 Sept. 9, 2025, 4:29 p.m. OK PyPy 3-64 TESTS 61 750 19251200
337839386 yupooh E1 Sept. 9, 2025, 4:17 p.m. OK PyPy 3-64 TESTS 61 780 179302400
337839699 kirillovich E1 Sept. 9, 2025, 4:18 p.m. OK PyPy 3-64 TESTS 61 1046 29286400
337894225 Little_Sheep_Yawn E1 Sept. 10, 2025, 3:51 a.m. OK PyPy 3-64 TESTS 61 1077 358400000
337850552 omarsaifeldeen2000 E1 Sept. 9, 2025, 5:04 p.m. OK PyPy 3-64 TESTS 61 1155 19046400
337844650 kamio-misuzu E1 Sept. 9, 2025, 4:28 p.m. OK PyPy 3-64 TESTS 61 1202 36044800
337841391 lyteabovenyte E1 Sept. 9, 2025, 4:21 p.m. OK Rust 2021 TESTS 61 202 0
337839931 JKS_007 E1 Sept. 9, 2025, 4:18 p.m. OK Rust 2024 TESTS 61 93 102400
337892222 vmhung E1 Sept. 10, 2025, 3:20 a.m. OK Rust 2024 TESTS 61 109 102400

remove filters

Back to search problems