Codeforces Round 381 (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
739 Codeforces Round 381 (Div. 1) FINISHED False 7200 257261063 Nov. 23, 2016, 4:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 7919 ) A Alyona and mex PROGRAMMING constructive algorithms greedy 1600

B"Alyona's mother wants to present an array of n non-negative integers to Alyona. The array should be special. Alyona is a capricious girl so after she gets the array, she inspects m of its subarrays. Subarray is a set of some subsequent elements of the array. The i-th subarray is described with two integers li and ri, and its elements are a[li], xe2 x80 x89a[li xe2 x80 x89+ xe2 x80 x891], xe2 x80 x89..., xe2 x80 x89a[ri]. Alyona is going to find mex for each of the chosen subarrays. Among these m mexes the girl is going to find the smallest. She wants this minimum mex to be as large as possible. You are to find an array a of n elements so that the minimum mex among those chosen by Alyona subarrays is as large as possible. The mex of a set S is a minimum possible non-negative integer that is not in S. The first line contains two integers n and m (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105). The next m lines contain information about the subarrays chosen by Alyona. The i-th of these lines contains two integers li and ri (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89li xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ri xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n), that describe the subarray a[li], xe2 x80 x89a[li xe2 x80 x89+ xe2 x80 x891], xe2 x80 x89..., xe2 x80 x89a[ri]. In the first line print single integer -- the maximum possible minimum mex. In the second line print n integers -- the array a. All the elements in a should be between 0 and 109. It is guaranteed that there is an optimal answer in which all the elements in a are between 0 and 109. If there are multiple solutions, print any of them. The first example: the mex of the subarray (1, xe2 x80 x893) is equal to 3, the mex of the subarray (2, xe2 x80 x895) is equal to 3, the mex of the subarray (4, xe2 x80 x895) is equal to 2 as well, thus the minumal mex among the subarrays chosen by Alyona is equal to 2. "...

Tutorials

48582

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
26474234 vjudge5 A April 18, 2017, 11:26 a.m. OK FPC TESTS 69 202 1638400 1600
22457967 mh211 A Nov. 24, 2016, 3:27 a.m. OK FPC TESTS 69 218 409600 1600
22557805 vladKB1 A Nov. 27, 2016, 7:25 p.m. OK FPC TESTS 69 234 1331200 1600
22457752 k2nt A Nov. 24, 2016, 3:04 a.m. OK FPC TESTS 69 248 1331200 1600
22458033 mh211 A Nov. 24, 2016, 3:34 a.m. OK FPC TESTS 69 249 102400 1600
22439091 0lkeh A Nov. 23, 2016, 5:18 p.m. OK FPC TESTS 69 249 2457600 1600
22606849 ahav A Nov. 29, 2016, 5:13 p.m. OK FPC TESTS 69 280 0 1600
22636114 bzh A Dec. 1, 2016, 9:34 a.m. OK FPC TESTS 69 296 1638400 1600
57342811 LaSWeeG A July 19, 2019, 8 p.m. OK FPC TESTS 69 342 1228800 1600
64721800 luogu_bot5 A Nov. 12, 2019, 4:08 a.m. OK FPC TESTS 69 343 0 1600
22652395 MegaBidoof A Dec. 2, 2016, 5:59 a.m. OK GNU C TESTS 69 61 0 1600
22834927 Rejwan A Dec. 9, 2016, 1:43 p.m. OK GNU C TESTS 69 62 0 1600
22428329 EKASMA A Nov. 23, 2016, 4:40 p.m. OK GNU C TESTS 69 62 0 1600
22639034 jkxjkx1031 A Dec. 1, 2016, 12:30 p.m. OK GNU C TESTS 69 77 409600 1600
23227484 effutue A Dec. 22, 2016, 2:49 p.m. OK GNU C TESTS 69 78 1945600 1600
22482544 MarsVsSnickers A Nov. 25, 2016, 5:26 a.m. OK GNU C TESTS 69 93 0 1600
22476481 gr8_coder A Nov. 24, 2016, 5:58 p.m. OK GNU C TESTS 69 93 0 1600
22508471 Andra_28 A Nov. 26, 2016, 12:10 p.m. OK GNU C TESTS 69 93 409600 1600
22681606 ajsj7598 A Dec. 3, 2016, 5:16 p.m. OK GNU C TESTS 69 93 5632000 1600
24688550 vjudge4 A Feb. 15, 2017, 7:35 a.m. OK GNU C TESTS 69 108 1843200 1600
39515961 Siyuan A June 22, 2018, 12:10 p.m. OK GNU C++ TESTS 69 31 819200 1600
25345725 Fire_man A March 8, 2017, 4:39 p.m. OK GNU C++ TESTS 69 31 2150400 1600
25969711 yylidiw A March 31, 2017, 6:55 a.m. OK GNU C++ TESTS 69 31 2457600 1600
40509215 Scut82 A July 18, 2018, 10:05 a.m. OK GNU C++ TESTS 69 46 0 1600
40501089 Scut82 A July 18, 2018, 6:15 a.m. OK GNU C++ TESTS 69 46 0 1600
29541974 vjudge2 A Aug. 18, 2017, 2:43 a.m. OK GNU C++ TESTS 69 46 0 1600
22483199 nicoing A Nov. 25, 2016, 6:20 a.m. OK GNU C++ TESTS 69 46 0 1600
32074363 cdgyp A Nov. 5, 2017, 11:14 a.m. OK GNU C++ TESTS 69 46 409600 1600
22430527 cbhcbh A Nov. 23, 2016, 4:47 p.m. OK GNU C++ TESTS 69 46 409600 1600
39515933 Siyuan A June 22, 2018, 12:09 p.m. OK GNU C++ TESTS 69 46 819200 1600
26763236 vjudge1 A April 30, 2017, 8:03 a.m. OK GNU C11 TESTS 69 483 1945600 1600
23919077 vjudge2 A Jan. 18, 2017, 10:05 a.m. OK GNU C11 TESTS 69 561 1843200 1600
22461352 voidmax A Nov. 24, 2016, 7:56 a.m. OK GNU C++11 TESTS 69 30 0 1600
30308392 zykzhenshuai A Sept. 13, 2017, 1:40 p.m. OK GNU C++11 TESTS 69 31 0 1600
27893307 zykzhenshuai A June 19, 2017, 1:19 a.m. OK GNU C++11 TESTS 69 31 0 1600
24400646 Lily A Feb. 3, 2017, 3:24 a.m. OK GNU C++11 TESTS 69 31 2048000 1600
62399805 2016c01 A Oct. 12, 2019, 6:58 a.m. OK GNU C++11 TESTS 69 46 0 1600
57927540 Frame233 A July 29, 2019, 7:37 a.m. OK GNU C++11 TESTS 69 46 0 1600
44398744 nansns A Oct. 16, 2018, noon OK GNU C++11 TESTS 69 46 0 1600
44398361 nansns A Oct. 16, 2018, 11:51 a.m. OK GNU C++11 TESTS 69 46 0 1600
40983113 ReaLNero1 A July 30, 2018, 6:43 p.m. OK GNU C++11 TESTS 69 46 0 1600
22657153 yp0413150208 A Dec. 2, 2016, 12:25 p.m. OK GNU C++11 TESTS 69 46 0 1600
22430200 Egor.Lifar A Nov. 23, 2016, 4:46 p.m. OK GNU C++14 TESTS 69 30 819200 1600
22461370 voidmax A Nov. 24, 2016, 7:57 a.m. OK GNU C++14 TESTS 69 31 0 1600
22795149 sicon54 A Dec. 7, 2016, 6:42 p.m. OK GNU C++14 TESTS 69 31 1945600 1600
22459399 Peekaboo A Nov. 24, 2016, 5:42 a.m. OK GNU C++14 TESTS 69 61 819200 1600
30759600 hell_hacker A Sept. 26, 2017, 6:03 p.m. OK GNU C++14 TESTS 69 62 0 1600
40410475 HassanRagab A July 16, 2018, 12:12 p.m. OK GNU C++14 TESTS 69 62 0 1600
49124918 vjudge5 A Jan. 28, 2019, 9:52 p.m. OK GNU C++14 TESTS 69 62 0 1600
29642840 kongroo A Aug. 21, 2017, 12:03 p.m. OK GNU C++14 TESTS 69 62 0 1600
30759610 hell_hacker A Sept. 26, 2017, 6:04 p.m. OK GNU C++14 TESTS 69 62 0 1600
55675000 matumbaman A June 17, 2019, 9:54 a.m. OK GNU C++14 TESTS 69 62 0 1600
50911569 vjudge5 A March 7, 2019, 2:52 a.m. OK GNU C++17 TESTS 69 62 0 1600
45270638 Shayan.P A Nov. 4, 2018, 8:22 a.m. OK GNU C++17 TESTS 69 62 0 1600
66779149 HeRaNO krazy ZXyang A Dec. 13, 2019, 11:19 a.m. OK GNU C++17 TESTS 69 62 819200 1600
55285258 fakhoury A June 8, 2019, 4:26 a.m. OK GNU C++17 TESTS 69 77 0 1600
68984164 Magicdog_Jo A Jan. 17, 2020, 11:52 a.m. OK GNU C++17 TESTS 69 77 0 1600
59920110 LeoRiether A Sept. 2, 2019, 9:52 p.m. OK GNU C++17 TESTS 69 77 0 1600
52532978 markotee A April 9, 2019, 2:15 p.m. OK GNU C++17 TESTS 69 77 0 1600
50993479 vjudge5 A March 8, 2019, 1:23 a.m. OK GNU C++17 TESTS 69 77 0 1600
44623620 fedoseev.timofey A Oct. 21, 2018, 7:54 a.m. OK GNU C++17 TESTS 69 77 0 1600
44259162 vjudge1 A Oct. 13, 2018, 1:41 p.m. OK GNU C++17 TESTS 69 77 0 1600
29533641 akshay_miterani A Aug. 17, 2017, 7:27 p.m. OK Java 8 TESTS 69 155 0 1600
22466386 hama-du A Nov. 24, 2016, 12:37 p.m. OK Java 8 TESTS 69 155 0 1600
22437147 poikniok A Nov. 23, 2016, 5:09 p.m. OK Java 8 TESTS 69 156 0 1600
26163903 ml_guy A April 6, 2017, 7:17 a.m. OK Java 8 TESTS 69 156 20684800 1600
22647627 seerviashish17 A Dec. 1, 2016, 7:56 p.m. OK Java 8 TESTS 69 170 0 1600
26291786 anuj64 A April 11, 2017, 6:51 a.m. OK Java 8 TESTS 69 170 20582400 1600
22431677 hiro116s A Nov. 23, 2016, 4:50 p.m. OK Java 8 TESTS 69 171 0 1600
69061813 lazypanda A Jan. 18, 2020, 4:50 p.m. OK Java 8 TESTS 69 171 0 1600
31254664 zodiacleo A Oct. 12, 2017, 4:19 p.m. OK Java 8 TESTS 69 171 0 1600
22429370 uwi A Nov. 23, 2016, 4:44 p.m. OK Java 8 TESTS 69 171 0 1600
22918490 JoeBlow A Dec. 13, 2016, 2:43 a.m. OK Kotlin TESTS 69 171 0 1600
22703183 vyxaryx A Dec. 5, 2016, 12:34 a.m. OK Kotlin TESTS 69 186 0 1600
45821134 BackendDeveloper A Nov. 16, 2018, 3:25 p.m. OK Kotlin TESTS 69 686 0 1600
22917465 JoeBlow A Dec. 12, 2016, 11:55 p.m. OK Kotlin TESTS 69 717 0 1600
22917375 JoeBlow A Dec. 12, 2016, 11:42 p.m. OK Kotlin TESTS 69 717 0 1600
22908845 JoeBlow A Dec. 12, 2016, 4:55 p.m. OK Kotlin TESTS 69 888 1228800 1600
51488456 nemars A March 19, 2019, 2:37 p.m. OK Mono C# TESTS 69 171 9113600 1600
22428732 riantkb A Nov. 23, 2016, 4:42 p.m. OK Mono C# TESTS 69 186 8089600 1600
32207845 hexagonforce A Nov. 10, 2017, 11:40 p.m. OK Mono C# TESTS 69 312 3072000 1600
22429927 AnatolyTolstobrov A Nov. 23, 2016, 4:45 p.m. OK MS C# TESTS 69 93 5734400 1600
22492331 ivailok1 A Nov. 25, 2016, 3:31 p.m. OK MS C# TESTS 69 171 10444800 1600
22428272 chokudai A Nov. 23, 2016, 4:40 p.m. OK MS C# TESTS 69 561 3072000 1600
22458589 zyding A Nov. 24, 2016, 4:32 a.m. OK MS C++ TESTS 69 62 0 1600
22431226 Filyan A Nov. 23, 2016, 4:48 p.m. OK MS C++ TESTS 69 62 0 1600
44153881 vjudge5 A Oct. 11, 2018, 5:26 p.m. OK MS C++ TESTS 69 62 0 1600
22430083 Krainov_Dmitry A Nov. 23, 2016, 4:45 p.m. OK MS C++ TESTS 69 62 0 1600
22430254 Carups A Nov. 23, 2016, 4:46 p.m. OK MS C++ TESTS 69 62 0 1600
22694158 houtianqian A Dec. 4, 2016, 11:05 a.m. OK MS C++ TESTS 69 62 0 1600
22477579 UclaWorstUniversity A Nov. 24, 2016, 7:10 p.m. OK MS C++ TESTS 69 62 0 1600
22801069 jslijin A Dec. 8, 2016, 3:44 a.m. OK MS C++ TESTS 69 62 2048000 1600
24427929 vjudge3 A Feb. 4, 2017, 8:37 a.m. OK MS C++ TESTS 69 62 2048000 1600
22765245 AU.Bahosain A Dec. 6, 2016, 5:48 p.m. OK MS C++ TESTS 69 62 2048000 1600
51614089 Nikolai16 A March 21, 2019, 11:45 a.m. OK MS C++ 2017 TESTS 69 218 0 1600
60575385 sladkayaKlubnichka A Sept. 14, 2019, 4:33 p.m. OK MS C++ 2017 TESTS 69 218 0 1600
66590390 yuanyuan2048 A Dec. 10, 2019, 12:48 p.m. OK MS C++ 2017 TESTS 69 233 307200 1600
49495042 PavelChadnov A Feb. 5, 2019, 12:24 p.m. OK MS C++ 2017 TESTS 69 234 0 1600
57301509 AhmedAdelSalama A July 19, 2019, 12:11 a.m. OK MS C++ 2017 TESTS 69 234 819200 1600
51905053 index_ A March 27, 2019, 3:07 p.m. OK MS C++ 2017 TESTS 69 265 20070400 1600
22463421 AmiRossi A Nov. 24, 2016, 10:14 a.m. OK Ocaml TESTS 69 109 204800 1600
22471168 Darooha A Nov. 24, 2016, 4:09 p.m. OK Ocaml TESTS 69 124 204800 1600
22461101 mayakin A Nov. 24, 2016, 7:38 a.m. OK PHP TESTS 69 171 20480000 1600
22580892 Nemmo A Nov. 28, 2016, 4:16 p.m. OK PyPy 2 TESTS 69 436 8908800 1600
31950808 atulac A Nov. 1, 2017, 1:07 p.m. OK PyPy 2 TESTS 69 951 2969600 1600
30228029 iit2014101 A Sept. 9, 2017, 2:32 p.m. OK PyPy 2 TESTS 69 967 2560000 1600
35475038 FatherofBenoni A Feb. 19, 2018, 3:32 p.m. OK PyPy 2 TESTS 69 1013 23859200 1600
22614519 nealzane A Nov. 30, 2016, 5:38 a.m. OK PyPy 2 TESTS 69 1170 4710400 1600
22432217 Giove A Nov. 23, 2016, 4:51 p.m. OK PyPy 2 TESTS 69 1341 8089600 1600
23045978 cugel A Dec. 17, 2016, 11:31 a.m. OK PyPy 3 TESTS 69 358 13209600 1600
24421851 vjudge2 A Feb. 3, 2017, 11:17 p.m. OK PyPy 3 TESTS 69 623 31334400 1600
66631379 IngaleAnkur10 A Dec. 11, 2019, 11:18 a.m. OK PyPy 3 TESTS 69 920 11980800 1600
66145766 Mohamed_Ayman A Dec. 1, 2019, 4:29 p.m. OK PyPy 3 TESTS 69 935 20480000 1600
57530523 kopok2 A July 22, 2019, 3:19 p.m. OK PyPy 3 TESTS 69 951 19148800 1600
49851301 111vad111 A Feb. 13, 2019, 3:55 a.m. OK PyPy 3 TESTS 69 966 9216000 1600
23045937 cugel A Dec. 17, 2016, 11:30 a.m. OK PyPy 3 TESTS 69 1107 14848000 1600
47714775 HeyLaCC A Dec. 30, 2018, 6:50 a.m. OK PyPy 3 TESTS 69 1216 19353600 1600
23645999 pepsin92 A Jan. 8, 2017, 12:32 p.m. OK PyPy 3 TESTS 69 1419 35942400 1600
22429028 nwi A Nov. 23, 2016, 4:43 p.m. OK Python 2 TESTS 69 155 11161600 1600
34880391 laoliumang A Feb. 3, 2018, 2:39 a.m. OK Python 2 TESTS 69 327 23040000 1600
29105868 isgulkov A Aug. 1, 2017, 3:53 p.m. OK Python 2 TESTS 69 343 4710400 1600
22831202 SaraGuru A Dec. 9, 2016, 10:41 a.m. OK Python 2 TESTS 69 358 2048000 1600
22499035 shikhi7 A Nov. 25, 2016, 11:26 p.m. OK Python 2 TESTS 69 358 5939200 1600
22457297 whn6325689 A Nov. 24, 2016, 2:18 a.m. OK Python 2 TESTS 69 374 7168000 1600
22569142 StalinsPython A Nov. 28, 2016, 8:47 a.m. OK Python 2 TESTS 69 420 4812800 1600
22428644 llllllll A Nov. 23, 2016, 4:42 p.m. OK Python 2 TESTS 69 483 15257600 1600
22576156 kir.chulkov A Nov. 28, 2016, 12:33 p.m. OK Python 2 TESTS 69 546 14336000 1600
22653667 chq.matteo A Dec. 2, 2016, 7:56 a.m. OK Python 3 TESTS 69 327 6041600 1600
24397749 vjudge1 A Feb. 2, 2017, 10:54 p.m. OK Python 3 TESTS 69 374 21811200 1600
28554206 jDomantas A July 14, 2017, 5:21 p.m. OK Python 3 TESTS 69 389 10342400 1600
22624691 MehrdadM A Nov. 30, 2016, 1:34 p.m. OK Python 3 TESTS 69 405 16179200 1600
24398154 vjudge5 A Feb. 2, 2017, 11:34 p.m. OK Python 3 TESTS 69 420 10854400 1600
24398634 vjudge2 A Feb. 3, 2017, 12:26 a.m. OK Python 3 TESTS 69 421 10854400 1600
22983620 merolish A Dec. 14, 2016, 9:47 p.m. OK Python 3 TESTS 69 436 16179200 1600
22606714 Volpe A Nov. 29, 2016, 5:06 p.m. OK Python 3 TESTS 69 451 5222400 1600
47523188 jaaguptamme A Dec. 26, 2018, 2:16 p.m. OK Python 3 TESTS 69 452 2969600 1600
22641171 kishertka A Dec. 1, 2016, 2:01 p.m. OK Python 3 TESTS 69 467 4710400 1600
23694315 Brough A Jan. 11, 2017, 9:07 a.m. OK Ruby TESTS 69 467 6553600 1600
23494764 dione A Jan. 2, 2017, 7:39 a.m. OK Ruby TESTS 69 639 6451200 1600
22497850 reldan A Nov. 25, 2016, 9:12 p.m. OK Scala TESTS 69 577 1228800 1600

remove filters

Back to search problems