Codeforces Round 767 (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
1628 Codeforces Round 767 (Div. 1) FINISHED False 7200 94404263 Jan. 22, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3260 ) D1 Game on Sum (Easy Version) PROGRAMMING combinatorics dp games

B'This is the easy version of the problem. The difference is the constraints on n , m and t . You can make hacks only if all versions of the problem are solved. Alice and Bob are given the numbers n , m and k , and play a game as follows: The game has a score that Alice tries to maximize, and Bob tries to minimize. The score is initially 0 . The game consists of n turns. Each turn, Alice picks a real number from 0 to k (inclusive) which Bob either adds to or subtracts from the score of the game. But throughout the game, Bob has to choose to add at least m out of the n turns. Bob gets to know which number Alice picked before deciding whether to add or subtract the number from the score, and Alice gets to know whether Bob added or subtracted the number for the previous turn before picking the number for the current turn (except on the first turn since there was no previous turn). If Alice and Bob play optimally, what will the final score of the game be? The first line of the input contains a single integer t ( 1 <= t <= 1000 ) -- the number of test cases. The description of test cases follows. Each test case consists of a single line containing the three integers, n , m , and k ( 1 <= m <= n <= 2000, 0 <= k < 10^9 + 7 ) -- the number of turns, how many of those turns Bob has to add, and the biggest number Alice can choose, respectively. It is guaranteed that the sum of n over all test cases does not exceed 2000 . For each test case output a single integer number -- the score of the optimal game modulo 10^9 + 7 . Formally, let M = 10^9 + 7 . It can be shown that the answer can be expressed as an irreducible fraction frac{p}{q} , where p and q are integers and q not equiv 0 pmod{M} . Output the integer equal to p cdot q^{-1} bmod M . In other words, output such an integer x that 0 <= x < M an'...

Tutorials

99276

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
143694492 Gassa D1 Jan. 22, 2022, 4:23 p.m. OK D TESTS 68 31 27443200
143715418 rainboy D1 Jan. 22, 2022, 7:46 p.m. OK GNU C11 TESTS 68 93 16076800
143692111 applese D1 Jan. 22, 2022, 4:17 p.m. OK GNU C++14 TESTS 68 15 16076800
143662574 csyakuoi D1 Jan. 22, 2022, 3:16 p.m. OK GNU C++14 TESTS 68 15 16076800
143693625 KrK D1 Jan. 22, 2022, 4:21 p.m. OK GNU C++14 TESTS 68 15 16076800
143730539 bkifhr7 D1 Jan. 23, 2022, 3:36 a.m. OK GNU C++14 TESTS 68 15 16179200
143690098 SuperJ6 D1 Jan. 22, 2022, 4:12 p.m. OK GNU C++14 TESTS 68 15 32153600
143734946 E-ray D1 Jan. 23, 2022, 4:55 a.m. OK GNU C++14 TESTS 68 15 32256000
143685632 Shivram D1 Jan. 22, 2022, 4:02 p.m. OK GNU C++14 TESTS 68 30 0
143693783 Lskkkno3 D1 Jan. 22, 2022, 4:21 p.m. OK GNU C++14 TESTS 68 30 16076800
143682058 themoon D1 Jan. 22, 2022, 3:54 p.m. OK GNU C++14 TESTS 68 30 16076800
143723731 peiwenjun D1 Jan. 22, 2022, 11:55 p.m. OK GNU C++14 TESTS 68 30 16076800
143679929 kiriezhka228 D1 Jan. 22, 2022, 3:49 p.m. OK GNU C++17 TESTS 68 15 204800
143666238 jschnei D1 Jan. 22, 2022, 3:22 p.m. OK GNU C++17 TESTS 68 15 409600
143692989 gen D1 Jan. 22, 2022, 4:19 p.m. OK GNU C++17 TESTS 68 15 16076800
143696790 OIer_kzc D1 Jan. 22, 2022, 4:28 p.m. OK GNU C++17 TESTS 68 15 16076800
143685366 imeimi D1 Jan. 22, 2022, 4:01 p.m. OK GNU C++17 TESTS 68 15 16179200
143692541 Peti D1 Jan. 22, 2022, 4:18 p.m. OK GNU C++17 TESTS 68 15 32153600
143698401 HuaJun D1 Jan. 22, 2022, 4:32 p.m. OK GNU C++17 TESTS 68 15 32256000
143709541 niike0goood D1 Jan. 22, 2022, 6:20 p.m. OK GNU C++17 TESTS 68 15 36556800
143690355 bthero D1 Jan. 22, 2022, 4:13 p.m. OK GNU C++17 TESTS 68 30 16076800
143688897 hotpotcondiment D1 Jan. 22, 2022, 4:09 p.m. OK GNU C++17 TESTS 68 30 16076800
143692891 keep__calm D1 Jan. 22, 2022, 4:19 p.m. OK GNU C++17 (64) TESTS 68 15 7168000
143684683 FlameDragon D1 Jan. 22, 2022, 4 p.m. OK GNU C++17 (64) TESTS 68 15 14540800
143689660 Kubic D1 Jan. 22, 2022, 4:11 p.m. OK GNU C++17 (64) TESTS 68 15 16076800
143662448 Laurie D1 Jan. 22, 2022, 3:16 p.m. OK GNU C++17 (64) TESTS 68 15 16076800
143661221 GSHgsh D1 Jan. 22, 2022, 3:13 p.m. OK GNU C++17 (64) TESTS 68 15 16076800
143658571 Roundgod D1 Jan. 22, 2022, 3:08 p.m. OK GNU C++17 (64) TESTS 68 15 16076800
143693900 KADR D1 Jan. 22, 2022, 4:21 p.m. OK GNU C++17 (64) TESTS 68 15 16076800
143718924 qxforever D1 Jan. 22, 2022, 9 p.m. OK GNU C++17 (64) TESTS 68 15 16179200
143691784 eriksuenderhauf D1 Jan. 22, 2022, 4:16 p.m. OK GNU C++17 (64) TESTS 68 15 16179200
143739167 chiranko D1 Jan. 23, 2022, 5:50 a.m. OK GNU C++17 (64) TESTS 68 15 16179200
143690719 Drice D1 Jan. 22, 2022, 4:14 p.m. OK GNU C++20 (64) TESTS 68 15 0
143688747 the_hyp0cr1t3 D1 Jan. 22, 2022, 4:09 p.m. OK GNU C++20 (64) TESTS 68 15 0
143703588 Bugman D1 Jan. 22, 2022, 5:30 p.m. OK GNU C++20 (64) TESTS 68 15 0
143688546 codebuster_10 D1 Jan. 22, 2022, 4:08 p.m. OK GNU C++20 (64) TESTS 68 15 4198400
143669534 jiangly D1 Jan. 22, 2022, 3:28 p.m. OK GNU C++20 (64) TESTS 68 15 4198400
143696011 Nero D1 Jan. 22, 2022, 4:26 p.m. OK GNU C++20 (64) TESTS 68 15 7168000
143674735 Amentorimaru D1 Jan. 22, 2022, 3:39 p.m. OK GNU C++20 (64) TESTS 68 15 8294400
143670788 mtsd D1 Jan. 22, 2022, 3:31 p.m. OK GNU C++20 (64) TESTS 68 15 9523200
143694005 fvogel D1 Jan. 22, 2022, 4:22 p.m. OK GNU C++20 (64) TESTS 68 15 13824000
143687200 palayutm D1 Jan. 22, 2022, 4:05 p.m. OK GNU C++20 (64) TESTS 68 15 14540800
143664087 clyring D1 Jan. 22, 2022, 3:18 p.m. OK Haskell TESTS 68 140 19968000
143717936 Toinfinity D1 Jan. 22, 2022, 8:37 p.m. OK Java 11 TESTS 68 187 0
143717923 Toinfinity D1 Jan. 22, 2022, 8:36 p.m. OK Java 11 TESTS 68 187 0
143677612 derrick20 D1 Jan. 22, 2022, 3:45 p.m. OK Java 11 TESTS 68 218 39936000
143723415 Ste D1 Jan. 22, 2022, 11:39 p.m. OK Java 11 TESTS 68 249 39731200
143692653 bobib D1 Jan. 22, 2022, 4:19 p.m. OK Java 11 TESTS 68 296 39833600
143702301 knightL D1 Jan. 22, 2022, 5:25 p.m. OK Java 11 TESTS 68 312 39833600
143694354 robinz62 D1 Jan. 22, 2022, 4:22 p.m. OK Java 11 TESTS 68 405 78438400
143685657 martins D1 Jan. 22, 2022, 4:02 p.m. OK Java 11 TESTS 68 467 39833600
143681326 saptarshi1729 D1 Jan. 22, 2022, 3:52 p.m. OK Java 11 TESTS 68 2714 89395200
143712946 beroul D1 Jan. 22, 2022, 7:05 p.m. OK Java 8 TESTS 68 139 38502400
143694811 AndreySiunov D1 Jan. 22, 2022, 4:24 p.m. OK Java 8 TESTS 68 140 38604800
143671216 iakovlev.zakhar D1 Jan. 22, 2022, 3:32 p.m. OK Java 8 TESTS 68 156 17100800
143685929 fetetriste D1 Jan. 22, 2022, 4:03 p.m. OK Java 8 TESTS 68 171 16486400
143703883 golions D1 Jan. 22, 2022, 5:31 p.m. OK Java 8 TESTS 68 187 38707200
143679568 AdhmMohamed D1 Jan. 22, 2022, 3:49 p.m. OK Java 8 TESTS 68 405 38809600
143682722 SecondThread D1 Jan. 22, 2022, 3:55 p.m. OK Java 8 TESTS 68 452 79564800
143676719 arvindf232 D1 Jan. 22, 2022, 3:43 p.m. OK Kotlin 1.4 TESTS 68 140 5120000
143706752 Hakiobo D1 Jan. 22, 2022, 5:52 p.m. OK Kotlin 1.4 TESTS 68 186 18329600
143676252 machine_solution D1 Jan. 22, 2022, 3:42 p.m. OK MS C++ 2017 TESTS 68 31 32460800
143683599 NecroSean38 D1 Jan. 22, 2022, 3:57 p.m. OK PyPy 3 TESTS 68 280 9830400
143683421 SPD_9X2 D1 Jan. 22, 2022, 3:57 p.m. OK PyPy 3 TESTS 68 608 75161600
143688703 titia D1 Jan. 22, 2022, 4:09 p.m. OK PyPy 3 TESTS 68 826 138649600
143679493 codicon D1 Jan. 22, 2022, 3:48 p.m. OK PyPy 3 TESTS 68 826 143564800
143733104 sadstone D1 Jan. 23, 2022, 4:24 a.m. OK PyPy 3 TESTS 68 920 141926400
143693851 MathisHammel D1 Jan. 22, 2022, 4:21 p.m. OK PyPy 3 TESTS 68 2167 246169600
143675833 whatshisbucket D1 Jan. 22, 2022, 3:41 p.m. OK PyPy 3 TESTS 68 2526 165273600
143680779 Slamur D1 Jan. 22, 2022, 3:51 p.m. OK PyPy 3-64 TESTS 68 202 20787200
143684407 oadey89 D1 Jan. 22, 2022, 3:59 p.m. OK PyPy 3-64 TESTS 68 280 24576000
143714081 coder_sounak D1 Jan. 22, 2022, 7:23 p.m. OK PyPy 3-64 TESTS 68 405 43929600
143681256 chinerist D1 Jan. 22, 2022, 3:52 p.m. OK PyPy 3-64 TESTS 68 530 49766400
143704334 huikang D1 Jan. 22, 2022, 5:34 p.m. OK PyPy 3-64 TESTS 68 545 16793600
143723122 OLOGY D1 Jan. 22, 2022, 11:23 p.m. OK Python 2 TESTS 68 46 0
143722462 OLOGY D1 Jan. 22, 2022, 10:57 p.m. OK Python 2 TESTS 68 1029 50380800
143728140 OLOGY D1 Jan. 23, 2022, 2:41 a.m. OK Python 2 TESTS 68 1154 0
143712893 akhan42 D1 Jan. 22, 2022, 7:04 p.m. OK Python 3 TESTS 68 93 409600
143690212 r57shell D1 Jan. 22, 2022, 4:13 p.m. OK Python 3 TESTS 68 1200 40243200
143691573 kingmoshe D1 Jan. 22, 2022, 4:16 p.m. OK Python 3 TESTS 68 1387 34201600
143673685 sansen D1 Jan. 22, 2022, 3:36 p.m. OK Rust 2021 TESTS 68 31 4198400
143663311 Egor D1 Jan. 22, 2022, 3:17 p.m. OK Rust 2021 TESTS 68 46 0
143680235 qwerty787788 D1 Jan. 22, 2022, 3:50 p.m. OK Rust 2021 TESTS 68 46 16076800
143674028 kobae964 D1 Jan. 22, 2022, 3:37 p.m. OK Rust 2021 TESTS 68 46 35635200

remove filters

Back to search problems