Mail.Ru Cup 2018 Round 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
1054 Mail.Ru Cup 2018 Round 1 FINISHED False 9000 191942699 Oct. 18, 2018, 4:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 6608 ) B Appending Mex PROGRAMMING implementation 1100

B'Initially Ildar has an empty array. He performs n steps. On each step he takes a subset of integers already added to the array and appends the mex of this subset to the array. The mex of an multiset of integers is the smallest non-negative integer not presented in the multiset. For example, the mex of the multiset [0, 2, 3] is 1 , while the mex of the multiset [1, 2, 1] is 0 . More formally, on the step m , when Ildar already has an array a_1, a_2, ldots, a_{m-1} , he chooses some subset of indices 1 <= q i_1 < i_2 < ldots < i_k < m (possibly, empty), where 0 <= q k < m , and appends the mex(a_{i_1}, a_{i_2}, ldots a_{i_k}) to the end of the array. After performing all the steps Ildar thinks that he might have made a mistake somewhere. He asks you to determine for a given array a_1, a_2, ldots, a_n the minimum step t such that he has definitely made a mistake on at least one of the steps 1, 2, ldots, t , or determine that he could have obtained this array without mistakes. The first line contains a single integer n ( 1 <= q n <= q 100 ,000 ) -- the number of steps Ildar made. The second line contains n integers a_1, a_2, ldots, a_n ( 0 <= q a_i <= q 10^9 ) -- the array Ildar obtained. If Ildar could have chosen the subsets on each step in such a way that the resulting array is a_1, a_2, ldots, a_n , print -1 . Otherwise print a single integer t -- the smallest index of a step such that a mistake was made on at least one step among steps 1, 2, ldots, t . In the first example it is possible that Ildar made no mistakes. Here is the process he could have followed. Thus, he can get the array without mistakes, so the answer is -1 . In the second example he has definitely made a mistake on the very first step, because he could not have obtained anything different from 0 . In the third example he could have obtained [0,'...

Tutorials

Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
44516891 Gassa B Oct. 18, 2018, 6:33 p.m. OK D TESTS 114 46 4198400 1100
44498861 fluffyowl B Oct. 18, 2018, 4:45 p.m. OK D TESTS 114 46 11571200 1100
44519398 Denor B Oct. 18, 2018, 7:02 p.m. OK Delphi TESTS 114 46 307200 1100
44500775 ruban B Oct. 18, 2018, 4:49 p.m. OK Delphi TESTS 114 61 36761600 1100
44507523 tumbleweed B Oct. 18, 2018, 5:16 p.m. OK FPC TESTS 114 46 0 1100
44508846 lusie B Oct. 18, 2018, 5:23 p.m. OK FPC TESTS 114 46 0 1100
44513524 adozer B Oct. 18, 2018, 6 p.m. OK FPC TESTS 114 46 409600 1100
44503850 PAG B Oct. 18, 2018, 4:59 p.m. OK FPC TESTS 114 61 0 1100
44512029 BaluconisTima B Oct. 18, 2018, 5:46 p.m. OK FPC TESTS 114 62 409600 1100
44501772 TShT B Oct. 18, 2018, 4:52 p.m. OK FPC TESTS 114 62 3993600 1100
44523718 Spo0kyCo0kie B Oct. 18, 2018, 11:21 p.m. OK GNU C11 TESTS 114 31 0 1100
65474196 DevJewel B Nov. 21, 2019, 9:25 a.m. OK GNU C11 TESTS 114 46 0 1100
51944305 OKM B March 28, 2019, 4:01 p.m. OK GNU C11 TESTS 114 46 0 1100
48089839 NoSoul B Jan. 8, 2019, 1:12 p.m. OK GNU C11 TESTS 114 46 0 1100
46000119 mayurmaga B Nov. 20, 2018, 2:05 p.m. OK GNU C11 TESTS 114 46 0 1100
45670225 RishabhD B Nov. 13, 2018, 10:09 a.m. OK GNU C11 TESTS 114 46 0 1100
45116755 RaghavS B Oct. 30, 2018, 10:14 p.m. OK GNU C11 TESTS 114 46 0 1100
45114582 Harrry B Oct. 30, 2018, 8:30 p.m. OK GNU C11 TESTS 114 46 0 1100
44609318 ankitdipto B Oct. 20, 2018, 6:45 p.m. OK GNU C11 TESTS 114 46 0 1100
44550683 SaidBenha B Oct. 19, 2018, 3:12 p.m. OK GNU C11 TESTS 114 46 0 1100
58960705 Backseat-Stargazer B Aug. 17, 2019, 3:06 p.m. OK GNU C++11 TESTS 114 31 0 1100
54507183 WOSHIGEPACHONG2 B May 23, 2019, 4:52 a.m. OK GNU C++11 TESTS 114 31 0 1100
54432243 FAQmother B May 21, 2019, 1:13 a.m. OK GNU C++11 TESTS 114 31 0 1100
52344673 ouuan B April 5, 2019, 12:11 p.m. OK GNU C++11 TESTS 114 31 0 1100
50082742 vjudge5 B Feb. 18, 2019, 5:33 a.m. OK GNU C++11 TESTS 114 31 0 1100
46045081 COLINGAO B Nov. 22, 2018, 12:36 a.m. OK GNU C++11 TESTS 114 31 0 1100
45235074 luogu_bot3 B Nov. 3, 2018, 8:52 a.m. OK GNU C++11 TESTS 114 31 0 1100
44502158 Yehezkiel B Oct. 18, 2018, 4:53 p.m. OK GNU C++11 TESTS 114 31 0 1100
44500599 Hello_zhr B Oct. 18, 2018, 4:49 p.m. OK GNU C++11 TESTS 114 31 0 1100
64784116 Karry5307 B Nov. 13, 2019, 8:28 a.m. OK GNU C++11 TESTS 114 31 0 1100
44497512 hank55663 B Oct. 18, 2018, 4:42 p.m. OK GNU C++14 TESTS 114 31 0 1100
57962014 ishita_1 B July 29, 2019, 11:55 p.m. OK GNU C++14 TESTS 114 46 0 1100
58956263 Anon_mouS B Aug. 17, 2019, 1:09 p.m. OK GNU C++14 TESTS 114 46 0 1100
59661382 AnnaSUNna B Aug. 29, 2019, 12:38 p.m. OK GNU C++14 TESTS 114 46 0 1100
59794014 sumitsaraff5482 B Aug. 31, 2019, 8:03 a.m. OK GNU C++14 TESTS 114 46 0 1100
60308982 saipreetham31 B Sept. 9, 2019, 3:01 p.m. OK GNU C++14 TESTS 114 46 0 1100
62316510 vjudge3 B Oct. 10, 2019, 3:26 p.m. OK GNU C++14 TESTS 114 46 0 1100
64275233 Mohamed_Saad62 B Nov. 4, 2019, 8:58 p.m. OK GNU C++14 TESTS 114 46 0 1100
68049237 neckhill007 B Jan. 1, 2020, 5:58 p.m. OK GNU C++14 TESTS 114 46 0 1100
57916078 Elkattanman B July 29, 2019, 1:25 a.m. OK GNU C++14 TESTS 114 46 0 1100
59818502 Pozdnyakov B Aug. 31, 2019, 4:21 p.m. OK GNU C++17 TESTS 114 46 0 1100
69934922 avibhar B Feb. 1, 2020, 3:07 a.m. OK GNU C++17 TESTS 114 46 0 1100
68486596 dk1108 B Jan. 10, 2020, 9:59 a.m. OK GNU C++17 TESTS 114 46 0 1100
67521588 bahaa B Dec. 24, 2019, 12:36 p.m. OK GNU C++17 TESTS 114 46 0 1100
67204779 __vladimir__ B Dec. 19, 2019, 12:05 p.m. OK GNU C++17 TESTS 114 46 0 1100
65492793 flashmt B Nov. 21, 2019, 3:23 p.m. OK GNU C++17 TESTS 114 46 0 1100
64634900 The_crusher B Nov. 10, 2019, 11:19 a.m. OK GNU C++17 TESTS 114 46 0 1100
60071022 Sali_adelkhah B Sept. 5, 2019, 11:07 a.m. OK GNU C++17 TESTS 114 46 0 1100
59957696 Juve45 B Sept. 3, 2019, 4:47 p.m. OK GNU C++17 TESTS 114 46 0 1100
59953973 Princ_iple B Sept. 3, 2019, 3:27 p.m. OK GNU C++17 TESTS 114 46 0 1100
44556116 upvas B Oct. 19, 2018, 5:20 p.m. OK Go TESTS 114 77 116838400 1100
44717122 fc-lib-xyz B Oct. 22, 2018, 10:59 p.m. OK Go TESTS 114 124 0 1100
44827932 Jay_13 B Oct. 25, 2018, 7:08 a.m. OK Java 8 TESTS 114 124 0 1100
44648740 noob__coder B Oct. 21, 2018, 10:21 a.m. OK Java 8 TESTS 114 124 0 1100
44541641 darshankdarji B Oct. 19, 2018, 11:46 a.m. OK Java 8 TESTS 114 124 0 1100
44528639 coderbond007 B Oct. 19, 2018, 5:02 a.m. OK Java 8 TESTS 114 124 0 1100
44506652 chandan5284 B Oct. 18, 2018, 5:11 p.m. OK Java 8 TESTS 114 124 0 1100
44506557 amir7777 B Oct. 18, 2018, 5:11 p.m. OK Java 8 TESTS 114 124 0 1100
44503795 romit17 B Oct. 18, 2018, 4:58 p.m. OK Java 8 TESTS 114 124 0 1100
44501899 vidyut_1 B Oct. 18, 2018, 4:52 p.m. OK Java 8 TESTS 114 124 0 1100
44501315 tusharjape007 B Oct. 18, 2018, 4:51 p.m. OK Java 8 TESTS 114 124 0 1100
44501157 new_start1 B Oct. 18, 2018, 4:50 p.m. OK Java 8 TESTS 114 124 0 1100
44506103 zombitrafik B Oct. 18, 2018, 5:09 p.m. OK JavaScript TESTS 114 77 13926400 1100
44499386 ivan.popelyshev B Oct. 18, 2018, 4:46 p.m. OK Kotlin TESTS 114 140 0 1100
44510928 zloi.timur B Oct. 18, 2018, 5:38 p.m. OK Kotlin TESTS 114 202 8396800 1100
44503470 Bobko B Oct. 18, 2018, 4:57 p.m. OK Kotlin TESTS 114 233 5939200 1100
44500053 alexey.enkov B Oct. 18, 2018, 4:47 p.m. OK Kotlin TESTS 114 265 6246400 1100
44509482 kav128 B Oct. 18, 2018, 5:28 p.m. OK Kotlin TESTS 114 280 6246400 1100
55922141 og.kostya B June 22, 2019, 7:52 a.m. OK Mono C# TESTS 114 62 409600 1100
44501105 AnatolyTolstobrov B Oct. 18, 2018, 4:50 p.m. OK Mono C# TESTS 114 62 512000 1100
44506325 Nathan.Sproul B Oct. 18, 2018, 5:10 p.m. OK Mono C# TESTS 114 62 716800 1100
46015203 Gray_Rhino B Nov. 21, 2018, 2:19 a.m. OK Mono C# TESTS 114 77 11059200 1100
44505664 mihleonid B Oct. 18, 2018, 5:07 p.m. OK Mono C# TESTS 114 77 11059200 1100
44506675 allchk B Oct. 18, 2018, 5:12 p.m. OK Mono C# TESTS 114 77 11059200 1100
44545526 danilprokat B Oct. 19, 2018, 1:18 p.m. OK Mono C# TESTS 114 77 11059200 1100
44502339 claw88 B Oct. 18, 2018, 4:54 p.m. OK Mono C# TESTS 114 77 11161600 1100
44510576 ilya101master B Oct. 18, 2018, 5:35 p.m. OK Mono C# TESTS 114 77 11264000 1100
44511120 Azazelo B Oct. 18, 2018, 5:39 p.m. OK Mono C# TESTS 114 77 11468800 1100
44499233 CtrlAlt B Oct. 18, 2018, 4:46 p.m. OK MS C++ TESTS 114 46 0 1100
44510252 WoodMachine B Oct. 18, 2018, 5:33 p.m. OK MS C++ TESTS 114 46 0 1100
44505935 abtest100 B Oct. 18, 2018, 5:08 p.m. OK MS C++ TESTS 114 46 0 1100
44505145 youx B Oct. 18, 2018, 5:04 p.m. OK MS C++ TESTS 114 46 0 1100
44499886 romarioGI B Oct. 18, 2018, 4:47 p.m. OK MS C++ TESTS 114 46 0 1100
44497409 LoneFox B Oct. 18, 2018, 4:42 p.m. OK MS C++ TESTS 114 46 0 1100
44497305 wa1tz719 B Oct. 18, 2018, 4:42 p.m. OK MS C++ TESTS 114 46 0 1100
45428052 Houbunsha B Nov. 7, 2018, 11:42 p.m. OK MS C++ TESTS 114 46 409600 1100
44593985 DarkDove B Oct. 20, 2018, 11:57 a.m. OK MS C++ TESTS 114 46 409600 1100
44518283 Sergiu_Ionescu B Oct. 18, 2018, 6:50 p.m. OK MS C++ TESTS 114 46 409600 1100
55237712 Mad112233 B June 7, 2019, 9:15 a.m. OK MS C++ 2017 TESTS 114 124 0 1100
44595251 chris_bonbon42 B Oct. 20, 2018, 12:20 p.m. OK Node.js TESTS 114 218 12083200 1100
44502975 Fardale B Oct. 18, 2018, 4:56 p.m. OK Ocaml TESTS 114 31 4403200 1100
44504415 WhiteSpot B Oct. 18, 2018, 5:01 p.m. OK PascalABC.NET TESTS 114 78 0 1100
44503756 1ldaun B Oct. 18, 2018, 4:58 p.m. OK PascalABC.NET TESTS 114 93 0 1100
44504581 koptev B Oct. 18, 2018, 5:02 p.m. OK PascalABC.NET TESTS 114 93 0 1100
44503775 Arcadii B Oct. 18, 2018, 4:58 p.m. OK PascalABC.NET TESTS 114 93 0 1100
45326017 OpKos B Nov. 5, 2018, 12:59 p.m. OK PascalABC.NET TESTS 114 93 2764800 1100
44509286 Lucky_cat777 B Oct. 18, 2018, 5:26 p.m. OK PascalABC.NET TESTS 114 93 3686400 1100
56039166 Gimber B June 25, 2019, 1:30 p.m. OK PascalABC.NET TESTS 114 248 0 1100
44503062 rsFalse B Oct. 18, 2018, 4:56 p.m. OK Perl TESTS 114 93 14233600 1100
45510511 adromaryn B Nov. 10, 2018, 12:46 p.m. OK Perl TESTS 114 109 16998400 1100
44505951 mayakin B Oct. 18, 2018, 5:08 p.m. OK PHP TESTS 114 62 8396800 1100
44503558 kal013 B Oct. 18, 2018, 4:58 p.m. OK PyPy 2 TESTS 114 140 8089600 1100
44501102 rkstalker B Oct. 18, 2018, 4:50 p.m. OK PyPy 2 TESTS 114 155 6963200 1100
44509492 Onesh0t B Oct. 18, 2018, 5:28 p.m. OK PyPy 2 TESTS 114 155 8089600 1100
44500770 PBatch B Oct. 18, 2018, 4:49 p.m. OK PyPy 2 TESTS 114 155 8089600 1100
44506507 noob77777 B Oct. 18, 2018, 5:11 p.m. OK PyPy 2 TESTS 114 155 8192000 1100
44992500 c1729 B Oct. 28, 2018, 1:39 p.m. OK PyPy 2 TESTS 114 155 8908800 1100
44500737 exoji2e B Oct. 18, 2018, 4:49 p.m. OK PyPy 2 TESTS 114 155 9420800 1100
44502804 c1729 B Oct. 18, 2018, 4:55 p.m. OK PyPy 2 TESTS 114 156 10240000 1100
44501496 zacker-22 B Oct. 18, 2018, 4:51 p.m. OK PyPy 2 TESTS 114 171 9728000 1100
44498002 alexwice B Oct. 18, 2018, 4:43 p.m. OK PyPy 2 TESTS 114 171 9728000 1100
44501400 max_hha B Oct. 18, 2018, 4:51 p.m. OK PyPy 3 TESTS 114 187 15155200 1100
44659749 sasasagagaga B Oct. 21, 2018, 2:37 p.m. OK PyPy 3 TESTS 114 187 15974400 1100
44510640 Mr.Inconsistent B Oct. 18, 2018, 5:36 p.m. OK PyPy 3 TESTS 114 202 13516800 1100
45504257 cpicard443 B Nov. 10, 2018, 9:29 a.m. OK PyPy 3 TESTS 114 202 13516800 1100
44534832 FahimSifnatul B Oct. 19, 2018, 8:25 a.m. OK PyPy 3 TESTS 114 202 13516800 1100
44522612 LordVader B Oct. 18, 2018, 10:14 p.m. OK PyPy 3 TESTS 114 202 13619200 1100
44502987 semicfly B Oct. 18, 2018, 4:56 p.m. OK PyPy 3 TESTS 114 202 15155200 1100
44528576 D_J_Z B Oct. 19, 2018, 4:59 a.m. OK PyPy 3 TESTS 114 202 15564800 1100
44500115 KeyurJain B Oct. 18, 2018, 4:48 p.m. OK PyPy 3 TESTS 114 202 15564800 1100
45476089 teitoku B Nov. 9, 2018, 12:32 p.m. OK PyPy 3 TESTS 114 202 15974400 1100
44731723 charan9948 B Oct. 23, 2018, 10:55 a.m. OK Python 2 TESTS 114 233 5836800 1100
44504747 wunder9l B Oct. 18, 2018, 5:02 p.m. OK Python 2 TESTS 114 233 5836800 1100
44506828 ygubernatorov B Oct. 18, 2018, 5:12 p.m. OK Python 2 TESTS 114 233 6758400 1100
45257572 nealzane B Nov. 3, 2018, 9:05 p.m. OK Python 2 TESTS 114 234 5632000 1100
44527298 sp1cyChezz B Oct. 19, 2018, 3:57 a.m. OK Python 2 TESTS 114 234 5632000 1100
44505734 elistark B Oct. 18, 2018, 5:07 p.m. OK Python 2 TESTS 114 248 5632000 1100
44499263 psaini B Oct. 18, 2018, 4:46 p.m. OK Python 2 TESTS 114 248 5632000 1100
44510781 rishuverma B Oct. 18, 2018, 5:37 p.m. OK Python 2 TESTS 114 249 5529600 1100
54348236 soumyasarkar1998 B May 18, 2019, 1:30 p.m. OK Python 2 TESTS 114 249 5632000 1100
45462264 Babyjjy B Nov. 9, 2018, 1:57 a.m. OK Python 2 TESTS 114 249 5632000 1100
45129759 bergus B Oct. 31, 2018, 9:44 a.m. OK Python 3 TESTS 114 155 8806400 1100
44508281 raj_13ee B Oct. 18, 2018, 5:20 p.m. OK Python 3 TESTS 114 155 8806400 1100
44746434 chinababka B Oct. 23, 2018, 5:08 p.m. OK Python 3 TESTS 114 156 7168000 1100
44526841 rajat_2548 B Oct. 19, 2018, 3:28 a.m. OK Python 3 TESTS 114 156 8806400 1100
44503722 lupe B Oct. 18, 2018, 4:58 p.m. OK Python 3 TESTS 114 156 8806400 1100
49069721 amarjeet_singh B Jan. 27, 2019, 7:51 p.m. OK Python 3 TESTS 114 156 9216000 1100
44523169 eugalt B Oct. 18, 2018, 10:42 p.m. OK Python 3 TESTS 114 171 7168000 1100
44509907 eugalt B Oct. 18, 2018, 5:31 p.m. OK Python 3 TESTS 114 171 7168000 1100
69610373 cs1g B Jan. 27, 2020, 11:17 a.m. OK Python 3 TESTS 114 171 7782400 1100
48489229 toysheeyeyraku B Jan. 17, 2019, 9:55 a.m. OK Python 3 TESTS 114 171 8806400 1100
44500416 geckods B Oct. 18, 2018, 4:48 p.m. OK Ruby TESTS 114 156 18227200 1100
44599031 clupasq B Oct. 20, 2018, 1:30 p.m. OK Ruby TESTS 114 171 17100800 1100
44509389 khodzha B Oct. 18, 2018, 5:27 p.m. OK Ruby TESTS 114 171 18124800 1100
44502292 wrick B Oct. 18, 2018, 4:54 p.m. OK Scala TESTS 114 514 0 1100

remove filters

Back to search problems