Codeforces Round 866 (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
1819 Codeforces Round 866 (Div. 1) FINISHED False 7200 50273699 April 15, 2023, 9:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 12862 ) A Constructive Problem PROGRAMMING brute force greedy implementation

B'As you know, any problem that does not require the use of complex data structures is considered constructive. You are offered to solve one of such problems. You are given an array a of n non-negative integers. You are allowed to perform the following operation exactly once: choose some non-empty subsegment a_l, a_{l+1}, ldots, a_r of the array a and a non-negative integer k , and assign value k to all elements of the array on the chosen subsegment. The task is to find out whether operatorname{MEX}(a) can be increased by exactly one by performing such an operation. In other words, if before the operation operatorname{MEX}(a) = m held, then after the operation it must hold that operatorname{MEX}(a) = m + 1 . Recall that operatorname{MEX} of a set of integers c_1, c_2, ldots, c_k is defined as the smallest non-negative integer x which does not occur in the set c . Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 50 ,000 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= n <= 200 ,000 ) -- the number of elements of array a . The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 0 <= a_i <= 10^9 ) -- elements of array a . It is guaranteed that the sum n over all test cases does not exceed 200 ,000 . For each test case, print "Yes" if you can increase operatorname{MEX}(a) by exactly one by performing the operation from the statement exactly once, otherwise print "No". You can output the answer in any case (upper or lower). For example, the strings "yEs", "yes", "Yes", and "YES" will be recognized as positive responses. In the first test case, operatorname{MEX}(a) = 0 . If you set all elements of a to 0 , then operatorname'...

Tutorials

Codeforces Round #866 (Div.1, Div.2, based on Lipetsk Team Olympiad) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
202182459 mban259 A April 15, 2023, 9:14 a.m. OK C# 10 TESTS 24 93 22118400
202187020 DmitriyAnikeyev A April 15, 2023, 9:23 a.m. OK C# 10 TESTS 24 140 32870400
202189514 kakel_san A April 15, 2023, 9:29 a.m. OK C# 8 TESTS 24 124 17408000
202181784 hos.lyric A April 15, 2023, 9:12 a.m. OK D TESTS 24 62 13516800
202189942 Gassa A April 15, 2023, 9:29 a.m. OK D TESTS 24 93 6246400
202184193 chro4896 A April 15, 2023, 9:17 a.m. OK GNU C11 TESTS 24 171 2355200
202181207 20333333333 A April 15, 2023, 9:11 a.m. OK GNU C++14 TESTS 24 30 6963200
202188309 Pompeii A April 15, 2023, 9:25 a.m. OK GNU C++14 TESTS 24 31 2662400
202181742 Jormungandre A April 15, 2023, 9:12 a.m. OK GNU C++14 TESTS 24 46 1638400
202193065 MCPlayer542 A April 15, 2023, 9:35 a.m. OK GNU C++14 TESTS 24 62 1024000
202186682 t98slider A April 15, 2023, 9:22 a.m. OK GNU C++14 TESTS 24 62 1638400
202186267 SAA0817 A April 15, 2023, 9:21 a.m. OK GNU C++14 TESTS 24 62 1638400
202185163 Imdie A April 15, 2023, 9:19 a.m. OK GNU C++14 TESTS 24 62 1638400
202183201 buko A April 15, 2023, 9:15 a.m. OK GNU C++14 TESTS 24 62 1638400
202182724 PRINCE_OF_TURTLE A April 15, 2023, 9:14 a.m. OK GNU C++14 TESTS 24 62 1638400
202240000 XG0000 A April 15, 2023, 12:33 p.m. OK GNU C++14 TESTS 24 62 1638400
202182751 MarbIue A April 15, 2023, 9:14 a.m. OK GNU C++17 TESTS 24 30 2662400
202181180 dimss A April 15, 2023, 9:11 a.m. OK GNU C++17 TESTS 24 61 819200
202184158 AQil A April 15, 2023, 9:17 a.m. OK GNU C++17 TESTS 24 61 819200
202182661 Fuzen527 A April 15, 2023, 9:14 a.m. OK GNU C++17 TESTS 24 61 1126400
202181264 ikaurov A April 15, 2023, 9:11 a.m. OK GNU C++17 TESTS 24 61 1638400
202185897 AlexanderL A April 15, 2023, 9:21 a.m. OK GNU C++17 TESTS 24 62 819200
202184770 Radin_Zahedi A April 15, 2023, 9:18 a.m. OK GNU C++17 TESTS 24 62 1024000
202181796 pantw A April 15, 2023, 9:12 a.m. OK GNU C++17 TESTS 24 62 1024000
202276390 prafull_08 A April 15, 2023, 5:58 p.m. OK GNU C++17 TESTS 24 62 1024000
202181134 TsReaper A April 15, 2023, 9:11 a.m. OK GNU C++17 TESTS 24 62 1024000
202182815 Lawali A April 15, 2023, 9:15 a.m. OK GNU C++17 (64) TESTS 24 31 1638400
202183227 udon1206 A April 15, 2023, 9:15 a.m. OK GNU C++17 (64) TESTS 24 46 819200
202183763 MAOooOAM A April 15, 2023, 9:17 a.m. OK GNU C++17 (64) TESTS 24 46 1024000
202182190 kotatsugame A April 15, 2023, 9:13 a.m. OK GNU C++17 (64) TESTS 24 46 1331200
202183752 AmirAli-Asgari A April 15, 2023, 9:17 a.m. OK GNU C++17 (64) TESTS 24 46 1638400
202183030 HCPS42 A April 15, 2023, 9:15 a.m. OK GNU C++17 (64) TESTS 24 46 1638400
202182948 ALILILILILI-KHAN A April 15, 2023, 9:15 a.m. OK GNU C++17 (64) TESTS 24 46 1638400
202189516 MarcosK A April 15, 2023, 9:29 a.m. OK GNU C++17 (64) TESTS 24 46 1638400
202184391 UnoK A April 15, 2023, 9:18 a.m. OK GNU C++17 (64) TESTS 24 46 1638400
202190827 SyruLoveNewTechnology A April 15, 2023, 9:31 a.m. OK GNU C++17 (64) TESTS 24 46 1843200
202180819 tfg A April 15, 2023, 9:10 a.m. OK GNU C++20 (64) TESTS 24 31 819200
202184804 -kirito- A April 15, 2023, 9:18 a.m. OK GNU C++20 (64) TESTS 24 31 1024000
202207474 N1KlTA A April 15, 2023, 10:06 a.m. OK GNU C++20 (64) TESTS 24 31 1638400
202182576 ebi_fly A April 15, 2023, 9:14 a.m. OK GNU C++20 (64) TESTS 24 31 2457600
202183275 gigabuffoon A April 15, 2023, 9:16 a.m. OK GNU C++20 (64) TESTS 24 31 2457600
202189995 Tx_Lcy A April 15, 2023, 9:29 a.m. OK GNU C++20 (64) TESTS 24 31 3174400
202181446 jiangbowen A April 15, 2023, 9:12 a.m. OK GNU C++20 (64) TESTS 24 31 4403200
202183672 Badint A April 15, 2023, 9:16 a.m. OK GNU C++20 (64) TESTS 24 31 4812800
202182889 Perpetually_Purple A April 15, 2023, 9:15 a.m. OK GNU C++20 (64) TESTS 24 31 4812800
202190478 anton_h A April 15, 2023, 9:30 a.m. OK GNU C++20 (64) TESTS 24 31 4812800
202186993 profchi A April 15, 2023, 9:23 a.m. OK Java 11 TESTS 24 421 8704000
202262648 BabyBlue0514 A April 15, 2023, 3:38 p.m. OK Java 11 TESTS 24 436 5836800
202243557 kasiru_69 A April 15, 2023, 12:59 p.m. OK Java 11 TESTS 24 685 0
202261685 sid234890 A April 15, 2023, 3:29 p.m. OK Java 17 TESTS 24 607 16588800
202201521 yvbf A April 15, 2023, 9:53 a.m. OK Java 8 TESTS 24 170 0
202295637 golions A April 15, 2023, 8:23 p.m. OK Java 8 TESTS 24 217 2969600
202276130 IanISam A April 15, 2023, 5:55 p.m. OK Java 8 TESTS 24 436 18534400
202189388 elizarov A April 15, 2023, 9:28 a.m. OK Kotlin 1.7 TESTS 24 795 65126400
202182748 Tlatoani A April 15, 2023, 9:14 a.m. OK Kotlin 1.7 TESTS 24 888 142131200
202187286 shobonvip A April 15, 2023, 9:23 a.m. OK PyPy 3 TESTS 24 732 23654400
202187297 blue_ice_yj A April 15, 2023, 9:23 a.m. OK PyPy 3-64 TESTS 24 202 28979200
202180716 toam A April 15, 2023, 9:10 a.m. OK PyPy 3-64 TESTS 24 202 34611200
202192990 Maruzensky A April 15, 2023, 9:35 a.m. OK PyPy 3-64 TESTS 24 218 26726400
202181571 PyIsBestLang A April 15, 2023, 9:12 a.m. OK PyPy 3-64 TESTS 24 264 29696000
202181244 chinerist A April 15, 2023, 9:11 a.m. OK PyPy 3-64 TESTS 24 389 25907200
202182565 kyoran A April 15, 2023, 9:14 a.m. OK PyPy 3-64 TESTS 24 405 27750400
202245907 drugkeeper A April 15, 2023, 1:18 p.m. OK PyPy 3-64 TESTS 24 405 93184000
202270575 Kita A April 15, 2023, 5:03 p.m. OK PyPy 3-64 TESTS 24 452 32256000
202181289 alexwice A April 15, 2023, 9:11 a.m. OK PyPy 3-64 TESTS 24 468 38297600
202243474 great_fortune A April 15, 2023, 12:59 p.m. OK PyPy 3-64 TESTS 24 717 20377600
202182696 Egor A April 15, 2023, 9:14 a.m. OK Rust 2021 TESTS 24 30 9113600
202186905 hiratai A April 15, 2023, 9:23 a.m. OK Rust 2021 TESTS 24 46 7884800
202186711 Unwise A April 15, 2023, 9:22 a.m. OK Rust 2021 TESTS 24 62 18329600
202182339 sansen A April 15, 2023, 9:13 a.m. OK Rust 2021 TESTS 24 78 9318400
202260415 Jovfer A April 15, 2023, 3:17 p.m. OK Rust 2021 TESTS 24 311 7884800
202211387 WaterColor2037 A April 15, 2023, 10:16 a.m. OK Rust 2021 TESTS 24 311 9625600

remove filters

Back to search problems