Codeforces Round 916 (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
1914 Codeforces Round 916 (Div. 3) FINISHED False 9000 34183463 Dec. 19, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 12716 ) E1 Game with Marbles (Easy Version) PROGRAMMING brute force games greedy sortings

B'The easy and hard versions of this problem differ only in the constraints on the number of test cases and n . In the easy version, the number of test cases does not exceed 10^3 , and n does not exceed 6 . Recently, Alice and Bob were given marbles of n different colors by their parents. Alice has received a_1 marbles of color 1 , a_2 marbles of color 2 ,..., a_n marbles of color n . Bob has received b_1 marbles of color 1 , b_2 marbles of color 2 , ..., b_n marbles of color n . All a_i and b_i are between 1 and 10^9 . After some discussion, Alice and Bob came up with the following game: players take turns, starting with Alice. On their turn, a player chooses a color i such that both players have at least one marble of that color. The player then discards one marble of color i , and their opponent discards all marbles of color i . The game ends when there is no color i such that both players have at least one marble of that color. The score in the game is the difference between the number of remaining marbles that Alice has and the number of remaining marbles that Bob has at the end of the game. In other words, the score in the game is equal to (A-B) , where A is the number of marbles Alice has and B is the number of marbles Bob has at the end of the game. Alice wants to maximize the score, while Bob wants to minimize it. Calculate the score at the end of the game if both players play optimally. The first line contains a single integer t ( 1 <= t <= 10^3 ) -- the number of test cases. Each test case consists of three lines: For each test case, output a single integer -- the score at the end of the game if both Alice and Bob act optimally. In the first example, one way to achieve a score of 1 is as follows: As a result, Alice has a = [3, 1, 0] remaining, and Bob has b = [0, 0,'...

Tutorials

Codeforces Round 916 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
238061580 volhalink E1 Dec. 19, 2023, 6:07 p.m. OK C# 10 TESTS 6 61 1638400
238058777 Letmecry E1 Dec. 19, 2023, 5:44 p.m. OK C# 10 TESTS 6 155 1638400
238073405 vaibhavsingh1108 E1 Dec. 19, 2023, 8:30 p.m. OK Clang++20 Diagnostics TESTS 6 109 1024000
238055232 ruban E1 Dec. 19, 2023, 5:21 p.m. OK FPC TESTS 6 31 202240000
238063155 __MBl E1 Dec. 19, 2023, 6:22 p.m. OK GNU C11 TESTS 6 15 1638400
238047808 Ryannnnnnnn E1 Dec. 19, 2023, 4:57 p.m. OK GNU C11 TESTS 6 30 0
238063414 __MBl E1 Dec. 19, 2023, 6:24 p.m. OK GNU C11 TESTS 6 31 204800
238072882 dev123412112 E1 Dec. 19, 2023, 8:21 p.m. OK GNU C++14 TESTS 6 15 0
238074346 sameersaxena21102 E1 Dec. 19, 2023, 8:46 p.m. OK GNU C++14 TESTS 6 15 0
238065986 tamminaina_y E1 Dec. 19, 2023, 6:52 p.m. OK GNU C++14 TESTS 6 15 0
238065728 _rishikatiwari E1 Dec. 19, 2023, 6:49 p.m. OK GNU C++14 TESTS 6 15 0
238062600 SlowKnight10 E1 Dec. 19, 2023, 6:17 p.m. OK GNU C++14 TESTS 6 15 0
238062522 _toothless E1 Dec. 19, 2023, 6:16 p.m. OK GNU C++14 TESTS 6 15 0
238058135 heavy_rated E1 Dec. 19, 2023, 5:40 p.m. OK GNU C++14 TESTS 6 15 0
238086206 209001133 E1 Dec. 20, 2023, 2:18 a.m. OK GNU C++14 TESTS 6 15 0
238087489 ACforever E1 Dec. 20, 2023, 2:45 a.m. OK GNU C++14 TESTS 6 15 0
238096868 lanzhu E1 Dec. 20, 2023, 5:15 a.m. OK GNU C++14 TESTS 6 15 0
238063390 hi123bye E1 Dec. 19, 2023, 6:24 p.m. OK GNU C++17 TESTS 6 0 409600
238091963 tbzard E1 Dec. 20, 2023, 4:05 a.m. OK GNU C++17 TESTS 6 0 1740800
238052758 Mkswll E1 Dec. 19, 2023, 5:09 p.m. OK GNU C++17 TESTS 6 0 3379200
238098860 Anchord E1 Dec. 20, 2023, 5:39 a.m. OK GNU C++17 TESTS 6 15 0
238098784 xiaohong888 E1 Dec. 20, 2023, 5:38 a.m. OK GNU C++17 TESTS 6 15 0
238100753 abdullahazeem E1 Dec. 20, 2023, 6:01 a.m. OK GNU C++17 TESTS 6 15 0
238097947 RED_MONK E1 Dec. 20, 2023, 5:28 a.m. OK GNU C++17 TESTS 6 15 0
238097972 LauXanhBK E1 Dec. 20, 2023, 5:28 a.m. OK GNU C++17 TESTS 6 15 0
238099654 Prayant E1 Dec. 20, 2023, 5:48 a.m. OK GNU C++17 TESTS 6 15 0
238099554 5-gon E1 Dec. 20, 2023, 5:47 a.m. OK GNU C++17 TESTS 6 15 0
238083682 NirvanaYiYun E1 Dec. 20, 2023, 1:13 a.m. OK GNU C++17 (64) TESTS 6 0 0
238090841 grate E1 Dec. 20, 2023, 3:47 a.m. OK GNU C++17 (64) TESTS 6 0 0
238088254 lxllxs E1 Dec. 20, 2023, 3:02 a.m. OK GNU C++17 (64) TESTS 6 0 0
238086582 iscreamc3 E1 Dec. 20, 2023, 2:26 a.m. OK GNU C++17 (64) TESTS 6 0 0
238077200 enslaved E1 Dec. 19, 2023, 9:45 p.m. OK GNU C++17 (64) TESTS 6 0 0
238054693 Vasu_ E1 Dec. 19, 2023, 5:18 p.m. OK GNU C++17 (64) TESTS 6 0 0
238054659 watcherrr E1 Dec. 19, 2023, 5:18 p.m. OK GNU C++17 (64) TESTS 6 0 0
238054147 helloforces E1 Dec. 19, 2023, 5:15 p.m. OK GNU C++17 (64) TESTS 6 0 0
238049256 Oguri_Cap. E1 Dec. 19, 2023, 5 p.m. OK GNU C++17 (64) TESTS 6 0 0
238088381 000ywq E1 Dec. 20, 2023, 3:04 a.m. OK GNU C++17 (64) TESTS 6 0 2457600
238099619 kennyarlexy E1 Dec. 20, 2023, 5:48 a.m. OK GNU C++20 (64) TESTS 6 0 0
238099608 shreyam7713 E1 Dec. 20, 2023, 5:48 a.m. OK GNU C++20 (64) TESTS 6 0 0
238100130 DraggerJd03 E1 Dec. 20, 2023, 5:54 a.m. OK GNU C++20 (64) TESTS 6 0 0
238098034 Aicu E1 Dec. 20, 2023, 5:29 a.m. OK GNU C++20 (64) TESTS 6 0 0
238097519 qiaochen E1 Dec. 20, 2023, 5:23 a.m. OK GNU C++20 (64) TESTS 6 0 0
238097154 TOPGODTHESHY E1 Dec. 20, 2023, 5:18 a.m. OK GNU C++20 (64) TESTS 6 0 0
238096954 Misbaul_Hasan E1 Dec. 20, 2023, 5:16 a.m. OK GNU C++20 (64) TESTS 6 0 0
238095884 mhdi_bzrfkn E1 Dec. 20, 2023, 5:02 a.m. OK GNU C++20 (64) TESTS 6 0 0
238100770 Bharath_Cheppala E1 Dec. 20, 2023, 6:01 a.m. OK GNU C++20 (64) TESTS 6 0 0
238099848 hsps0904 E1 Dec. 20, 2023, 5:51 a.m. OK GNU C++20 (64) TESTS 6 0 0
238083920 SadFriedRice E1 Dec. 20, 2023, 1:20 a.m. OK Go TESTS 6 30 409600
238054199 Edge_Tree E1 Dec. 19, 2023, 5:15 p.m. OK Java 11 TESTS 6 186 40243200
238049466 Nick E1 Dec. 19, 2023, 5 p.m. OK Java 11 TESTS 6 187 0
238060256 mohit458 E1 Dec. 19, 2023, 5:57 p.m. OK Java 11 TESTS 6 218 0
238047624 Horridbeast E1 Dec. 19, 2023, 4:56 p.m. OK Java 11 TESTS 6 233 0
238095704 saurabhtrigunayat90 E1 Dec. 20, 2023, 5 a.m. OK Java 11 TESTS 6 233 0
238057013 rELiK_STC E1 Dec. 19, 2023, 5:32 p.m. OK Java 11 TESTS 6 233 0
238046861 naitik.ntn2001 E1 Dec. 19, 2023, 4:55 p.m. OK Java 11 TESTS 6 233 0
238060462 olzhasss E1 Dec. 19, 2023, 5:58 p.m. OK Java 11 TESTS 6 249 0
238087683 wdjuruo E1 Dec. 20, 2023, 2:50 a.m. OK Java 11 TESTS 6 264 0
238049759 NavneetKumar123 E1 Dec. 19, 2023, 5:01 p.m. OK Java 11 TESTS 6 546 0
238099729 daksh_02 E1 Dec. 20, 2023, 5:49 a.m. OK Java 17 TESTS 6 186 409600
238046521 1isGreaterThan0 E1 Dec. 19, 2023, 4:54 p.m. OK Java 17 TESTS 6 218 102400
238062732 FaBy E1 Dec. 19, 2023, 6:18 p.m. OK Java 17 TESTS 6 249 0
238066022 addy1234 E1 Dec. 19, 2023, 6:52 p.m. OK Java 17 TESTS 6 249 512000
238099939 NatsuDragoneel E1 Dec. 20, 2023, 5:52 a.m. OK Java 17 TESTS 6 249 512000
238077369 mohammed.rabii E1 Dec. 19, 2023, 9:49 p.m. OK Java 17 TESTS 6 249 614400
238053142 anau11 E1 Dec. 19, 2023, 5:10 p.m. OK Java 17 TESTS 6 265 1331200
238055872 AyushVardhan E1 Dec. 19, 2023, 5:25 p.m. OK Java 17 TESTS 6 280 512000
238096811 2100032134cseh E1 Dec. 20, 2023, 5:14 a.m. OK Java 17 TESTS 6 296 716800
238049120 prac_123 E1 Dec. 19, 2023, 5 p.m. OK Java 17 TESTS 6 499 204800
238079353 rated21 E1 Dec. 19, 2023, 10:46 p.m. OK Java 21 TESTS 6 202 409600
238089756 Ligh0x74 E1 Dec. 20, 2023, 3:28 a.m. OK Java 21 TESTS 6 233 0
238062472 Akash_Sardar E1 Dec. 19, 2023, 6:16 p.m. OK Java 21 TESTS 6 311 2662400
238068356 himneesh9 E1 Dec. 19, 2023, 7:18 p.m. OK Java 21 TESTS 6 342 307200
238058963 pratap.S007 E1 Dec. 19, 2023, 5:46 p.m. OK Java 21 TESTS 6 358 307200
238092904 Ashu2030 E1 Dec. 20, 2023, 4:18 a.m. OK Java 8 TESTS 6 108 0
238047184 sumitsk007 E1 Dec. 19, 2023, 4:55 p.m. OK Java 8 TESTS 6 124 5836800
238070738 Sumitsingh7 E1 Dec. 19, 2023, 7:50 p.m. OK Java 8 TESTS 6 124 5836800
238059247 American_Eagle E1 Dec. 19, 2023, 5:48 p.m. OK Java 8 TESTS 6 140 0
238086427 Terminators E1 Dec. 20, 2023, 2:23 a.m. OK Java 8 TESTS 6 155 0
238051187 nikhil97agra E1 Dec. 19, 2023, 5:04 p.m. OK Java 8 TESTS 6 171 0
238050852 harsh.india E1 Dec. 19, 2023, 5:03 p.m. OK Java 8 TESTS 6 171 0
238047533 hamossa E1 Dec. 19, 2023, 4:56 p.m. OK Java 8 TESTS 6 187 0
238052030 rahulsunny988 E1 Dec. 19, 2023, 5:06 p.m. OK Java 8 TESTS 6 218 0
238050050 nikhil97agra E1 Dec. 19, 2023, 5:02 p.m. OK Java 8 TESTS 6 280 0
238046904 serafima.khokhlova2000 E1 Dec. 19, 2023, 4:55 p.m. OK MS C++ 2017 TESTS 6 15 0
238090111 ShadowDrunk E1 Dec. 20, 2023, 3:34 a.m. OK MS C++ 2017 TESTS 6 15 0
238056698 mounikakasa72 E1 Dec. 19, 2023, 5:30 p.m. OK MS C++ 2017 TESTS 6 30 0
238095486 nectarl E1 Dec. 20, 2023, 4:57 a.m. OK MS C++ 2017 TESTS 6 31 0
238051113 21r01a05e6 E1 Dec. 19, 2023, 5:04 p.m. OK MS C++ 2017 TESTS 6 31 0
238048917 Kleaves E1 Dec. 19, 2023, 4:59 p.m. OK MS C++ 2017 TESTS 6 46 9625600
238093580 brimstone E1 Dec. 20, 2023, 4:29 a.m. OK PyPy 3 TESTS 6 218 8089600
238080304 porker2008 E1 Dec. 19, 2023, 11:19 p.m. OK PyPy 3 TESTS 6 233 7884800
238053851 newbievn E1 Dec. 19, 2023, 5:14 p.m. OK PyPy 3 TESTS 6 249 7680000
238072101 Deecey01 E1 Dec. 19, 2023, 8:10 p.m. OK PyPy 3-64 TESTS 6 77 4403200
238098630 aviral311 E1 Dec. 20, 2023, 5:36 a.m. OK PyPy 3-64 TESTS 6 78 4505600
238077623 Jayg000e E1 Dec. 19, 2023, 9:55 p.m. OK PyPy 3-64 TESTS 6 93 3379200
238054761 Volume999 E1 Dec. 19, 2023, 5:19 p.m. OK PyPy 3-64 TESTS 6 93 3686400
238087533 Shadow___Monarch___JR E1 Dec. 20, 2023, 2:46 a.m. OK PyPy 3-64 TESTS 6 93 5836800
238063953 Mustela_Erminea E1 Dec. 19, 2023, 6:29 p.m. OK PyPy 3-64 TESTS 6 108 4096000
238053355 flexr E1 Dec. 19, 2023, 5:11 p.m. OK PyPy 3-64 TESTS 6 109 4300800
238066863 AndreiZherder E1 Dec. 19, 2023, 7:01 p.m. OK PyPy 3-64 TESTS 6 109 4505600
238050727 Erum_Meraj E1 Dec. 19, 2023, 5:03 p.m. OK PyPy 3-64 TESTS 6 109 4915200
238059981 jvatsal0709 E1 Dec. 19, 2023, 5:54 p.m. OK PyPy 3-64 TESTS 6 109 5017600
238086966 rishabhxchoudhary E1 Dec. 20, 2023, 2:34 a.m. OK Python 3 TESTS 6 46 0
238076363 harshs_21 E1 Dec. 19, 2023, 9:27 p.m. OK Python 3 TESTS 6 46 0
238049761 harshadiyyala15 E1 Dec. 19, 2023, 5:01 p.m. OK Python 3 TESTS 6 46 0
238047966 bittercof E1 Dec. 19, 2023, 4:57 p.m. OK Python 3 TESTS 6 46 0
238055709 harshs_21 E1 Dec. 19, 2023, 5:24 p.m. OK Python 3 TESTS 6 46 102400
238054553 Bosog4 E1 Dec. 19, 2023, 5:17 p.m. OK Python 3 TESTS 6 46 102400
238051341 neerajsalunkhe.007 E1 Dec. 19, 2023, 5:04 p.m. OK Python 3 TESTS 6 46 102400
238048504 PFT E1 Dec. 19, 2023, 4:58 p.m. OK Python 3 TESTS 6 46 102400
238069847 abhigeddam94 E1 Dec. 19, 2023, 7:38 p.m. OK Python 3 TESTS 6 61 0
238054373 heisenberg6 E1 Dec. 19, 2023, 5:16 p.m. OK Python 3 TESTS 6 61 0
238067772 liut E1 Dec. 19, 2023, 7:11 p.m. OK Rust 2021 TESTS 6 15 0

remove filters

Back to search problems