Codeforces Round 1008 (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
2078 Codeforces Round 1008 (Div. 2) FINISHED False 9000 34787723 March 10, 2025, 2:45 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 6466 ) D Scammy Game Ad PROGRAMMING dp greedy math

Consider the following game. In this game, a level consists of (n) pairs of gates. Each pair contains one left gate and one right gate. Each gate performs one of two operations: Addition Operation ( + a ): Increases the number of people in a lane by a constant amount (a). Multiplication Operation ( x a ): Multiplies the current number of people in a lane by an integer (a). This means the number of people increases by ((a - 1)) times the current count in that lane. The additional people gained from each operation can be assigned to either lane. However, people already in a lane cannot be moved to the other lane. Initially, there is one person in each lane. Your task is to determine the maximum total number of people that can be achieved by the end of the level. The first line contains an integer (t) ((1 \leq t \leq 10^4)) — the number of test cases. The first line of each test case contains one integer (n) ((1 \leq n \le 30)) — the number of pairs of gates. The next (n) lines of each test case provide the information for the left gate followed by the right gate of each gate pair. The information for each gate is given in the form + (a) ((1 \le a \le 1000)) or x (a) ((2 \le a \le 3)) for some integer (a). For each test case, output a single integer — the maximum total number of people at the end of the level. In the first case, here is one possible way to play this game optimally. Initially, we have (l=1) person in the left lane and (r=1) person in the right lane. After passing through the first pair of gates, we gain (4) people from the left gate and (1 \cdot (2-1) = 1) person from the right gate, for a total of (4+1=5) people. We allocate (2) people to the left lane and (3) people to the right lane. This results in (l=1+2=3) people in the left lane and (r=1+3=4) people in the right lane. After passing through the second pair of gates, we gain (3 \cdot (3-1) = 6)

Tutorials

Codeforces Round 1008 (Div. 1, Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
309905855 Sadman_Ishtiaks D March 11, 2025, 2:57 a.m. OK C++17 (GCC 7-32) TESTS 7 62 4300800
309848732 Sajjat004 D March 10, 2025, 4:45 p.m. OK C++17 (GCC 7-32) TESTS 7 125 4198400
309915353 v1r D March 11, 2025, 5:07 a.m. OK C++17 (GCC 7-32) TESTS 7 140 0
309897978 AminAnv1 D March 11, 2025, 12:43 a.m. OK C++17 (GCC 7-32) TESTS 7 140 0
309850183 Suman_Dalai D March 10, 2025, 4:49 p.m. OK C++17 (GCC 7-32) TESTS 7 140 0
309912648 lmq_maoga D March 11, 2025, 4:35 a.m. OK C++17 (GCC 7-32) TESTS 7 140 102400
309910842 djsksbrbf D March 11, 2025, 4:11 a.m. OK C++17 (GCC 7-32) TESTS 7 140 102400
309895982 limabeans D March 11, 2025, 12:05 a.m. OK C++17 (GCC 7-32) TESTS 7 140 102400
309878932 Specter007 D March 10, 2025, 8:05 p.m. OK C++17 (GCC 7-32) TESTS 7 140 102400
309864221 zoulei2023 D March 10, 2025, 5:59 p.m. OK C++17 (GCC 7-32) TESTS 7 140 102400
309897641 www_bilibili_com D March 11, 2025, 12:38 a.m. OK C++20 (GCC 13-64) TESTS 7 61 204800
309916202 superbestfriend D March 11, 2025, 5:16 a.m. OK C++20 (GCC 13-64) TESTS 7 93 102400
309894998 InvisibleOne D March 10, 2025, 11:42 p.m. OK C++20 (GCC 13-64) TESTS 7 108 102400
309906713 ShiroRinne D March 11, 2025, 3:09 a.m. OK C++20 (GCC 13-64) TESTS 7 109 0
309899296 ThePeak D March 11, 2025, 1:05 a.m. OK C++20 (GCC 13-64) TESTS 7 109 0
309876826 ithos1902 D March 10, 2025, 7:45 p.m. OK C++20 (GCC 13-64) TESTS 7 109 0
309909445 HaitaoWang D March 11, 2025, 3:49 a.m. OK C++20 (GCC 13-64) TESTS 7 109 4096000
309907924 OmarAboutaleb78 D March 11, 2025, 3:26 a.m. OK C++20 (GCC 13-64) TESTS 7 109 4096000
309907910 Donaldqian0712 D March 11, 2025, 3:26 a.m. OK C++20 (GCC 13-64) TESTS 7 109 4096000
309849198 hnust_maoyiyun D March 10, 2025, 4:46 p.m. OK C++20 (GCC 13-64) TESTS 7 109 80179200
309853301 heyyyankit D March 10, 2025, 4:57 p.m. OK C++23 (GCC 14-64, msys2) TESTS 7 77 0
309855419 Flaviuuu D March 10, 2025, 5:03 p.m. OK C++23 (GCC 14-64, msys2) TESTS 7 78 0
309857044 alwaysBelieve D March 10, 2025, 5:07 p.m. OK C++23 (GCC 14-64, msys2) TESTS 7 109 0
309852004 Nader_Osama D March 10, 2025, 4:54 p.m. OK C++23 (GCC 14-64, msys2) TESTS 7 109 0
309904483 AxB-Thomas D March 11, 2025, 2:36 a.m. OK C++23 (GCC 14-64, msys2) TESTS 7 109 11776000
309871034 shubh_aps D March 10, 2025, 6:50 p.m. OK C++23 (GCC 14-64, msys2) TESTS 7 109 11776000
309865640 Malhar_17 D March 10, 2025, 6:08 p.m. OK C++23 (GCC 14-64, msys2) TESTS 7 109 11776000
309913076 Mr.AWang D March 11, 2025, 4:40 a.m. OK C++23 (GCC 14-64, msys2) TESTS 7 124 0
309912266 Whitecarrot D March 11, 2025, 4:30 a.m. OK C++23 (GCC 14-64, msys2) TESTS 7 124 0
309909937 sleepyAdarsh D March 11, 2025, 3:57 a.m. OK C++23 (GCC 14-64, msys2) TESTS 7 124 0
309878855 rainboy D March 10, 2025, 8:04 p.m. OK GNU C11 TESTS 7 218 102400
309920626 Coder_GEAR5 D March 11, 2025, 6:01 a.m. OK Java 21 TESTS 7 389 512000
309853361 Swarnadip_Kar D March 10, 2025, 4:58 p.m. OK Java 21 TESTS 7 483 512000
309856329 yashvardhan3 D March 10, 2025, 5:06 p.m. OK Java 21 TESTS 7 499 614400
309872729 believer_0507 D March 10, 2025, 7:06 p.m. OK Java 21 TESTS 7 499 40140800
309852659 polsage D March 10, 2025, 4:56 p.m. OK Java 21 TESTS 7 531 307200
309854281 priyaroy3370 D March 10, 2025, 5 p.m. OK Java 21 TESTS 7 1327 716800
309897459 SamyajitDas D March 11, 2025, 12:34 a.m. OK Java 8 TESTS 7 312 0
309873624 kamranm D March 10, 2025, 7:14 p.m. OK Java 8 TESTS 7 312 108851200
309860152 dakess D March 10, 2025, 5:14 p.m. OK PyPy 3 TESTS 7 796 25395200
309903187 azerbenmed1730 D March 11, 2025, 2:13 a.m. OK PyPy 3-64 TESTS 7 171 10035200
309876810 wallfacer146 D March 10, 2025, 7:45 p.m. OK PyPy 3-64 TESTS 7 218 9011200
309873985 thanhtrnnn D March 10, 2025, 7:18 p.m. OK PyPy 3-64 TESTS 7 233 8499200
309876138 gardengnome D March 10, 2025, 7:39 p.m. OK PyPy 3-64 TESTS 7 234 8396800
309880731 Aylup D March 10, 2025, 8:23 p.m. OK PyPy 3-64 TESTS 7 234 8908800
309868865 DeadMan69 D March 10, 2025, 6:31 p.m. OK PyPy 3-64 TESTS 7 249 8704000
309879940 Aylup D March 10, 2025, 8:15 p.m. OK PyPy 3-64 TESTS 7 249 8908800
309905620 shiguang12318 D March 11, 2025, 2:54 a.m. OK PyPy 3-64 TESTS 7 249 9625600
309899599 nather73 D March 11, 2025, 1:10 a.m. OK PyPy 3-64 TESTS 7 250 10035200
309858510 raputa D March 10, 2025, 5:11 p.m. OK PyPy 3-64 TESTS 7 264 8499200
309854611 damn22 D March 10, 2025, 5:01 p.m. OK Python 3 TESTS 7 421 0
309871170 jones_matrix D March 10, 2025, 6:51 p.m. OK Python 3 TESTS 7 437 1024000
309857316 Linver D March 10, 2025, 5:08 p.m. OK Python 3 TESTS 7 561 44236800
309888208 bot_97 D March 10, 2025, 9:47 p.m. OK Python 3 TESTS 7 656 0
309853188 amod_24 D March 10, 2025, 4:57 p.m. OK Python 3 TESTS 7 765 1024000
309857290 Farewell1022 D March 10, 2025, 5:08 p.m. OK Python 3 TESTS 7 827 0
309849468 mudanvit.goyal D March 10, 2025, 4:47 p.m. OK Python 3 TESTS 7 827 0
309909071 AashayCode D March 11, 2025, 3:43 a.m. OK Python 3 TESTS 7 858 1024000
309906136 Martician D March 11, 2025, 3:01 a.m. OK Rust 2021 TESTS 7 77 0
309856303 kingcabrams D March 10, 2025, 5:06 p.m. OK Rust 2021 TESTS 7 124 102400
309850545 sumit4199 D March 10, 2025, 4:50 p.m. OK Rust 2021 TESTS 7 202 3686400

remove filters

Back to search problems