Codeforces Round 1034 (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
2123 Codeforces Round 1034 (Div. 3) FINISHED False 8100 25025123 July 1, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 14806 ) E MEX Count PROGRAMMING binary search data structures greedy sortings two pointers

Define the (\mathrm{MEX}) (minimum excluded value) of an array to be the smallest nonnegative integer not present in the array. For example, (\mathrm{MEX}(2, 2, 1) = 0) because (0) is not in the array. (\mathrm{MEX}(3, 1, 0, 1) = 2) because (0) and (1) are in the array but (2) is not. (\mathrm{MEX}(0, 3, 1, 2) = 4) because (0), (1), (2), and (3) are in the array but (4) is not. You are given an array (a) of size (n) of nonnegative integers. For all (k) ((0\leq k \leq n)), count the number of possible values of (\mathrm{MEX}(a)) after removing exactly (k) values from (a). The first line contains an integer (t) ((1\leq t\leq 10^4)) — the number of test cases. The first line of each test case contains one integer (n) ((1\leq n\leq 2\cdot 10^5)) — the size of the array (a). The second line of each test case contains (n) integers, (a_1,a_2,\dots,a_n) ((0\leq a_i\leq n)). It is guaranteed that the sum of (n) over all test cases does not exceed (2\cdot 10^5). For each test case, output a single line containing (n+1) integers — the number of possible values of (\mathrm{MEX}(a)) after removing exactly (k) values, for (k=0,1,\dots,n). In the first sample, consider (k=1). If you remove a (0), then you get the following array: 1 0 1 2 So we get (\mathrm{MEX}(a) = 3). Alternatively, if you remove the (2), then you get the following array: 1 0 0 1 So we get (\mathrm{MEX}(a) = 2). It can be shown that these are the only possible values of (\mathrm{MEX}(a)) after removing exactly one value. So the output for (k=1) is (2).

Tutorials

Codeforces Round 1034 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
327178744 og.kostya E July 3, 2025, 6 a.m. OK C# 13 TESTS 11 202 7168000
327146141 1ANH6 E July 2, 2025, 9:13 p.m. OK C++17 (GCC 7-32) TESTS 11 93 0
327143387 Nirotsu E July 2, 2025, 8:28 p.m. OK C++17 (GCC 7-32) TESTS 11 93 0
327138108 shrujal.ps E July 2, 2025, 7:20 p.m. OK C++17 (GCC 7-32) TESTS 11 93 0
327131741 Laviet E July 2, 2025, 6:19 p.m. OK C++17 (GCC 7-32) TESTS 11 93 0
327080569 Arion10 E July 2, 2025, noon OK C++17 (GCC 7-32) TESTS 11 93 0
327075018 Aeternum632 E July 2, 2025, 11:24 a.m. OK C++17 (GCC 7-32) TESTS 11 93 0
327063884 thewhitewolf2004 E July 2, 2025, 10:07 a.m. OK C++17 (GCC 7-32) TESTS 11 93 0
327023954 ugayush360 E July 2, 2025, 4:36 a.m. OK C++17 (GCC 7-32) TESTS 11 93 0
327021466 Codingsfan E July 2, 2025, 4:05 a.m. OK C++17 (GCC 7-32) TESTS 11 93 0
327165121 Bluuue E July 3, 2025, 3:32 a.m. OK C++17 (GCC 7-32) TESTS 11 93 102400
327178999 FengHua1024 E July 3, 2025, 6:02 a.m. OK C++20 (GCC 13-64) TESTS 11 77 102400
327147989 evilbaker E July 2, 2025, 9:49 p.m. OK C++20 (GCC 13-64) TESTS 11 77 102400
327142485 TheImpaler E July 2, 2025, 8:16 p.m. OK C++20 (GCC 13-64) TESTS 11 77 102400
327111958 tonytroeff E July 2, 2025, 3:41 p.m. OK C++20 (GCC 13-64) TESTS 11 77 102400
327094748 kumarpushpesh007 E July 2, 2025, 1:35 p.m. OK C++20 (GCC 13-64) TESTS 11 77 102400
327056859 fake_deep_fake E July 2, 2025, 9:22 a.m. OK C++20 (GCC 13-64) TESTS 11 77 102400
327025428 Eslam_Saleh E July 2, 2025, 4:53 a.m. OK C++20 (GCC 13-64) TESTS 11 77 102400
327131168 adham_saeed E July 2, 2025, 6:15 p.m. OK C++20 (GCC 13-64) TESTS 11 77 409600
327109992 _Kontrast_ E July 2, 2025, 3:26 p.m. OK C++20 (GCC 13-64) TESTS 11 78 0
327105394 Mighilon E July 2, 2025, 2:52 p.m. OK C++20 (GCC 13-64) TESTS 11 78 0
327179127 limx E July 3, 2025, 6:04 a.m. OK C++23 (GCC 14-64, msys2) TESTS 11 62 0
327099511 Amane E July 2, 2025, 2:09 p.m. OK C++23 (GCC 14-64, msys2) TESTS 11 77 0
327023005 zhiye E July 2, 2025, 4:25 a.m. OK C++23 (GCC 14-64, msys2) TESTS 11 77 0
327025728 Jahid__Noob E July 2, 2025, 4:56 a.m. OK C++23 (GCC 14-64, msys2) TESTS 11 77 102400
327160539 yajirobe E July 3, 2025, 2:34 a.m. OK C++23 (GCC 14-64, msys2) TESTS 11 77 921600
327167491 Zyc77 E July 3, 2025, 4:03 a.m. OK C++23 (GCC 14-64, msys2) TESTS 11 78 0
327160890 snake_wing E July 3, 2025, 2:40 a.m. OK C++23 (GCC 14-64, msys2) TESTS 11 78 0
327154274 WelCo_ E July 3, 2025, 12:40 a.m. OK C++23 (GCC 14-64, msys2) TESTS 11 78 0
327120287 Dwarkesh E July 2, 2025, 4:43 p.m. OK C++23 (GCC 14-64, msys2) TESTS 11 78 0
327076737 sharodh25 E July 2, 2025, 11:35 a.m. OK C++23 (GCC 14-64, msys2) TESTS 11 78 0
327102062 sad10001 E July 2, 2025, 2:27 p.m. OK GNU C11 TESTS 11 874 2150400
327145236 glebsamsonov E July 2, 2025, 8:57 p.m. OK Go TESTS 11 140 13721600
327070395 Ojasvi_kumar E July 2, 2025, 10:53 a.m. OK Java 21 TESTS 11 312 716800
327151374 cpp10 E July 2, 2025, 11:16 p.m. OK Java 21 TESTS 11 312 921600
327114749 Fortius E July 2, 2025, 4:01 p.m. OK Java 21 TESTS 11 327 1331200
327151428 cpp10 E July 2, 2025, 11:17 p.m. OK Java 21 TESTS 11 343 1740800
327060886 BurnerAce07 E July 2, 2025, 9:47 a.m. OK Java 21 TESTS 11 359 716800
327102071 mohit_19 E July 2, 2025, 2:27 p.m. OK Java 21 TESTS 11 389 19046400
327166231 guharoypragyayan E July 3, 2025, 3:46 a.m. OK Java 21 TESTS 11 437 18022400
327116372 KRRISH9977 E July 2, 2025, 4:13 p.m. OK Java 21 TESTS 11 437 36556800
327096882 dwbh21 E July 2, 2025, 1:50 p.m. OK Java 21 TESTS 11 452 13824000
327098338 dwbh21 E July 2, 2025, 2:01 p.m. OK Java 21 TESTS 11 468 1638400
327163308 arpande97 E July 3, 2025, 3:11 a.m. OK Java 8 TESTS 11 171 0
327155759 baixuejava E July 3, 2025, 1:16 a.m. OK Java 8 TESTS 11 218 0
327155502 baixuejava E July 3, 2025, 1:11 a.m. OK Java 8 TESTS 11 468 0
327099432 Sumitsingh7 E July 2, 2025, 2:09 p.m. OK Java 8 TESTS 11 468 8396800
327094080 satyams_9001 E July 2, 2025, 1:31 p.m. OK Java 8 TESTS 11 468 8396800
327105516 kasiru_69 E July 2, 2025, 2:53 p.m. OK Java 8 TESTS 11 515 14438400
327062530 gaurimadan002 E July 2, 2025, 9:57 a.m. OK Java 8 TESTS 11 608 15052800
327029177 yashbansal99 E July 2, 2025, 5:30 a.m. OK Java 8 TESTS 11 780 12185600
327025172 vinhcongnguyen2009 E July 2, 2025, 4:50 a.m. OK PyPy 3 TESTS 11 624 20992000
327029365 dreamer_empty E July 2, 2025, 5:32 a.m. OK PyPy 3 TESTS 11 624 28467200
327021727 yiwangwuqian E July 2, 2025, 4:08 a.m. OK PyPy 3 TESTS 11 2546 66252800
327173004 gardengnome E July 3, 2025, 5:05 a.m. OK PyPy 3-64 TESTS 11 155 23756800
327082630 kruebbelegassiemz2154 E July 2, 2025, 12:14 p.m. OK PyPy 3-64 TESTS 11 156 30515200
327087993 l0stempl3 E July 2, 2025, 12:49 p.m. OK PyPy 3-64 TESTS 11 187 25497600
327061799 kamio-misuzu E July 2, 2025, 9:53 a.m. OK PyPy 3-64 TESTS 11 187 28979200
327030403 pyorz E July 2, 2025, 5:43 a.m. OK PyPy 3-64 TESTS 11 187 31027200
327128065 IcyGirl E July 2, 2025, 5:48 p.m. OK PyPy 3-64 TESTS 11 202 27955200
327114700 pbd_94 E July 2, 2025, 4:01 p.m. OK PyPy 3-64 TESTS 11 218 24473600
327084801 anres E July 2, 2025, 12:27 p.m. OK PyPy 3-64 TESTS 11 218 29388800
327156360 Patronus2002 E July 3, 2025, 1:28 a.m. OK PyPy 3-64 TESTS 11 218 33689600
327096722 kazukun1311 E July 2, 2025, 1:49 p.m. OK PyPy 3-64 TESTS 11 233 31334400
327140614 amirhassanpour E July 2, 2025, 7:51 p.m. OK Python 3 TESTS 11 187 31539200
327091324 pardhukatakam25 E July 2, 2025, 1:12 p.m. OK Python 3 TESTS 11 218 22323200
327023050 yaoyueming E July 2, 2025, 4:25 a.m. OK Python 3 TESTS 11 234 40243200
327086448 cioppy E July 2, 2025, 12:38 p.m. OK Python 3 TESTS 11 311 64716800
327134659 mushfique21 E July 2, 2025, 6:45 p.m. OK Python 3 TESTS 11 358 30412800
327169115 HitlerWasRight E July 3, 2025, 4:22 a.m. OK Python 3 TESTS 11 359 23961600
327134812 MEZBAH-UDDIN E July 2, 2025, 6:46 p.m. OK Python 3 TESTS 11 374 22323200
327098162 wordlesswanderer E July 2, 2025, 1:59 p.m. OK Python 3 TESTS 11 421 46694400
327059829 svrmalaviya E July 2, 2025, 9:40 a.m. OK Python 3 TESTS 11 436 23961600
327032625 ___a_s_1_2___ E July 2, 2025, 6:10 a.m. OK Python 3 TESTS 11 577 41369600
327159293 0x81 E July 3, 2025, 2:14 a.m. OK Rust 2021 TESTS 11 124 7782400

remove filters

Back to search problems