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 197645123 Oct. 18, 2018, 4:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4323 ) C Candies Distribution PROGRAMMING constructive algorithms implementation 1400

B'There are n children numbered from 1 to n in a kindergarten. Kindergarten teacher gave a_i ( 1 <= q a_i <= q n ) candies to the i -th child. Children were seated in a row in order from 1 to n from left to right and started eating candies. While the i -th child was eating candies, he calculated two numbers l_i and r_i -- the number of children seating to the left of him that got more candies than he and the number of children seating to the right of him that got more candies than he, respectively. Formally, l_i is the number of indices j ( 1 <= q j < i ), such that a_i < a_j and r_i is the number of indices j ( i < j <= q n ), such that a_i < a_j . Each child told to the kindergarten teacher the numbers l_i and r_i that he calculated. Unfortunately, she forgot how many candies she has given to each child. So, she asks you for help: given the arrays l and r determine whether she could have given the candies to the children such that all children correctly calculated their values l_i and r_i , or some of them have definitely made a mistake. If it was possible, find any way how she could have done it. On the first line there is a single integer n ( 1 <= q n <= q 1000 ) -- the number of children in the kindergarten. On the next line there are n integers l_1, l_2, ldots, l_n ( 0 <= q l_i <= q n ), separated by spaces. On the next line, there are n integer numbers r_1, r_2, ldots, r_n ( 0 <= q r_i <= q n ), separated by spaces. If there is no way to distribute the candies to the children so that all of them calculated their numbers correctly, print xc2 xabNO xc2 xbb (without quotes). Otherwise, print xc2 xabYES xc2 xbb (without quotes) on the first line. On the next line, print n integers a_1, a_2, ldots, a_n , separated by spaces -- the numbers of candies the children 1, 2, ldots,'...

Tutorials

Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
44503732 Gassa C Oct. 18, 2018, 4:58 p.m. OK D TESTS 128 46 4198400 1400
44508684 fluffyowl C Oct. 18, 2018, 5:22 p.m. OK D TESTS 128 46 4198400 1400
44563020 Denor C Oct. 19, 2018, 8:36 p.m. OK Delphi TESTS 128 46 307200 1400
44506397 ruban C Oct. 18, 2018, 5:10 p.m. OK Delphi TESTS 128 46 224665600 1400
48428569 binarmo C Jan. 15, 2019, 4:06 p.m. OK FPC TESTS 128 31 0 1400
44518207 PAG C Oct. 18, 2018, 6:50 p.m. OK FPC TESTS 128 31 0 1400
44516036 TShT C Oct. 18, 2018, 6:24 p.m. OK FPC TESTS 128 46 1228800 1400
44507072 demoralizer C Oct. 18, 2018, 5:14 p.m. OK GNU C11 TESTS 128 31 0 1400
44779339 oyldz93 C Oct. 24, 2018, 3:44 p.m. OK GNU C11 TESTS 128 31 0 1400
44714760 agrawalmudit82 C Oct. 22, 2018, 8:51 p.m. OK GNU C11 TESTS 128 31 0 1400
44518338 Seishun_doala C Oct. 18, 2018, 6:51 p.m. OK GNU C11 TESTS 128 46 0 1400
44517207 balu123 C Oct. 18, 2018, 6:37 p.m. OK GNU C11 TESTS 128 46 0 1400
44518317 jasshangoel C Oct. 18, 2018, 6:51 p.m. OK GNU C11 TESTS 128 46 0 1400
57868416 lopare C July 27, 2019, 11:14 p.m. OK GNU C++11 TESTS 128 31 0 1400
57849700 luogu_bot4 C July 27, 2019, 12:38 p.m. OK GNU C++11 TESTS 128 31 0 1400
57841361 LittleBeetle C July 27, 2019, 9:26 a.m. OK GNU C++11 TESTS 128 31 0 1400
56785313 DP_liver C July 10, 2019, 8:07 a.m. OK GNU C++11 TESTS 128 31 0 1400
59944911 slowman C Sept. 3, 2019, 12:41 p.m. OK GNU C++11 TESTS 128 31 0 1400
61420796 Zimba C Sept. 28, 2019, 11:41 a.m. OK GNU C++11 TESTS 128 31 0 1400
67520925 vjudge2 C Dec. 24, 2019, 12:23 p.m. OK GNU C++11 TESTS 128 31 0 1400
67857187 vjudge5 C Dec. 29, 2019, 6:35 a.m. OK GNU C++11 TESTS 128 31 0 1400
58962615 Backseat-Stargazer C Aug. 17, 2019, 4:02 p.m. OK GNU C++11 TESTS 128 31 0 1400
58420685 luogu_bot2 C Aug. 7, 2019, 7:36 a.m. OK GNU C++11 TESTS 128 31 0 1400
50604042 Hayven C Feb. 28, 2019, 1:49 p.m. OK GNU C++14 TESTS 128 30 0 1400
50082221 vjudge2 C Feb. 18, 2019, 5:09 a.m. OK GNU C++14 TESTS 128 30 0 1400
44751494 ReaLNero1 C Oct. 23, 2018, 8:11 p.m. OK GNU C++14 TESTS 128 30 0 1400
44527377 Pswami C Oct. 19, 2018, 4 a.m. OK GNU C++14 TESTS 128 30 0 1400
44524998 dwt C Oct. 19, 2018, 1:14 a.m. OK GNU C++14 TESTS 128 30 0 1400
44534396 PAY_ C Oct. 19, 2018, 8:12 a.m. OK GNU C++14 TESTS 128 30 102400 1400
68082129 ritik_patel05 C Jan. 2, 2020, 2:46 p.m. OK GNU C++14 TESTS 128 31 0 1400
68087430 _KMS_ C Jan. 2, 2020, 4:47 p.m. OK GNU C++14 TESTS 128 31 0 1400
68081926 Pallove C Jan. 2, 2020, 2:41 p.m. OK GNU C++14 TESTS 128 31 0 1400
68050707 neckhill007 C Jan. 1, 2020, 6:41 p.m. OK GNU C++14 TESTS 128 31 0 1400
67393356 i_ll_try_123 C Dec. 21, 2019, 9:01 p.m. OK GNU C++17 TESTS 128 31 0 1400
66663461 rajataggarwal2019 C Dec. 12, 2019, 5:55 a.m. OK GNU C++17 TESTS 128 31 0 1400
64164317 Mai-sanBestWaifu C Nov. 3, 2019, 3:41 p.m. OK GNU C++17 TESTS 128 31 0 1400
68081070 PARTH_4399 C Jan. 2, 2020, 2:23 p.m. OK GNU C++17 TESTS 128 31 0 1400
67482255 Semal10 C Dec. 23, 2019, 4:18 p.m. OK GNU C++17 TESTS 128 31 0 1400
68081295 rajan_keshari C Jan. 2, 2020, 2:28 p.m. OK GNU C++17 TESTS 128 31 0 1400
68158295 sjd0 C Jan. 4, 2020, 9:48 a.m. OK GNU C++17 TESTS 128 31 0 1400
68492664 dk1108 C Jan. 10, 2020, 12:16 p.m. OK GNU C++17 TESTS 128 31 0 1400
69205876 NiloyRafi C Jan. 20, 2020, 5:59 p.m. OK GNU C++17 TESTS 128 31 0 1400
69913070 valerikk C Jan. 31, 2020, 3:57 p.m. OK GNU C++17 TESTS 128 31 0 1400
44623566 aman28rwt C Oct. 21, 2018, 7:52 a.m. OK Java 8 TESTS 128 109 0 1400
44543510 darshankdarji C Oct. 19, 2018, 12:32 p.m. OK Java 8 TESTS 128 109 0 1400
44527591 chandan5284 C Oct. 19, 2018, 4:12 a.m. OK Java 8 TESTS 128 124 0 1400
57761341 MagentaCobra C July 25, 2019, 6:08 p.m. OK Java 8 TESTS 128 124 0 1400
47262737 abhi2601 C Dec. 19, 2018, 1:03 p.m. OK Java 8 TESTS 128 124 0 1400
44961211 Digwener C Oct. 27, 2018, 4:35 p.m. OK Java 8 TESTS 128 124 0 1400
44537734 Vyshu C Oct. 19, 2018, 9:49 a.m. OK Java 8 TESTS 128 124 0 1400
44523511 Mazen_Tarek C Oct. 18, 2018, 11:07 p.m. OK Java 8 TESTS 128 124 0 1400
44514799 DropKeBaadNirma C Oct. 18, 2018, 6:11 p.m. OK Java 8 TESTS 128 124 0 1400
44512228 xodiac C Oct. 18, 2018, 5:48 p.m. OK Java 8 TESTS 128 124 0 1400
44502568 ivan.popelyshev C Oct. 18, 2018, 4:54 p.m. OK Kotlin TESTS 128 156 716800 1400
44515106 zloi.timur C Oct. 18, 2018, 6:14 p.m. OK Kotlin TESTS 128 187 716800 1400
44505207 alexey.enkov C Oct. 18, 2018, 5:04 p.m. OK Kotlin TESTS 128 218 1228800 1400
44549168 greenkirill C Oct. 19, 2018, 2:39 p.m. OK Mono C# TESTS 128 62 102400 1400
47864041 claw88 C Jan. 3, 2019, 8:26 a.m. OK Mono C# TESTS 128 62 102400 1400
44565165 sanek_2bas C Oct. 19, 2018, 10:32 p.m. OK Mono C# TESTS 128 62 3686400 1400
55924921 og.kostya C June 22, 2019, 8:55 a.m. OK Mono C# TESTS 128 62 4608000 1400
44510299 eki C Oct. 18, 2018, 5:33 p.m. OK Mono C# TESTS 128 77 102400 1400
44504417 AnatolyTolstobrov C Oct. 18, 2018, 5:01 p.m. OK Mono C# TESTS 128 77 3788800 1400
44521892 dinarisio C Oct. 18, 2018, 9:46 p.m. OK Mono C# TESTS 128 77 3891200 1400
48115134 Mem C Jan. 9, 2019, 12:13 p.m. OK Mono C# TESTS 128 77 3891200 1400
44516698 Anastasiya_Andreevna C Oct. 18, 2018, 6:31 p.m. OK Mono C# TESTS 128 78 1843200 1400
44510258 eulerscheZahl C Oct. 18, 2018, 5:33 p.m. OK Mono C# TESTS 128 78 3788800 1400
44914350 scorpiowf C Oct. 26, 2018, 2:48 p.m. OK MS C++ TESTS 128 31 0 1400
44595905 ProstoFilya C Oct. 20, 2018, 12:30 p.m. OK MS C++ TESTS 128 31 0 1400
46470078 vjudge5 C Dec. 2, 2018, 7:03 a.m. OK MS C++ TESTS 128 31 0 1400
44503086 CtrlAlt C Oct. 18, 2018, 4:56 p.m. OK MS C++ TESTS 128 31 0 1400
44506622 ArtyomTsepov C Oct. 18, 2018, 5:11 p.m. OK MS C++ TESTS 128 31 0 1400
44516765 Ksenia_C C Oct. 18, 2018, 6:32 p.m. OK MS C++ TESTS 128 31 0 1400
44516887 BurkevichV C Oct. 18, 2018, 6:33 p.m. OK MS C++ TESTS 128 31 0 1400
44544162 shahc C Oct. 19, 2018, 12:47 p.m. OK MS C++ TESTS 128 31 0 1400
44501606 LoneFox C Oct. 18, 2018, 4:52 p.m. OK MS C++ TESTS 128 31 102400 1400
44517267 abtest100 C Oct. 18, 2018, 6:38 p.m. OK MS C++ TESTS 128 31 102400 1400
65467965 Mad112233 C Nov. 21, 2019, 7:02 a.m. OK MS C++ 2017 TESTS 128 46 307200 1400
44516463 Fardale C Oct. 18, 2018, 6:28 p.m. OK Ocaml TESTS 128 31 307200 1400
44513437 Arcadii C Oct. 18, 2018, 5:59 p.m. OK PascalABC.NET TESTS 128 62 512000 1400
44519653 koptev C Oct. 18, 2018, 7:04 p.m. OK PascalABC.NET TESTS 128 77 512000 1400
44513694 Lucky_cat777 C Oct. 18, 2018, 6:01 p.m. OK PascalABC.NET TESTS 128 78 6860800 1400
44530297 mayakin C Oct. 19, 2018, 6:07 a.m. OK PHP TESTS 128 78 409600 1400
44530186 mayakin C Oct. 19, 2018, 6:03 a.m. OK PHP TESTS 128 93 409600 1400
44511868 Onesh0t C Oct. 18, 2018, 5:45 p.m. OK PyPy 2 TESTS 128 155 819200 1400
44510951 PBatch C Oct. 18, 2018, 5:38 p.m. OK PyPy 2 TESTS 128 155 921600 1400
54793601 kaif_7 C May 29, 2019, 8:33 a.m. OK PyPy 2 TESTS 128 156 819200 1400
44533971 apoorv1999 C Oct. 19, 2018, 7:59 a.m. OK PyPy 2 TESTS 128 156 1126400 1400
44506889 exoji2e C Oct. 18, 2018, 5:13 p.m. OK PyPy 2 TESTS 128 156 1126400 1400
44510846 kal013 C Oct. 18, 2018, 5:37 p.m. OK PyPy 2 TESTS 128 171 921600 1400
44512725 rkstalker C Oct. 18, 2018, 5:52 p.m. OK PyPy 2 TESTS 128 202 819200 1400
44502815 alexwice C Oct. 18, 2018, 4:55 p.m. OK PyPy 2 TESTS 128 202 2355200 1400
44526939 pa.n.ik C Oct. 19, 2018, 3:33 a.m. OK PyPy 2 TESTS 128 249 12185600 1400
45271099 ulyabelyaeva C Nov. 4, 2018, 8:33 a.m. OK PyPy 3 TESTS 128 155 614400 1400
44503703 Grevozin C Oct. 18, 2018, 4:58 p.m. OK PyPy 3 TESTS 128 155 819200 1400
44549196 nikeshthapa255 C Oct. 19, 2018, 2:39 p.m. OK PyPy 3 TESTS 128 155 921600 1400
44530641 devansh1497 C Oct. 19, 2018, 6:19 a.m. OK PyPy 3 TESTS 128 156 1228800 1400
44509767 semicfly C Oct. 18, 2018, 5:30 p.m. OK PyPy 3 TESTS 128 171 819200 1400
44517153 fikr C Oct. 18, 2018, 6:37 p.m. OK PyPy 3 TESTS 128 171 921600 1400
44515975 tranphuminhbkhn C Oct. 18, 2018, 6:23 p.m. OK PyPy 3 TESTS 128 171 921600 1400
44510436 Paixao C Oct. 18, 2018, 5:34 p.m. OK PyPy 3 TESTS 128 171 1024000 1400
44536517 Mr.Inconsistent C Oct. 19, 2018, 9:11 a.m. OK PyPy 3 TESTS 128 171 1126400 1400
44517499 MotaSanyal C Oct. 18, 2018, 6:41 p.m. OK PyPy 3 TESTS 128 171 1433600 1400
44513393 deadkey C Oct. 18, 2018, 5:58 p.m. OK Python 2 TESTS 128 234 512000 1400
44510790 wangkan2001 C Oct. 18, 2018, 5:37 p.m. OK Python 2 TESTS 128 249 307200 1400
44732391 charan9948 C Oct. 23, 2018, 11:16 a.m. OK Python 2 TESTS 128 312 409600 1400
45427502 Babyrain C Nov. 7, 2018, 10:47 p.m. OK Python 2 TESTS 128 326 0 1400
44514110 piyush.ravi C Oct. 18, 2018, 6:05 p.m. OK Python 2 TESTS 128 327 0 1400
44515707 thuglife69 C Oct. 18, 2018, 6:20 p.m. OK Python 2 TESTS 128 327 819200 1400
48072242 adair C Jan. 8, 2019, 1:43 a.m. OK Python 2 TESTS 128 389 409600 1400
44515548 gkrishnan724 C Oct. 18, 2018, 6:19 p.m. OK Python 2 TESTS 128 670 102400 1400
44557015 ADR-007 C Oct. 19, 2018, 5:50 p.m. OK Python 3 TESTS 128 124 102400 1400
44556775 ADR-007 C Oct. 19, 2018, 5:42 p.m. OK Python 3 TESTS 128 140 512000 1400
44516140 Pratik_2106 C Oct. 18, 2018, 6:25 p.m. OK Python 3 TESTS 128 140 716800 1400
44589865 lupe C Oct. 20, 2018, 10:43 a.m. OK Python 3 TESTS 128 171 614400 1400
44554799 ADR-007 C Oct. 19, 2018, 4:47 p.m. OK Python 3 TESTS 128 171 819200 1400
44514590 maxoja C Oct. 18, 2018, 6:09 p.m. OK Python 3 TESTS 128 218 1024000 1400
44549965 weizhao C Oct. 19, 2018, 2:56 p.m. OK Python 3 TESTS 128 234 102400 1400
44511431 gosipov C Oct. 18, 2018, 5:41 p.m. OK Python 3 TESTS 128 234 102400 1400
44861883 Febrin C Oct. 25, 2018, 3:31 p.m. OK Python 3 TESTS 128 248 716800 1400
44516667 chauhain C Oct. 18, 2018, 6:31 p.m. OK Python 3 TESTS 128 249 102400 1400
44513389 geckods C Oct. 18, 2018, 5:58 p.m. OK Ruby TESTS 128 109 204800 1400
44546941 wrick C Oct. 19, 2018, 1:50 p.m. OK Scala TESTS 128 545 0 1400
44509684 wrick C Oct. 18, 2018, 5:29 p.m. OK Scala TESTS 128 560 0 1400

remove filters

Back to search problems