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
( 15866 ) A Meximum Array PROGRAMMING brute force constructive algorithms greedy math

B'Mihai has just learned about the MEX concept and since he liked it so much, he decided to use it right away. Given an array a of n non-negative integers, Mihai wants to create a new array b that is formed in the following way: While a is not empty: But, since Mihai loves big arrays as much as the MEX concept, he wants the new array b to be the lexicographically maximum. So, Mihai asks you to tell him what the maximum array b that can be created by constructing the array optimally is. An array x is lexicographically greater than an array y if in the first position where x and y differ x_i > y_i or if |x| > |y| and y is a prefix of x (where |x| denotes the size of the array x ). The MEX of a set of non-negative integers is the minimal non-negative integer such that it is not in the set. For example, MEX({ {1, 2, 3} }) = 0 and MEX({ {0, 1, 2, 4, 5} }) = 3 . The first line of the input contains a single integer t ( 1 <= t <= 100 ) -- the number of test cases. The description of test cases follows. The first line of each test case contains a single integer n ( 1 <= q n <= q 2 cdot 10^5 ) -- the number of elements in the array a . The second line of each test case contains n non-negative integers a_1, ldots, a_n ( 0 <= q a_i <= q n ), where a_i is the i -th integer from the array a . It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case print m -- the length of the maximum array b Mihai can create, followed by m integers denoting the elements of the array b . In the first test case, the lexicographically maximum array b is obtained by selecting k=5 , resulting in the MEX of the whole array a . It is lexicographically maximum because an array starting with a smaller number than 4'...

Tutorials

99276

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
143720513 unknownSolver A Jan. 22, 2022, 9:46 p.m. OK Clang++17 Diagnostics TESTS 23 1419 32563200
143648899 Gassa A Jan. 22, 2022, 2:55 p.m. OK D TESTS 23 46 6144000
143708029 rainboy A Jan. 22, 2022, 6:04 p.m. OK GNU C11 TESTS 23 312 2662400
143634629 Sol1 A Jan. 22, 2022, 2:41 p.m. OK GNU C++14 TESTS 23 31 5017600
143645978 fr200110217102 A Jan. 22, 2022, 2:52 p.m. OK GNU C++14 TESTS 23 46 2662400
143645381 gzchenben A Jan. 22, 2022, 2:51 p.m. OK GNU C++14 TESTS 23 46 2867200
143638049 RNG-Ming A Jan. 22, 2022, 2:44 p.m. OK GNU C++14 TESTS 23 46 3174400
143653244 yekehe A Jan. 22, 2022, 3:01 p.m. OK GNU C++14 TESTS 23 46 3174400
143645540 Daas A Jan. 22, 2022, 2:51 p.m. OK GNU C++14 TESTS 23 46 3174400
143641445 eiruty A Jan. 22, 2022, 2:47 p.m. OK GNU C++14 TESTS 23 46 3174400
143663356 scw A Jan. 22, 2022, 3:17 p.m. OK GNU C++14 TESTS 23 46 3379200
143663583 Sortoite A Jan. 22, 2022, 3:17 p.m. OK GNU C++14 TESTS 23 46 3481600
143723489 ETK. A Jan. 22, 2022, 11:42 p.m. OK GNU C++14 TESTS 23 46 3481600
143699929 izone A Jan. 22, 2022, 4:34 p.m. OK GNU C++17 TESTS 23 31 3072000
143638497 fallleaves01 A Jan. 22, 2022, 2:44 p.m. OK GNU C++17 TESTS 23 31 6041600
143663453 XyzL A Jan. 22, 2022, 3:17 p.m. OK GNU C++17 TESTS 23 31 11571200
143739108 baizhiyue A Jan. 23, 2022, 5:50 a.m. OK GNU C++17 TESTS 24 46 2662400
143714060 RadiantCheddar A Jan. 22, 2022, 7:22 p.m. OK GNU C++17 TESTS 23 46 2662400
143647211 peterwuyihong A Jan. 22, 2022, 2:53 p.m. OK GNU C++17 TESTS 23 46 2764800
143640232 OMG_link A Jan. 22, 2022, 2:46 p.m. OK GNU C++17 TESTS 23 46 2764800
143688472 jschnei A Jan. 22, 2022, 4:08 p.m. OK GNU C++17 TESTS 23 46 2867200
143709678 Yara_Yara A Jan. 22, 2022, 6:22 p.m. OK GNU C++17 TESTS 23 46 2867200
143645442 limanjun A Jan. 22, 2022, 2:51 p.m. OK GNU C++17 TESTS 23 46 2867200
143634018 LayCurse A Jan. 22, 2022, 2:41 p.m. OK GNU C++17 (64) TESTS 23 30 5324800
143731012 wondol A Jan. 23, 2022, 3:46 a.m. OK GNU C++17 (64) TESTS 24 31 2662400
143683823 Andreasyan A Jan. 22, 2022, 3:58 p.m. OK GNU C++17 (64) TESTS 23 31 2867200
143702778 neal A Jan. 22, 2022, 5:26 p.m. OK GNU C++17 (64) TESTS 23 31 3481600
143636998 Froggay A Jan. 22, 2022, 2:43 p.m. OK GNU C++17 (64) TESTS 23 31 3481600
143637138 QAQAutoMaton A Jan. 22, 2022, 2:43 p.m. OK GNU C++17 (64) TESTS 23 31 12902400
143726777 ac-automata A Jan. 23, 2022, 2 a.m. OK GNU C++17 (64) TESTS 23 31 26214400
143642450 KyuusyouTheSavior A Jan. 22, 2022, 2:48 p.m. OK GNU C++17 (64) TESTS 23 46 2457600
143645043 KADR A Jan. 22, 2022, 2:51 p.m. OK GNU C++17 (64) TESTS 23 46 2560000
143739332 RobeZH A Jan. 23, 2022, 5:52 a.m. OK GNU C++17 (64) TESTS 24 46 2662400
143648417 halin.george A Jan. 22, 2022, 2:55 p.m. OK GNU C++20 (64) TESTS 23 31 2662400
143649877 chaihf A Jan. 22, 2022, 2:56 p.m. OK GNU C++20 (64) TESTS 23 31 2662400
143633341 SomethingNew A Jan. 22, 2022, 2:40 p.m. OK GNU C++20 (64) TESTS 23 31 2662400
143647199 lyfzxy1314 A Jan. 22, 2022, 2:53 p.m. OK GNU C++20 (64) TESTS 23 31 2867200
143639092 Skyqwq A Jan. 22, 2022, 2:45 p.m. OK GNU C++20 (64) TESTS 23 31 3174400
143636159 IntoTheNight A Jan. 22, 2022, 2:42 p.m. OK GNU C++20 (64) TESTS 23 31 3481600
143643202 Boboge A Jan. 22, 2022, 2:49 p.m. OK GNU C++20 (64) TESTS 23 31 3481600
143641471 HollwoQ_Pelw A Jan. 22, 2022, 2:47 p.m. OK GNU C++20 (64) TESTS 23 31 3481600
143637487 gxy001 A Jan. 22, 2022, 2:43 p.m. OK GNU C++20 (64) TESTS 23 31 3481600
143636224 Rubikun A Jan. 22, 2022, 2:42 p.m. OK GNU C++20 (64) TESTS 23 31 3481600
143649083 clyring A Jan. 22, 2022, 2:55 p.m. OK Haskell TESTS 23 186 30515200
143719248 derrick20 A Jan. 22, 2022, 9:09 p.m. OK Java 11 TESTS 23 171 0
143720182 derrick20 A Jan. 22, 2022, 9:36 p.m. OK Java 11 TESTS 23 171 0
143719776 derrick20 A Jan. 22, 2022, 9:24 p.m. OK Java 11 TESTS 23 171 0
143719569 derrick20 A Jan. 22, 2022, 9:19 p.m. OK Java 11 TESTS 23 218 0
143719746 derrick20 A Jan. 22, 2022, 9:23 p.m. OK Java 11 TESTS 23 218 0
143653442 Ste A Jan. 22, 2022, 3:01 p.m. OK Java 11 TESTS 23 218 0
143717955 Toinfinity A Jan. 22, 2022, 8:37 p.m. OK Java 11 TESTS 23 233 0
143639819 earl_of_byteland A Jan. 22, 2022, 2:45 p.m. OK Java 11 TESTS 23 280 13312000
143644677 saptarshi1729 A Jan. 22, 2022, 2:50 p.m. OK Java 11 TESTS 23 280 23244800
143648893 martins A Jan. 22, 2022, 2:55 p.m. OK Java 11 TESTS 23 327 16486400
143640514 golions A Jan. 22, 2022, 2:46 p.m. OK Java 8 TESTS 23 155 0
143641454 iakovlev.zakhar A Jan. 22, 2022, 2:47 p.m. OK Java 8 TESTS 23 155 0
143638558 SecondThread A Jan. 22, 2022, 2:44 p.m. OK Java 8 TESTS 23 156 38400000
143718341 green_619 A Jan. 22, 2022, 8:46 p.m. OK Java 8 TESTS 23 171 2150400
143644403 AdhmMohamed A Jan. 22, 2022, 2:50 p.m. OK Java 8 TESTS 23 202 0
143640287 MagentaCobra A Jan. 22, 2022, 2:46 p.m. OK Java 8 TESTS 23 202 0
143649629 AndreySiunov A Jan. 22, 2022, 2:56 p.m. OK Java 8 TESTS 23 218 7987200
143686051 fetetriste A Jan. 22, 2022, 4:03 p.m. OK Java 8 TESTS 23 233 12902400
143639611 arvindf232 A Jan. 22, 2022, 2:45 p.m. OK Kotlin 1.4 TESTS 23 171 1945600
143640823 Hakiobo A Jan. 22, 2022, 2:46 p.m. OK Kotlin 1.4 TESTS 23 234 17920000
143670048 GeKa A Jan. 22, 2022, 3:29 p.m. OK MS C++ 2017 TESTS 23 156 4710400
143644454 machine_solution A Jan. 22, 2022, 2:50 p.m. OK MS C++ 2017 TESTS 23 373 11468800
143652900 mban259 A Jan. 22, 2022, 3 p.m. OK .NET Core C# TESTS 23 140 23040000
143655772 Andybar A Jan. 22, 2022, 3:04 p.m. OK .NET Core C# TESTS 23 296 32665600
143646800 bcollet A Jan. 22, 2022, 2:53 p.m. OK PyPy 2 TESTS 23 202 17100800
143672941 NecroSean38 A Jan. 22, 2022, 3:35 p.m. OK PyPy 3 TESTS 23 171 14848000
143643744 codicon A Jan. 22, 2022, 2:49 p.m. OK PyPy 3 TESTS 23 187 17612800
143642095 whatshisbucket A Jan. 22, 2022, 2:48 p.m. OK PyPy 3 TESTS 23 202 16384000
143638496 SPD_9X2 A Jan. 22, 2022, 2:44 p.m. OK PyPy 3 TESTS 23 202 19353600
143646830 titia A Jan. 22, 2022, 2:53 p.m. OK PyPy 3 TESTS 23 217 16896000
143735913 siddhantiiits A Jan. 23, 2022, 5:09 a.m. OK PyPy 3 TESTS 24 234 20582400
143647194 MathisHammel A Jan. 22, 2022, 2:53 p.m. OK PyPy 3 TESTS 23 264 15360000
143643372 Slamur A Jan. 22, 2022, 2:49 p.m. OK PyPy 3-64 TESTS 23 217 25600000
143733689 sleepy-lynx A Jan. 23, 2022, 4:35 a.m. OK PyPy 3-64 TESTS 24 218 34508800
143652897 manish.17 A Jan. 22, 2022, 3 p.m. OK PyPy 3-64 TESTS 23 280 40448000
143642219 shotoyoo A Jan. 22, 2022, 2:48 p.m. OK PyPy 3-64 TESTS 23 390 30924800
143656104 huikang A Jan. 22, 2022, 3:05 p.m. OK PyPy 3-64 TESTS 23 529 32768000
143651242 oadey89 A Jan. 22, 2022, 2:58 p.m. OK PyPy 3-64 TESTS 23 530 27852800
143643860 chinerist A Jan. 22, 2022, 2:50 p.m. OK PyPy 3-64 TESTS 23 577 33177600
143644736 Jimanbanashi A Jan. 22, 2022, 2:51 p.m. OK Python 2 TESTS 23 265 18841600
143723154 pratt_co A Jan. 22, 2022, 11:25 p.m. OK Python 3 TESTS 23 280 12902400
143643432 r57shell A Jan. 22, 2022, 2:49 p.m. OK Python 3 TESTS 23 311 23654400
143721199 ervin5 A Jan. 22, 2022, 10:10 p.m. OK Python 3 TESTS 23 312 12595200
143721283 ervin5 A Jan. 22, 2022, 10:12 p.m. OK Python 3 TESTS 23 342 12390400
143720195 qqrules A Jan. 22, 2022, 9:37 p.m. OK Python 3 TESTS 23 498 73625600
143650704 kingmoshe A Jan. 22, 2022, 2:57 p.m. OK Python 3 TESTS 23 514 11673600
143635683 sansen A Jan. 22, 2022, 2:42 p.m. OK Rust 2021 TESTS 23 30 4505600
143659318 orz_liuwei A Jan. 22, 2022, 3:10 p.m. OK Rust 2021 TESTS 23 31 7884800
143706175 kobae964 A Jan. 22, 2022, 5:47 p.m. OK Rust 2021 TESTS 23 46 4505600
143636636 qwerty787788 A Jan. 22, 2022, 2:43 p.m. OK Rust 2021 TESTS 23 46 4505600
143639633 kobae964 A Jan. 22, 2022, 2:45 p.m. OK Rust 2021 TESTS 23 46 4812800
143730745 Spheniscine A Jan. 23, 2022, 3:41 a.m. OK Rust 2021 TESTS 24 46 5529600
143638585 Egor A Jan. 22, 2022, 2:44 p.m. OK Rust 2021 TESTS 23 46 19558400

remove filters

Back to search problems