Codeforces Round 615 (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
1294 Codeforces Round 615 (Div. 3) FINISHED False 7800 152119499 Jan. 22, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 11812 ) D MEX maximizing PROGRAMMING data structures greedy implementation math 1600

B'Recall that MEX of an array is a minimum non-negative integer that does not belong to the array. Examples: You are given an empty array a=[] (in other words, a zero-length array). You are also given a positive integer x . You are also given q queries. The j -th query consists of one integer y_j and means that you have to append one element y_j to the array. The array length increases by 1 after a query. In one move, you can choose any index i and set a_i := a_i + x or a_i := a_i - x (i.e. increase or decrease any element of the array by x ). The only restriction is that a_i cannot become negative. Since initially the array is empty, you can perform moves only after the first query. You have to maximize the MEX (minimum excluded) of the array if you can perform any number of such operations (you can even perform the operation multiple times with one element). You have to find the answer after each of q queries (i.e. the j -th answer corresponds to the array of length j ). Operations are discarded before each query. I.e. the array a after the j -th query equals to [y_1, y_2, ... , y_j] . The first line of the input contains two integers q, x ( 1 <= q, x <= 4 cdot 10^5 ) -- the number of queries and the value of x . The next q lines describe queries. The j -th query consists of one integer y_j ( 0 <= y_j <= 10^9 ) and means that you have to append one element y_j to the array. Print the answer to the initial problem after each query -- for the query j print the maximum value of MEX after first j queries. Note that queries are dependent (the array changes after each query) but operations are independent between queries. In the first example: '...

Tutorials

Codeforces Round #615 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
69810102 lesf0 D Jan. 30, 2020, 3:59 a.m. OK Clang++17 Diagnostics TESTS 55 561 4710400 1600
69810071 lesf0 D Jan. 30, 2020, 3:58 a.m. OK Clang++17 Diagnostics TESTS 55 577 4710400 1600
69943608 vjudge1 D Feb. 1, 2020, 6:55 a.m. OK Clang++17 Diagnostics TESTS 55 1372 27648000 1600
70378007 ftiasch D Feb. 5, 2020, 4:48 p.m. OK D TESTS 55 358 11878400 1600
69688509 ruban D Jan. 28, 2020, 5:49 p.m. OK Delphi TESTS 55 483 24064000 1600
70177561 LaSWeeG D Feb. 3, 2020, 6:58 p.m. OK FPC TESTS 55 1325 2048000 1600
69689274 ruban D Jan. 28, 2020, 6:03 p.m. OK FPC TESTS 55 1388 24064000 1600
69717387 eugalt D Jan. 29, 2020, 9:27 a.m. OK GNU C11 TESTS 55 171 1843200 1600
69741725 Akshatvj D Jan. 29, 2020, 2:47 p.m. OK GNU C11 TESTS 55 1404 1638400 1600
69426324 kaiboy D Jan. 23, 2020, 3:55 p.m. OK GNU C11 TESTS 55 1404 7987200 1600
69740293 Akshatvj D Jan. 29, 2020, 2:44 p.m. OK GNU C11 TESTS 55 1419 1638400 1600
69699811 alpeevandrey D Jan. 28, 2020, 11:10 p.m. OK GNU C11 TESTS 55 1466 8396800 1600
69611711 275307894a D Jan. 27, 2020, 11:44 a.m. OK GNU C++11 TESTS 55 62 1433600 1600
69423086 lx_zjk D Jan. 23, 2020, 2:59 p.m. OK GNU C++11 TESTS 55 62 3174400 1600
69809663 xtr169 D Jan. 30, 2020, 3:46 a.m. OK GNU C++11 TESTS 55 78 1638400 1600
69593413 zlczlc D Jan. 27, 2020, 2:38 a.m. OK GNU C++11 TESTS 55 78 1638400 1600
69703955 TheShadow_DC D Jan. 29, 2020, 3:12 a.m. OK GNU C++11 TESTS 55 78 2048000 1600
69727927 stevenzhang D Jan. 29, 2020, 12:47 p.m. OK GNU C++11 TESTS 55 93 1638400 1600
69593797 AkiPolaris D Jan. 27, 2020, 3 a.m. OK GNU C++11 TESTS 55 93 3072000 1600
69600954 BrownBear D Jan. 27, 2020, 7:33 a.m. OK GNU C++11 TESTS 55 109 1638400 1600
69889583 zyn_615 D Jan. 31, 2020, 9:31 a.m. OK GNU C++11 TESTS 55 109 4300800 1600
69548346 DJQ D Jan. 26, 2020, 4:55 a.m. OK GNU C++11 TESTS 55 109 40038400 1600
69880051 vjudge4 D Jan. 31, 2020, 6 a.m. OK GNU C++14 TESTS 55 171 1536000 1600
70024239 Kamsamewar D Feb. 2, 2020, 10:51 a.m. OK GNU C++14 TESTS 55 171 1536000 1600
69551130 Willem D Jan. 26, 2020, 6:30 a.m. OK GNU C++14 TESTS 55 171 3993600 1600
69459686 vjudge4 D Jan. 24, 2020, 10:10 a.m. OK GNU C++14 TESTS 55 171 6451200 1600
69424430 Sagar_Nakum D Jan. 23, 2020, 3:21 p.m. OK GNU C++14 TESTS 55 186 1638400 1600
69663529 steven.novaryo D Jan. 28, 2020, 10:25 a.m. OK GNU C++14 TESTS 55 186 1638400 1600
69531830 jam1729 D Jan. 25, 2020, 5:23 p.m. OK GNU C++14 TESTS 55 186 1638400 1600
69475881 aapc_image D Jan. 24, 2020, 4:09 p.m. OK GNU C++14 TESTS 55 186 1638400 1600
71045795 vjudge1 D Feb. 14, 2020, 8:23 a.m. OK GNU C++14 TESTS 55 186 4812800 1600
70493764 lztnb D Feb. 7, 2020, 9:53 a.m. OK GNU C++14 TESTS 55 187 1638400 1600
69582861 .tx D Jan. 26, 2020, 6:05 p.m. OK GNU C++17 TESTS 55 62 1638400 1600
69810967 lesf0 D Jan. 30, 2020, 4:21 a.m. OK GNU C++17 TESTS 55 155 5836800 1600
70034536 ceerRep D Feb. 2, 2020, 1:50 p.m. OK GNU C++17 TESTS 55 171 1638400 1600
70725714 vjudge5 D Feb. 10, 2020, 11:48 a.m. OK GNU C++17 TESTS 55 171 7987200 1600
69536180 Son D Jan. 25, 2020, 6:58 p.m. OK GNU C++17 TESTS 55 186 1536000 1600
69454597 JeremyMo D Jan. 24, 2020, 7:59 a.m. OK GNU C++17 TESTS 55 186 1536000 1600
70002723 Amither D Feb. 2, 2020, 2:53 a.m. OK GNU C++17 TESTS 55 186 1638400 1600
70432763 yutabi D Feb. 6, 2020, 12:02 p.m. OK GNU C++17 TESTS 55 186 1638400 1600
69419132 deadnigga28 D Jan. 23, 2020, 1:55 p.m. OK GNU C++17 TESTS 55 187 1536000 1600
70766696 ciaocbr D Feb. 11, 2020, 5:10 a.m. OK GNU C++17 TESTS 55 187 1638400 1600
70026743 vjudge5 D Feb. 2, 2020, 11:38 a.m. OK Go TESTS 55 421 5324800 1600
69442015 sighduck D Jan. 23, 2020, 10:29 p.m. OK Go TESTS 55 436 12288000 1600
70328038 misclicked D Feb. 5, 2020, 4:30 a.m. OK Go TESTS 55 514 21401600 1600
69416710 jenish9599 D Jan. 23, 2020, 1:18 p.m. OK Java 11 TESTS 55 249 0 1600
71086531 elkadymohammed01 D Feb. 14, 2020, 9:37 p.m. OK Java 11 TESTS 55 311 5324800 1600
70543570 Azakarka D Feb. 8, 2020, 6:45 a.m. OK Java 11 TESTS 55 327 0 1600
69540913 sajith D Jan. 25, 2020, 9:25 p.m. OK Java 11 TESTS 55 343 0 1600
69431955 pankajpoply45 D Jan. 23, 2020, 5:37 p.m. OK Java 11 TESTS 55 514 25088000 1600
69694961 alankritanand001 D Jan. 28, 2020, 8:02 p.m. OK Java 11 TESTS 55 764 6348800 1600
69655362 stdnoob D Jan. 28, 2020, 7:11 a.m. OK Java 11 TESTS 55 764 6553600 1600
69533673 gargvibhor2012 D Jan. 25, 2020, 6 p.m. OK Java 11 TESTS 55 842 40243200 1600
69529718 Anonymous D Jan. 25, 2020, 4:36 p.m. OK Java 11 TESTS 55 1184 130457600 1600
69509005 potatmen D Jan. 25, 2020, 9:48 a.m. OK Java 11 TESTS 55 1559 42598400 1600
69424278 Sagar_Nakum D Jan. 23, 2020, 3:19 p.m. OK Java 8 TESTS 55 171 13926400 1600
69435536 chojh1222 D Jan. 23, 2020, 6:49 p.m. OK Java 8 TESTS 55 186 0 1600
70180742 Sharon D Feb. 3, 2020, 8:04 p.m. OK Java 8 TESTS 55 202 0 1600
69479766 MafKrjoBhai D Jan. 24, 2020, 5:21 p.m. OK Java 8 TESTS 55 202 0 1600
69516930 shashwat07 D Jan. 25, 2020, 12:18 p.m. OK Java 8 TESTS 55 217 0 1600
69480055 binrodon D Jan. 24, 2020, 5:26 p.m. OK Java 8 TESTS 55 217 0 1600
70337589 kpark D Feb. 5, 2020, 7:37 a.m. OK Java 8 TESTS 55 217 13619200 1600
69809723 MDSP D Jan. 30, 2020, 3:48 a.m. OK Java 8 TESTS 55 218 15564800 1600
69809919 MDSP D Jan. 30, 2020, 3:53 a.m. OK Java 8 TESTS 55 218 15564800 1600
70117131 Nirav412000 D Feb. 3, 2020, 7:34 a.m. OK Java 8 TESTS 55 233 0 1600
69641479 H0ssein D Jan. 27, 2020, 9:07 p.m. OK Kotlin TESTS 55 264 0 1600
69641514 H0ssein D Jan. 27, 2020, 9:08 p.m. OK Kotlin TESTS 55 265 0 1600
69641408 H0ssein D Jan. 27, 2020, 9:05 p.m. OK Kotlin TESTS 55 265 0 1600
69641206 H0ssein D Jan. 27, 2020, 8:57 p.m. OK Kotlin TESTS 55 295 0 1600
69641361 H0ssein D Jan. 27, 2020, 9:03 p.m. OK Kotlin TESTS 55 327 0 1600
69641111 H0ssein D Jan. 27, 2020, 8:54 p.m. OK Kotlin TESTS 55 560 204800 1600
69533880 yevhenii_kanivets D Jan. 25, 2020, 6:05 p.m. OK Kotlin TESTS 55 1372 36044800 1600
69555331 yevhenii_kanivets D Jan. 26, 2020, 8:34 a.m. OK Kotlin TESTS 55 2028 46489600 1600
69640305 H0ssein D Jan. 27, 2020, 8:27 p.m. OK Kotlin TESTS 55 2932 0 1600
70568002 voledyhil D Feb. 8, 2020, 1:41 p.m. OK Mono C# TESTS 55 296 22528000 1600
70157216 sakapon D Feb. 3, 2020, 2:20 p.m. OK Mono C# TESTS 55 311 30720000 1600
70359940 waatson D Feb. 5, 2020, 1:05 p.m. OK Mono C# TESTS 55 1419 43929600 1600
69458802 artworks D Jan. 24, 2020, 9:47 a.m. OK Mono C# TESTS 55 1809 39731200 1600
69470529 PortalGreed D Jan. 24, 2020, 2:24 p.m. OK Mono C# TESTS 55 2698 8294400 1600
69664791 artem.votincev D Jan. 28, 2020, 10:55 a.m. OK Mono C# TESTS 55 2730 8294400 1600
69676683 vjudge5 D Jan. 28, 2020, 2:28 p.m. OK MS C++ TESTS 55 171 1638400 1600
70921933 vjudge5 D Feb. 12, 2020, 11:06 p.m. OK MS C++ TESTS 55 171 2048000 1600
70332460 vjudge5 D Feb. 5, 2020, 6:20 a.m. OK MS C++ TESTS 55 171 9318400 1600
69654370 vjudge2 D Jan. 28, 2020, 6:47 a.m. OK MS C++ TESTS 55 186 1638400 1600
70155278 vjudge1 D Feb. 3, 2020, 1:54 p.m. OK MS C++ TESTS 55 186 16076800 1600
70342877 vjudge3 D Feb. 5, 2020, 8:51 a.m. OK MS C++ TESTS 55 187 3993600 1600
69680601 vjudge2 D Jan. 28, 2020, 3:31 p.m. OK MS C++ TESTS 55 421 3174400 1600
70113094 Alkaid_potatoo D Feb. 3, 2020, 6:16 a.m. OK MS C++ TESTS 55 638 14540800 1600
69428072 LinusTorvaldsFan D Jan. 23, 2020, 4:25 p.m. OK MS C++ TESTS 55 779 56217600 1600
69427969 LinusTorvaldsFan D Jan. 23, 2020, 4:24 p.m. OK MS C++ TESTS 55 1123 56217600 1600
69536715 Dead_InsideZXC D Jan. 25, 2020, 7:11 p.m. OK MS C++ 2017 TESTS 55 233 1638400 1600
69501130 vjudge5 D Jan. 25, 2020, 6:36 a.m. OK MS C++ 2017 TESTS 55 233 2048000 1600
70162236 vjudge5 D Feb. 3, 2020, 3:33 p.m. OK MS C++ 2017 TESTS 55 233 3174400 1600
69463268 jjangu D Jan. 24, 2020, 11:45 a.m. OK MS C++ 2017 TESTS 55 234 1638400 1600
70499210 vjudge2 D Feb. 7, 2020, 11:36 a.m. OK MS C++ 2017 TESTS 55 234 1638400 1600
69941534 lostemiy D Feb. 1, 2020, 6:19 a.m. OK MS C++ 2017 TESTS 55 249 1638400 1600
69423313 paradoxhzy D Jan. 23, 2020, 3:03 p.m. OK MS C++ 2017 TESTS 55 249 3481600 1600
69941551 vjudge4 D Feb. 1, 2020, 6:19 a.m. OK MS C++ 2017 TESTS 55 264 1638400 1600
69415090 hack2kong D Jan. 23, 2020, 12:52 p.m. OK MS C++ 2017 TESTS 55 265 8396800 1600
70625844 EatingMelonPublic D Feb. 9, 2020, 1:11 p.m. OK MS C++ 2017 TESTS 55 358 25702400 1600
69933308 cf_nickname D Feb. 1, 2020, 1:55 a.m. OK Ocaml TESTS 55 1372 3072000 1600
69625180 iamprayush D Jan. 27, 2020, 3:35 p.m. OK PyPy 2 TESTS 55 389 27340800 1600
69508772 MVP D Jan. 25, 2020, 9:43 a.m. OK PyPy 2 TESTS 55 483 27136000 1600
71062210 raj1307 D Feb. 14, 2020, 1:40 p.m. OK PyPy 2 TESTS 55 514 61542400 1600
69835542 manish.17 D Jan. 30, 2020, 11:42 a.m. OK PyPy 3 TESTS 55 358 22835200 1600
69438339 deepak_prakash D Jan. 23, 2020, 8:02 p.m. OK PyPy 3 TESTS 55 483 49356800 1600
69543681 InfiniteDescent D Jan. 25, 2020, 11:52 p.m. OK PyPy 3 TESTS 55 810 10547200 1600
69538337 PracticeAccountICL D Jan. 25, 2020, 7:56 p.m. OK PyPy 3 TESTS 55 810 10547200 1600
69538096 PracticeAccountICL D Jan. 25, 2020, 7:49 p.m. OK PyPy 3 TESTS 55 810 10547200 1600
69595923 ss7890 D Jan. 27, 2020, 4:43 a.m. OK PyPy 3 TESTS 55 810 10649600 1600
69537756 PracticeAccountICL D Jan. 25, 2020, 7:39 p.m. OK PyPy 3 TESTS 55 810 11059200 1600
69493651 marcktony D Jan. 25, 2020, 1:24 a.m. OK PyPy 3 TESTS 55 811 10649600 1600
70212690 pye D Feb. 4, 2020, 8:46 a.m. OK PyPy 3 TESTS 55 826 10547200 1600
69538143 PracticeAccountICL D Jan. 25, 2020, 7:50 p.m. OK PyPy 3 TESTS 55 826 10649600 1600
70530379 nihaawop D Feb. 7, 2020, 10:05 p.m. OK Python 3 TESTS 55 857 11571200 1600
69723398 Avny D Jan. 29, 2020, 11:27 a.m. OK Python 3 TESTS 55 873 11468800 1600
70530458 nihaawop D Feb. 7, 2020, 10:07 p.m. OK Python 3 TESTS 55 873 27955200 1600
69723128 Avny D Jan. 29, 2020, 11:22 a.m. OK Python 3 TESTS 55 888 11776000 1600
69502660 aakarsh D Jan. 25, 2020, 7:13 a.m. OK Python 3 TESTS 55 1091 31744000 1600
69723491 Avny D Jan. 29, 2020, 11:29 a.m. OK Python 3 TESTS 55 1107 11468800 1600
69499669 rajatgedam D Jan. 25, 2020, 6:02 a.m. OK Python 3 TESTS 55 1107 30617600 1600
69490491 divyansh_io D Jan. 24, 2020, 10:14 p.m. OK Python 3 TESTS 55 1107 31641600 1600
69467031 bansalgurparshad D Jan. 24, 2020, 1:16 p.m. OK Python 3 TESTS 55 1107 31744000 1600
69490554 divyansh_io D Jan. 24, 2020, 10:17 p.m. OK Python 3 TESTS 55 1122 31129600 1600
69684315 MVesterli D Jan. 28, 2020, 4:33 p.m. OK Rust TESTS 55 171 14745600 1600
69880489 reldan D Jan. 31, 2020, 6:09 a.m. OK Scala TESTS 55 1621 82329600 1600

remove filters

Back to search problems