Codeforces Round 706 (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
1496 Codeforces Round 706 (Div. 2) FINISHED False 7200 121974911 March 10, 2021, 12:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 17680 ) B Max and Mex PROGRAMMING implementation math

B'You are given a multiset S initially consisting of n distinct non-negative integers. A multiset is a set, that can contain some elements multiple times. You will perform the following operation k times: Here operatorname{max} of a multiset denotes the maximum integer in the multiset, and operatorname{mex} of a multiset denotes the smallest non-negative integer that is not present in the multiset. For example: Your task is to calculate the number of distinct elements in S after k operations will be done. The input consists of multiple test cases. The first line contains a single integer t ( 1 <= t <= 100 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains two integers n , k ( 1 <= n <= 10^5 , 0 <= k <= 10^9 ) -- the initial size of the multiset S and how many operations you need to perform. The second line of each test case contains n distinct integers a_1,a_2, ... ,a_n ( 0 <= a_i <= 10^9 ) -- the numbers in the initial multiset. It is guaranteed that the sum of n over all test cases does not exceed 10^5 . For each test case, print the number of distinct elements in S after k operations will be done. In the first test case, S= {0,1,3,4 } , a= operatorname{mex}(S)=2 , b= max(S)=4 , lceil frac{a+b}{2} rceil=3 . So 3 is added into S , and S becomes {0,1,3,3,4 } . The answer is 4 . In the second test case, S= {0,1,4 } , a= operatorname{mex}(S)=2 , b= max(S)=4 , lceil frac{a+b}{2} rceil=3 . So 3 is added into S , and S becomes {0,1,3,4 } . The answer is 4 . '...

Tutorials

Codeforces Round #706 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
109645638 rajshreerao6 B March 10, 2021, 5:22 p.m. OK GNU C11 TESTS 14 46 409600
109635268 Sambasai B March 10, 2021, 3:33 p.m. OK GNU C11 TESTS 13 46 409600
109638996 Xinull B March 10, 2021, 4:07 p.m. OK GNU C11 TESTS 13 46 819200
109627718 wszdbha B March 10, 2021, 2:41 p.m. OK GNU C11 TESTS 13 46 2048000
109637470 Imakf B March 10, 2021, 3:53 p.m. OK GNU C++11 TESTS 13 15 819200
109666195 airbust B March 11, 2021, 2:35 a.m. OK GNU C++11 TESTS 14 31 819200
109665848 054545641 B March 11, 2021, 2:25 a.m. OK GNU C++11 TESTS 14 31 819200
109664468 8I78541919 B March 11, 2021, 1:34 a.m. OK GNU C++11 TESTS 14 31 3174400
109622814 hnust_xiaoshun B March 10, 2021, 2:04 p.m. OK GNU C++11 TESTS 13 46 204800
109627068 chunzhen B March 10, 2021, 2:38 p.m. OK GNU C++11 TESTS 13 46 204800
109627324 ffffffffffq B March 10, 2021, 2:39 p.m. OK GNU C++11 TESTS 13 46 204800
109662282 Brian_Pollux B March 10, 2021, 11:54 p.m. OK GNU C++11 TESTS 14 46 204800
109665516 Dragon_hao B March 11, 2021, 2:14 a.m. OK GNU C++11 TESTS 14 46 409600
109665720 invaded B March 11, 2021, 2:21 a.m. OK GNU C++11 TESTS 14 46 409600
109633748 jyotikrjc B March 10, 2021, 3:20 p.m. OK GNU C++14 TESTS 13 31 921600
109644149 iamrakeshri28 B March 10, 2021, 5:04 p.m. OK GNU C++14 TESTS 14 46 409600
109634992 shreyanshgupta838 B March 10, 2021, 3:30 p.m. OK GNU C++14 TESTS 13 46 409600
109631993 Uchiha.Itachi B March 10, 2021, 3:07 p.m. OK GNU C++14 TESTS 13 46 409600
109672178 nitvjudge1 B March 11, 2021, 5:05 a.m. OK GNU C++14 TESTS 14 46 409600
109669305 yash_4 B March 11, 2021, 4:03 a.m. OK GNU C++14 TESTS 14 46 409600
109663581 T_Y_T B March 11, 2021, 12:59 a.m. OK GNU C++14 TESTS 14 46 409600
109662438 carmen__ B March 11, 2021, 12:02 a.m. OK GNU C++14 TESTS 14 46 512000
109671050 harshit2503 B March 11, 2021, 4:43 a.m. OK GNU C++14 TESTS 14 46 512000
109673786 RAJ_SINOJIA B March 11, 2021, 5:31 a.m. OK GNU C++14 TESTS 14 46 512000
109654126 zucyo05 B March 10, 2021, 7:26 p.m. OK GNU C++17 TESTS 14 31 98713600
109637765 lxxxl B March 10, 2021, 3:55 p.m. OK GNU C++17 TESTS 13 46 409600
109674620 chetankumar B March 11, 2021, 5:44 a.m. OK GNU C++17 TESTS 14 46 409600
109670398 AhmedGhazaly B March 11, 2021, 4:29 a.m. OK GNU C++17 TESTS 14 46 409600
109665130 shaojiangtao B March 11, 2021, 1:59 a.m. OK GNU C++17 TESTS 14 46 409600
109663946 USTS_mofan552 B March 11, 2021, 1:15 a.m. OK GNU C++17 TESTS 14 46 409600
109652089 atlas22 B March 10, 2021, 6:52 p.m. OK GNU C++17 TESTS 14 46 409600
109642229 hangs B March 10, 2021, 4:41 p.m. OK GNU C++17 TESTS 14 46 409600
109640542 im_karan23 B March 10, 2021, 4:23 p.m. OK GNU C++17 TESTS 14 46 409600
109640317 abucoder B March 10, 2021, 4:20 p.m. OK GNU C++17 TESTS 14 46 409600
109644238 PochurSolveKortaHobaa B March 10, 2021, 5:06 p.m. OK GNU C++17 (64) TESTS 14 31 409600
109640962 nikolayfedoroff B March 10, 2021, 4:28 p.m. OK GNU C++17 (64) TESTS 14 31 409600
109632652 mine691_lily B March 10, 2021, 3:11 p.m. OK GNU C++17 (64) TESTS 13 31 409600
109671293 ans_human B March 11, 2021, 4:48 a.m. OK GNU C++17 (64) TESTS 14 31 819200
109647516 Prateek B March 10, 2021, 5:46 p.m. OK GNU C++17 (64) TESTS 14 31 819200
109629026 L1ngYu233 B March 10, 2021, 2:48 p.m. OK GNU C++17 (64) TESTS 13 31 819200
109658875 eyangch B March 10, 2021, 9:23 p.m. OK GNU C++17 (64) TESTS 14 46 409600
109647380 MarcosK B March 10, 2021, 5:44 p.m. OK GNU C++17 (64) TESTS 14 46 409600
109655494 verigo B March 10, 2021, 7:51 p.m. OK GNU C++17 (64) TESTS 14 46 409600
109645437 AceKing B March 10, 2021, 5:19 p.m. OK GNU C++17 (64) TESTS 14 46 409600
109629122 MILLER923 B March 10, 2021, 2:48 p.m. OK Go TESTS 13 109 409600
109639423 CoronaTime B March 10, 2021, 4:11 p.m. OK Java 11 TESTS 14 202 0
109653959 devil_the_coder B March 10, 2021, 7:23 p.m. OK Java 11 TESTS 14 218 3891200
109632807 PetrNguyen B March 10, 2021, 3:13 p.m. OK Java 11 TESTS 13 233 1638400
109670296 Akshat1409 B March 11, 2021, 4:27 a.m. OK Java 11 TESTS 14 233 2150400
109673731 SaberXpro B March 11, 2021, 5:30 a.m. OK Java 11 TESTS 14 249 1433600
109644616 coderrohan14 B March 10, 2021, 5:10 p.m. OK Java 11 TESTS 14 249 1945600
109636049 wizwilzo B March 10, 2021, 3:39 p.m. OK Java 11 TESTS 13 249 2150400
109635227 area__51 B March 10, 2021, 3:32 p.m. OK Java 11 TESTS 13 249 2969600
109672663 alan__walker B March 11, 2021, 5:14 a.m. OK Java 11 TESTS 14 264 2252800
109637523 codebook_2000 B March 10, 2021, 3:53 p.m. OK Java 11 TESTS 13 264 8601600
109635947 Dhananjay.07 B March 10, 2021, 3:38 p.m. OK Java 8 TESTS 13 140 0
109635804 Dhananjay.07 B March 10, 2021, 3:37 p.m. OK Java 8 TESTS 13 155 0
109648112 Abhichauhan B March 10, 2021, 5:54 p.m. OK Java 8 TESTS 14 155 0
109636015 Dhananjay.07 B March 10, 2021, 3:39 p.m. OK Java 8 TESTS 13 155 0
109646834 coolManit B March 10, 2021, 5:37 p.m. OK Java 8 TESTS 14 170 0
109626222 rw6 B March 10, 2021, 2:34 p.m. OK Java 8 TESTS 13 171 0
109662727 Java B March 11, 2021, 12:17 a.m. OK Java 8 TESTS 14 171 0
109635480 upriverbasil B March 10, 2021, 3:35 p.m. OK Java 8 TESTS 13 171 0
109628148 akshay23codes B March 10, 2021, 2:43 p.m. OK Java 8 TESTS 13 171 0
109625605 InANutshell B March 10, 2021, 2:31 p.m. OK Java 8 TESTS 13 171 0
109667095 Spheniscine B March 11, 2021, 3 a.m. OK Kotlin TESTS 14 155 1126400
109674359 noisegain B March 11, 2021, 5:40 a.m. OK Kotlin TESTS 14 249 5529600
109653165 koper B March 10, 2021, 7:09 p.m. OK Kotlin TESTS 14 280 6348800
109663722 SnowChildren B March 11, 2021, 1:05 a.m. OK MS C++ 2017 TESTS 14 93 3584000
109662486 kauku_shikmar B March 11, 2021, 12:05 a.m. OK MS C++ 2017 TESTS 14 108 409600
109662506 kauku_shikmar B March 11, 2021, 12:06 a.m. OK MS C++ 2017 TESTS 14 108 409600
109634049 dingzhao777 B March 10, 2021, 3:22 p.m. OK MS C++ 2017 TESTS 13 124 4915200
109665491 Albertplus007 B March 11, 2021, 2:13 a.m. OK MS C++ 2017 TESTS 14 124 5120000
109663832 ky_fishing B March 11, 2021, 1:10 a.m. OK MS C++ 2017 TESTS 14 124 5222400
109635670 ustaritz B March 10, 2021, 3:36 p.m. OK MS C++ 2017 TESTS 13 156 3584000
109633608 qing_lin B March 10, 2021, 3:19 p.m. OK MS C++ 2017 TESTS 13 156 4198400
109665830 kawayisang B March 11, 2021, 2:25 a.m. OK MS C++ 2017 TESTS 14 186 6451200
109667566 sakapon B March 11, 2021, 3:15 a.m. OK .NET Core C# TESTS 14 108 8396800
109670103 henrychenOutlook B March 11, 2021, 4:22 a.m. OK Node.js TESTS 14 124 13619200
109645873 Anuranjan_Pandey B March 10, 2021, 5:25 p.m. OK PyPy 3 TESTS 14 124 11878400
109628707 nitish420 B March 10, 2021, 2:46 p.m. OK PyPy 3 TESTS 13 139 13312000
109656747 at_f B March 10, 2021, 8:20 p.m. OK PyPy 3 TESTS 14 140 11468800
109625068 ..i.. B March 10, 2021, 2:29 p.m. OK PyPy 3 TESTS 13 140 12390400
109631290 abhisheka950 B March 10, 2021, 3:02 p.m. OK PyPy 3 TESTS 13 140 12595200
109635468 rajbit B March 10, 2021, 3:34 p.m. OK PyPy 3 TESTS 13 155 12185600
109629080 Kunal_makwana B March 10, 2021, 2:48 p.m. OK PyPy 3 TESTS 13 155 13209600
109648593 L_drago_1 B March 10, 2021, 6:02 p.m. OK PyPy 3 TESTS 14 155 14028800
109632203 armsusman B March 10, 2021, 3:08 p.m. OK PyPy 3 TESTS 13 156 10444800
109648920 light_yagami52 B March 10, 2021, 6:06 p.m. OK PyPy 3 TESTS 14 171 10649600
109653722 parth_sak12 B March 10, 2021, 7:18 p.m. OK Python 3 TESTS 14 93 11059200
109640110 keytime B March 10, 2021, 4:18 p.m. OK Python 3 TESTS 14 108 11059200
109628367 ellunia B March 10, 2021, 2:44 p.m. OK Python 3 TESTS 13 109 8396800
109650874 pisali B March 10, 2021, 6:34 p.m. OK Python 3 TESTS 14 109 8601600
109638722 keytime B March 10, 2021, 4:05 p.m. OK Python 3 TESTS 13 109 11059200
109630643 rupsgrover B March 10, 2021, 2:57 p.m. OK Python 3 TESTS 13 109 11059200
109647841 praharshamuvva B March 10, 2021, 5:50 p.m. OK Python 3 TESTS 14 124 8396800
109644965 bushra04 B March 10, 2021, 5:14 p.m. OK Python 3 TESTS 14 124 8396800
109628865 NS3081992 B March 10, 2021, 2:47 p.m. OK Python 3 TESTS 13 124 8601600
109627351 hogrider B March 10, 2021, 2:40 p.m. OK Python 3 TESTS 13 124 8601600
109650250 Millouw B March 10, 2021, 6:25 p.m. OK Rust TESTS 14 31 3788800
109650856 apilat B March 10, 2021, 6:34 p.m. OK Rust TESTS 14 78 2355200

remove filters

Back to search problems