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
( 12957 ) E2 Game with Marbles (Hard Version) PROGRAMMING 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 hard version, the number of test cases does not exceed 10^4 , and the sum of values of n over all test cases does not exceed 2 cdot 10^5 . Furthermore, there are no additional constraints on n in a single test case. 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^4 ) -- the number of test cases. Each test case consists of three lines: Additional constraint on the input: the sum of n for all test cases does not exceed 2 cdot 10^5 . For each test case, output a'...

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
238061673 volhalink E2 Dec. 19, 2023, 6:08 p.m. OK C# 10 TESTS 23 264 43417600
238058875 Letmecry E2 Dec. 19, 2023, 5:45 p.m. OK C# 10 TESTS 23 358 41779200
238093613 TopCloser E2 Dec. 20, 2023, 4:29 a.m. OK Clang++20 Diagnostics TESTS 23 2058 5222400
238093358 TopCloser E2 Dec. 20, 2023, 4:25 a.m. OK Clang++20 Diagnostics TESTS 23 2214 8396800
238093201 TopCloser E2 Dec. 20, 2023, 4:23 a.m. OK Clang++20 Diagnostics TESTS 23 2215 7372800
238073439 vaibhavsingh1108 E2 Dec. 19, 2023, 8:30 p.m. OK Clang++20 Diagnostics TESTS 23 2682 35635200
238059226 TopCloser E2 Dec. 19, 2023, 5:48 p.m. OK Clang++20 Diagnostics TESTS 23 2870 18739200
238060096 TopCloser E2 Dec. 19, 2023, 5:55 p.m. OK Clang++20 Diagnostics TESTS 23 2885 18739200
238059679 TopCloser E2 Dec. 19, 2023, 5:51 p.m. OK Clang++20 Diagnostics TESTS 23 2979 18841600
238055298 ruban E2 Dec. 19, 2023, 5:22 p.m. OK FPC TESTS 23 296 202240000
238063106 __MBl E2 Dec. 19, 2023, 6:21 p.m. OK GNU C11 TESTS 23 171 2355200
238063534 __MBl E2 Dec. 19, 2023, 6:25 p.m. OK GNU C11 TESTS 23 202 2867200
238062945 __MBl E2 Dec. 19, 2023, 6:20 p.m. OK GNU C11 TESTS 23 202 3993600
238089938 YYZNB E2 Dec. 20, 2023, 3:31 a.m. OK GNU C++14 TESTS 23 124 3174400
238089251 luogu_bot1 E2 Dec. 20, 2023, 3:21 a.m. OK GNU C++14 TESTS 23 124 3276800
238076536 par4dox E2 Dec. 19, 2023, 9:30 p.m. OK GNU C++14 TESTS 23 139 4812800
238096665 marcus06 E2 Dec. 20, 2023, 5:12 a.m. OK GNU C++14 TESTS 23 140 2457600
238088091 akshil_ahuja E2 Dec. 20, 2023, 2:59 a.m. OK GNU C++14 TESTS 23 140 2457600
238066654 _rishikatiwari E2 Dec. 19, 2023, 6:59 p.m. OK GNU C++14 TESTS 23 140 3174400
238087318 RichardLau E2 Dec. 20, 2023, 2:41 a.m. OK GNU C++14 TESTS 23 140 4812800
238051142 HuHu_Fei E2 Dec. 19, 2023, 5:04 p.m. OK GNU C++14 TESTS 23 140 4915200
238048214 nijuusei_A E2 Dec. 19, 2023, 4:58 p.m. OK GNU C++14 TESTS 23 140 5427200
238051625 kunal23kmr_br09 E2 Dec. 19, 2023, 5:04 p.m. OK GNU C++14 TESTS 23 140 6451200
238083192 Lskkkno3 E2 Dec. 20, 2023, 1:01 a.m. OK GNU C++17 TESTS 23 124 1638400
238052183 _liadin7_ E2 Dec. 19, 2023, 5:07 p.m. OK GNU C++17 TESTS 23 124 3174400
238095169 aidnitra E2 Dec. 20, 2023, 4:53 a.m. OK GNU C++17 TESTS 23 124 4812800
238050416 kevin20012 E2 Dec. 19, 2023, 5:02 p.m. OK GNU C++17 TESTS 23 124 4915200
238087341 AaronHe E2 Dec. 20, 2023, 2:42 a.m. OK GNU C++17 TESTS 23 139 2457600
238085974 cxkluguan E2 Dec. 20, 2023, 2:12 a.m. OK GNU C++17 TESTS 23 139 2457600
238054412 Farag_Elyan E2 Dec. 19, 2023, 5:16 p.m. OK GNU C++17 TESTS 23 139 2457600
238091093 GCDback E2 Dec. 20, 2023, 3:51 a.m. OK GNU C++17 TESTS 23 139 3174400
238091332 .qiti E2 Dec. 20, 2023, 3:55 a.m. OK GNU C++17 TESTS 23 139 3174400
238047162 KY4 E2 Dec. 19, 2023, 4:55 p.m. OK GNU C++17 TESTS 23 139 4812800
238089108 fs20091003 E2 Dec. 20, 2023, 3:18 a.m. OK GNU C++17 (64) TESTS 23 92 1638400
238089587 bestzzz E2 Dec. 20, 2023, 3:26 a.m. OK GNU C++17 (64) TESTS 23 93 3174400
238100211 _Dio E2 Dec. 20, 2023, 5:55 a.m. OK GNU C++17 (64) TESTS 23 93 3174400
238090869 grate E2 Dec. 20, 2023, 3:48 a.m. OK GNU C++17 (64) TESTS 23 93 3174400
238054692 watcherrr E2 Dec. 19, 2023, 5:18 p.m. OK GNU C++17 (64) TESTS 23 93 3276800
238077843 enslaved E2 Dec. 19, 2023, 10:01 p.m. OK GNU C++17 (64) TESTS 23 93 3993600
238090456 hennulideren E2 Dec. 20, 2023, 3:41 a.m. OK GNU C++17 (64) TESTS 23 93 4812800
238090395 hennulideren E2 Dec. 20, 2023, 3:40 a.m. OK GNU C++17 (64) TESTS 23 93 4812800
238090926 hennulideren E2 Dec. 20, 2023, 3:49 a.m. OK GNU C++17 (64) TESTS 23 93 4812800
238077549 nameisCHAS E2 Dec. 19, 2023, 9:53 p.m. OK GNU C++17 (64) TESTS 23 93 5836800
238087411 TokaiZaopen E2 Dec. 20, 2023, 2:43 a.m. OK GNU C++20 (64) TESTS 23 31 4096000
238060090 JokerKing_forever E2 Dec. 19, 2023, 5:55 p.m. OK GNU C++20 (64) TESTS 23 77 1638400
238075468 459 E2 Dec. 19, 2023, 9:07 p.m. OK GNU C++20 (64) TESTS 23 77 1638400
238088164 Tiwwp8n24 E2 Dec. 20, 2023, 3 a.m. OK GNU C++20 (64) TESTS 23 77 3174400
238092998 augtheo E2 Dec. 20, 2023, 4:20 a.m. OK GNU C++20 (64) TESTS 23 77 3174400
238047795 Jorge_slime E2 Dec. 19, 2023, 4:57 p.m. OK GNU C++20 (64) TESTS 23 77 3276800
238085231 yanke E2 Dec. 20, 2023, 1:54 a.m. OK GNU C++20 (64) TESTS 23 77 4812800
238098853 dantalian02 E2 Dec. 20, 2023, 5:39 a.m. OK GNU C++20 (64) TESTS 23 77 6451200
238062800 trassis E2 Dec. 19, 2023, 6:18 p.m. OK GNU C++20 (64) TESTS 23 78 1638400
238088443 ht4779925 E2 Dec. 20, 2023, 3:05 a.m. OK GNU C++20 (64) TESTS 23 78 1638400
238083923 SadFriedRice E2 Dec. 20, 2023, 1:20 a.m. OK Go TESTS 23 249 7884800
238091834 voldi9 E2 Dec. 20, 2023, 4:03 a.m. OK Haskell TESTS 23 2979 238489600
238056404 Edge_Tree E2 Dec. 19, 2023, 5:28 p.m. OK Java 11 TESTS 23 342 65536000
238077729 PlayDate E2 Dec. 19, 2023, 9:58 p.m. OK Java 11 TESTS 23 405 6348800
238060280 mohit458 E2 Dec. 19, 2023, 5:57 p.m. OK Java 11 TESTS 23 451 16896000
238077771 PlayDate E2 Dec. 19, 2023, 9:59 p.m. OK Java 11 TESTS 23 826 0
238049643 Horridbeast E2 Dec. 19, 2023, 5:01 p.m. OK Java 11 TESTS 23 857 0
238057107 rELiK_STC E2 Dec. 19, 2023, 5:33 p.m. OK Java 11 TESTS 23 872 3993600
238046982 naitik.ntn2001 E2 Dec. 19, 2023, 4:55 p.m. OK Java 11 TESTS 23 873 7475200
238095730 saurabhtrigunayat90 E2 Dec. 20, 2023, 5 a.m. OK Java 11 TESTS 23 889 7475200
238087670 wdjuruo E2 Dec. 20, 2023, 2:50 a.m. OK Java 11 TESTS 23 1169 20377600
238046723 umcleji E2 Dec. 19, 2023, 4:54 p.m. OK Java 17 TESTS 23 343 12697600
238082699 Harwinvanak E2 Dec. 20, 2023, 12:46 a.m. OK Java 17 TESTS 23 389 9011200
238099753 daksh_02 E2 Dec. 20, 2023, 5:49 a.m. OK Java 17 TESTS 23 389 13312000
238077380 mohammed.rabii E2 Dec. 19, 2023, 9:49 p.m. OK Java 17 TESTS 23 405 12800000
238046693 1isGreaterThan0 E2 Dec. 19, 2023, 4:54 p.m. OK Java 17 TESTS 23 405 13824000
238051985 28leoleo28 E2 Dec. 19, 2023, 5:06 p.m. OK Java 17 TESTS 23 420 8704000
238099895 NatsuDragoneel E2 Dec. 20, 2023, 5:51 a.m. OK Java 17 TESTS 23 436 9523200
238056015 AyushVardhan E2 Dec. 19, 2023, 5:26 p.m. OK Java 17 TESTS 23 904 7884800
238053270 anau11 E2 Dec. 19, 2023, 5:11 p.m. OK Java 17 TESTS 23 967 8192000
238065924 addy1234 E2 Dec. 19, 2023, 6:51 p.m. OK Java 17 TESTS 23 997 6246400
238089732 Ligh0x74 E2 Dec. 20, 2023, 3:28 a.m. OK Java 21 TESTS 23 483 7270400
238063555 Akash_Sardar E2 Dec. 19, 2023, 6:26 p.m. OK Java 21 TESTS 23 623 24473600
238069141 himneesh9 E2 Dec. 19, 2023, 7:28 p.m. OK Java 21 TESTS 23 1200 21299200
238059032 pratap.S007 E2 Dec. 19, 2023, 5:46 p.m. OK Java 21 TESTS 23 1294 18534400
238062779 NerfThis E2 Dec. 19, 2023, 6:18 p.m. OK Java 8 TESTS 23 327 17305600
238092931 Ashu2030 E2 Dec. 20, 2023, 4:19 a.m. OK Java 8 TESTS 23 327 17715200
238070730 Sumitsingh7 E2 Dec. 19, 2023, 7:50 p.m. OK Java 8 TESTS 23 327 22835200
238047266 sumitsk007 E2 Dec. 19, 2023, 4:56 p.m. OK Java 8 TESTS 23 327 22835200
238047657 hamossa E2 Dec. 19, 2023, 4:56 p.m. OK Java 8 TESTS 23 343 23859200
238059273 American_Eagle E2 Dec. 19, 2023, 5:48 p.m. OK Java 8 TESTS 23 389 20992000
238095033 coderman2004 E2 Dec. 20, 2023, 4:51 a.m. OK Java 8 TESTS 23 405 18534400
238050891 nikhil97agra E2 Dec. 19, 2023, 5:03 p.m. OK Java 8 TESTS 23 420 18534400
238086417 Terminators E2 Dec. 20, 2023, 2:22 a.m. OK Java 8 TESTS 23 436 18022400
238050183 nikhil97agra E2 Dec. 19, 2023, 5:02 p.m. OK Java 8 TESTS 23 686 69529600
238096813 ShadowDrunk E2 Dec. 20, 2023, 5:14 a.m. OK MS C++ 2017 TESTS 23 405 4812800
238090131 ShadowDrunk E2 Dec. 20, 2023, 3:35 a.m. OK MS C++ 2017 TESTS 23 420 4812800
238096567 ShadowDrunk E2 Dec. 20, 2023, 5:11 a.m. OK MS C++ 2017 TESTS 23 421 4812800
238047026 serafima.khokhlova2000 E2 Dec. 19, 2023, 4:55 p.m. OK MS C++ 2017 TESTS 23 467 3174400
238062692 ahtoh_ E2 Dec. 19, 2023, 6:17 p.m. OK Node.js TESTS 23 451 77516800
238071406 Track-Days E2 Dec. 19, 2023, 7:59 p.m. OK PyPy 3 TESTS 23 1106 25804800
238080297 porker2008 E2 Dec. 19, 2023, 11:19 p.m. OK PyPy 3 TESTS 23 1310 23859200
238093022 brimstone E2 Dec. 20, 2023, 4:20 a.m. OK PyPy 3 TESTS 23 1325 24166400
238093091 brimstone E2 Dec. 20, 2023, 4:22 a.m. OK PyPy 3 TESTS 23 1325 24268800
238093609 brimstone E2 Dec. 20, 2023, 4:29 a.m. OK PyPy 3 TESTS 23 1325 24473600
238054963 newbievn E2 Dec. 19, 2023, 5:20 p.m. OK PyPy 3 TESTS 23 1450 28057600
238095627 sarthakjoleya E2 Dec. 20, 2023, 4:59 a.m. OK PyPy 3-64 TESTS 23 451 51302400
238095380 sarthakjoleya E2 Dec. 20, 2023, 4:56 a.m. OK PyPy 3-64 TESTS 23 483 42188800
238066796 AndreiZherder E2 Dec. 19, 2023, 7 p.m. OK PyPy 3-64 TESTS 23 545 34406400
238095728 sarthakjoleya E2 Dec. 20, 2023, 5 a.m. OK PyPy 3-64 TESTS 23 545 51916800
238061916 Arnoob2120 E2 Dec. 19, 2023, 6:10 p.m. OK PyPy 3-64 TESTS 23 607 42803200
238053417 Mohamed_Hamed E2 Dec. 19, 2023, 5:11 p.m. OK PyPy 3-64 TESTS 23 748 30412800
238052471 Mohamed_Hamed E2 Dec. 19, 2023, 5:08 p.m. OK PyPy 3-64 TESTS 23 748 30412800
238093380 hk_brave E2 Dec. 20, 2023, 4:26 a.m. OK PyPy 3-64 TESTS 23 748 36249600
238055198 Abdusharif E2 Dec. 19, 2023, 5:21 p.m. OK PyPy 3-64 TESTS 23 748 40857600
238057352 jenil0108 E2 Dec. 19, 2023, 5:34 p.m. OK PyPy 3-64 TESTS 23 763 38912000
238086976 rishabhxchoudhary E2 Dec. 20, 2023, 2:34 a.m. OK Python 3 TESTS 23 405 43724800
238055748 harshs_21 E2 Dec. 19, 2023, 5:24 p.m. OK Python 3 TESTS 23 577 47820800
238050136 ayush_jhajharia E2 Dec. 19, 2023, 5:02 p.m. OK Python 3 TESTS 23 607 47206400
238057907 rostoki E2 Dec. 19, 2023, 5:38 p.m. OK Python 3 TESTS 23 607 47411200
238052385 PFT E2 Dec. 19, 2023, 5:07 p.m. OK Python 3 TESTS 23 608 47820800
238088563 bayibo E2 Dec. 20, 2023, 3:07 a.m. OK Python 3 TESTS 23 623 54681600
238089372 Bhanu_304 E2 Dec. 20, 2023, 3:22 a.m. OK Python 3 TESTS 23 624 47820800
238049619 2100030264 E2 Dec. 19, 2023, 5:01 p.m. OK Python 3 TESTS 23 639 47308800
238051107 KLU_2100030477 E2 Dec. 19, 2023, 5:03 p.m. OK Python 3 TESTS 23 639 48025600
238070016 maherayari24 E2 Dec. 19, 2023, 7:40 p.m. OK Python 3 TESTS 23 670 49254400
238067738 liut E2 Dec. 19, 2023, 7:10 p.m. OK Rust 2021 TESTS 23 109 7475200
238052026 points_engineering E2 Dec. 19, 2023, 5:06 p.m. OK Rust 2021 TESTS 23 139 12185600

remove filters

Back to search problems