Codeforces Round 541 (Div. 2)

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
1131 Codeforces Round 541 (Div. 2) FINISHED False 7200 180905999 Feb. 23, 2019, 10:20 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 14889 ) C Birthday PROGRAMMING binary search greedy sortings 1200

B"Cowboy Vlad has a birthday today! There are n children who came to the celebration. In order to greet Vlad, the children decided to form a circle around him. Among the children who came, there are both tall and low, so if they stand in a circle arbitrarily, it may turn out, that there is a tall and low child standing next to each other, and it will be difficult for them to hold hands. Therefore, children want to stand in a circle so that the maximum difference between the growth of two neighboring children would be minimal possible. Formally, let's number children from 1 to n in a circle order, that is, for every i child with number i will stand next to the child with number i+1 , also the child with number 1 stands next to the child with number n . Then we will call the discomfort of the circle the maximum absolute difference of heights of the children, who stand next to each other. Please help children to find out how they should reorder themselves, so that the resulting discomfort is smallest possible. The first line contains a single integer n ( 2 <= q n <= q 100 ) -- the number of the children who came to the cowboy Vlad's birthday. The second line contains integers a_1, a_2, ldots, a_n ( 1 <= q a_i <= q 10^9 ) denoting heights of every child. Print exactly n integers -- heights of the children in the order in which they should stand in a circle. You can start printing a circle with any child. If there are multiple possible answers, print any of them. In the first example, the discomfort of the circle is equal to 1 , since the corresponding absolute differences are 1 , 1 , 1 and 0 . Note, that sequences [2, 3, 2, 1, 1] and [3, 2, 1, 1, 2] form the same circles and differ only by the selection of the starting point. In the second example, the discomfort of the circle is equal to 20 , since the absolute difference of 10 and 30"...

Tutorials

Codeforces Round #541 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
54978664 vjudge2 C June 2, 2019, 12:03 p.m. OK Clang++17 Diagnostics TESTS 20 46 0 1200
56495120 453908766 C July 4, 2019, 2:21 a.m. OK Clang++17 Diagnostics TESTS 20 46 0 1200
59967451 vjudge1 C Sept. 3, 2019, 9:36 p.m. OK Clang++17 Diagnostics TESTS 20 46 0 1200
50585947 Minasenayuki C Feb. 28, 2019, 3:38 a.m. OK Clang++17 Diagnostics TESTS 20 46 0 1200
50430737 PhuongPeu C Feb. 24, 2019, 1:54 p.m. OK FPC TESTS 20 30 409600 1200
51472287 chaorenhaha C March 19, 2019, 7:19 a.m. OK FPC TESTS 20 30 7987200 1200
51472280 chaorenhaha C March 19, 2019, 7:18 a.m. OK FPC TESTS 20 30 7987200 1200
58540412 romanporsh C Aug. 10, 2019, 1:55 p.m. OK FPC TESTS 20 31 0 1200
51472272 chaorenhaha C March 19, 2019, 7:18 a.m. OK FPC TESTS 20 31 0 1200
51472264 chaorenhaha C March 19, 2019, 7:18 a.m. OK FPC TESTS 20 31 102400 1200
51472290 chaorenhaha C March 19, 2019, 7:19 a.m. OK FPC TESTS 20 31 819200 1200
51472257 chaorenhaha C March 19, 2019, 7:17 a.m. OK FPC TESTS 20 31 3993600 1200
50488510 gydgem C Feb. 25, 2019, 12:31 p.m. OK FPC TESTS 20 46 0 1200
54979355 luoshunde123 C June 2, 2019, 12:23 p.m. OK GNU C11 TESTS 20 15 0 1200
52377941 greenbinjack C April 6, 2019, 8:58 a.m. OK GNU C11 TESTS 20 15 0 1200
51422732 vjudge1 C March 17, 2019, 5:27 p.m. OK GNU C11 TESTS 20 15 0 1200
54979549 vjudge5 C June 2, 2019, 12:28 p.m. OK GNU C11 TESTS 20 30 0 1200
51805799 vjudge2 C March 24, 2019, 9:34 p.m. OK GNU C11 TESTS 20 30 0 1200
51474763 Ornob011 C March 19, 2019, 8:44 a.m. OK GNU C11 TESTS 20 30 0 1200
51325045 A1phaZ3r0 C March 15, 2019, 9:17 a.m. OK GNU C11 TESTS 20 30 0 1200
50773378 BEmrenimoo C March 4, 2019, 6:43 a.m. OK GNU C11 TESTS 20 30 0 1200
50773374 ArKCa C March 4, 2019, 6:42 a.m. OK GNU C11 TESTS 20 30 0 1200
65610579 Fhasfn C Nov. 23, 2019, 11:40 p.m. OK GNU C11 TESTS 20 31 0 1200
57126744 blancheqi C July 16, 2019, 4:58 a.m. OK GNU C++11 TESTS 20 15 0 1200
56835559 piyushkhandelwal1009 C July 11, 2019, 8:53 a.m. OK GNU C++11 TESTS 20 15 0 1200
56471207 jisnu C July 3, 2019, 11:12 a.m. OK GNU C++11 TESTS 20 15 0 1200
55909006 luogu_bot1 C June 21, 2019, 11:34 p.m. OK GNU C++11 TESTS 20 15 0 1200
55909002 luogu_bot3 C June 21, 2019, 11:34 p.m. OK GNU C++11 TESTS 20 15 0 1200
54700863 thesourceisthetruth C May 26, 2019, 11:12 p.m. OK GNU C++11 TESTS 20 15 0 1200
54442936 ytp_2204 C May 21, 2019, 9:41 a.m. OK GNU C++11 TESTS 20 15 0 1200
58623356 Esconar C Aug. 11, 2019, 4:32 p.m. OK GNU C++11 TESTS 20 15 0 1200
62425405 ilham.sr C Oct. 12, 2019, 2:09 p.m. OK GNU C++11 TESTS 20 15 0 1200
64350458 luogu_bot5 C Nov. 6, 2019, 8:08 a.m. OK GNU C++11 TESTS 20 15 0 1200
69049552 fake_me26 C Jan. 18, 2020, 12:12 p.m. OK GNU C++14 TESTS 20 15 0 1200
69069391 skgen C Jan. 18, 2020, 8:31 p.m. OK GNU C++14 TESTS 20 15 0 1200
69788326 kanishkajain C Jan. 29, 2020, 5:46 p.m. OK GNU C++14 TESTS 20 15 0 1200
67047198 madlogic C Dec. 16, 2019, 11:55 p.m. OK GNU C++14 TESTS 20 15 0 1200
68162310 the_ellusionist7 C Jan. 4, 2020, 11:26 a.m. OK GNU C++14 TESTS 20 15 0 1200
68332879 ssid8802 C Jan. 6, 2020, 7:44 p.m. OK GNU C++14 TESTS 20 15 0 1200
68449483 maver1ck C Jan. 9, 2020, 1:50 p.m. OK GNU C++14 TESTS 20 15 0 1200
66749494 ConfusedBerzerk C Dec. 13, 2019, 5:09 a.m. OK GNU C++14 TESTS 20 15 0 1200
66613106 sstfmscontreras C Dec. 11, 2019, 12:18 a.m. OK GNU C++14 TESTS 20 15 0 1200
66610308 __Saitama__ C Dec. 10, 2019, 9:03 p.m. OK GNU C++14 TESTS 20 15 0 1200
68347915 maa.21shubham C Jan. 7, 2020, 8:18 a.m. OK GNU C++17 TESTS 20 15 0 1200
67316812 _Contender_ C Dec. 21, 2019, 6:25 a.m. OK GNU C++17 TESTS 20 15 0 1200
67125369 haarishkhan23 C Dec. 17, 2019, 7:50 p.m. OK GNU C++17 TESTS 20 15 0 1200
67070666 AhooraBozorgManesh C Dec. 17, 2019, 12:39 p.m. OK GNU C++17 TESTS 20 15 0 1200
66517677 Zahidul_Islam C Dec. 8, 2019, 7:52 p.m. OK GNU C++17 TESTS 20 15 0 1200
66363580 nbsjy C Dec. 5, 2019, 6:37 p.m. OK GNU C++17 TESTS 20 15 0 1200
65726309 meme_lord C Nov. 25, 2019, 11:38 p.m. OK GNU C++17 TESTS 20 15 0 1200
65660590 solox C Nov. 24, 2019, 12:13 p.m. OK GNU C++17 TESTS 20 15 0 1200
65585762 Nabeel_Ghallawenji C Nov. 23, 2019, 12:23 p.m. OK GNU C++17 TESTS 20 15 0 1200
65510310 xXasaadXx C Nov. 22, 2019, 3:09 a.m. OK GNU C++17 TESTS 20 15 0 1200
53953656 zloylos C May 10, 2019, 10:52 a.m. OK Go TESTS 20 31 0 1200
50387572 dai C Feb. 23, 2019, 1:02 p.m. OK Go TESTS 20 46 0 1200
50752624 danagi C March 3, 2019, 4:45 p.m. OK Haskell TESTS 20 15 102400 1200
51599185 jedikni C March 21, 2019, 1:42 a.m. OK Haskell TESTS 20 30 102400 1200
65165318 pizzaEater C Nov. 16, 2019, 1:03 p.m. OK Java 11 TESTS 20 187 0 1200
50408841 K.A C Feb. 23, 2019, 11:43 p.m. OK Java 8 TESTS 20 93 0 1200
68367998 cyberAce C Jan. 7, 2020, 4:41 p.m. OK Java 8 TESTS 20 108 0 1200
62344730 Bhavya_Arora C Oct. 11, 2019, 6:58 a.m. OK Java 8 TESTS 20 108 0 1200
59599414 Garett C Aug. 28, 2019, 4:54 a.m. OK Java 8 TESTS 20 108 0 1200
58784776 vvenkai C Aug. 13, 2019, 9:24 p.m. OK Java 8 TESTS 20 108 0 1200
58466913 jenish9599 C Aug. 8, 2019, 7:59 p.m. OK Java 8 TESTS 20 108 0 1200
54744668 paliyastrot C May 28, 2019, 9:54 a.m. OK Java 8 TESTS 20 108 0 1200
50498430 coderbond007 C Feb. 25, 2019, 4:08 p.m. OK Java 8 TESTS 20 108 0 1200
50469295 sweiss C Feb. 24, 2019, 10:24 p.m. OK Java 8 TESTS 20 108 0 1200
50421042 alibaba C Feb. 24, 2019, 9:05 a.m. OK Java 8 TESTS 20 108 0 1200
50478077 Killer45 C Feb. 25, 2019, 7:17 a.m. OK Kotlin TESTS 20 140 614400 1200
65510732 Spheniscine C Nov. 22, 2019, 3:30 a.m. OK Kotlin TESTS 20 155 921600 1200
50408452 Quaternion C Feb. 23, 2019, 11:12 p.m. OK Kotlin TESTS 20 155 1126400 1200
54645973 sys1yagi C May 26, 2019, 12:29 a.m. OK Kotlin TESTS 20 155 1228800 1200
50400071 Arkabekuly_Mukhtar C Feb. 23, 2019, 5:48 p.m. OK Kotlin TESTS 20 156 102400 1200
50869548 ondrej.konecny C March 5, 2019, 11:40 p.m. OK Kotlin TESTS 20 171 102400 1200
59377180 david_varela C Aug. 23, 2019, 11:03 p.m. OK Kotlin TESTS 20 171 1126400 1200
50525898 glider.g C Feb. 26, 2019, 11:45 a.m. OK Kotlin TESTS 20 171 1126400 1200
50461341 treasuryonly C Feb. 24, 2019, 5:51 p.m. OK Mono C# TESTS 20 46 0 1200
50697609 jas2 C March 2, 2019, 6:57 p.m. OK Mono C# TESTS 20 46 0 1200
50389788 SkyStalker C Feb. 23, 2019, 1:33 p.m. OK Mono C# TESTS 20 46 0 1200
51132671 TheRain C March 10, 2019, 2:27 p.m. OK Mono C# TESTS 20 46 0 1200
50602573 lewasupaman SaurumanS LapsleyJuno C Feb. 28, 2019, 1:18 p.m. OK Mono C# TESTS 20 46 0 1200
50535851 TRR C Feb. 26, 2019, 3:39 p.m. OK Mono C# TESTS 20 46 0 1200
50532473 amit1509kumar C Feb. 26, 2019, 2:13 p.m. OK Mono C# TESTS 20 46 0 1200
50473757 xingya C Feb. 25, 2019, 4:02 a.m. OK Mono C# TESTS 20 61 0 1200
53497447 Xtreemist C April 29, 2019, 12:33 p.m. OK Mono C# TESTS 20 61 0 1200
50403021 _SHREDDER_ C Feb. 23, 2019, 7:07 p.m. OK Mono C# TESTS 20 61 3584000 1200
54979315 vjudge3 C June 2, 2019, 12:21 p.m. OK MS C++ TESTS 20 15 0 1200
54445846 sjd0 C May 21, 2019, 11:14 a.m. OK MS C++ TESTS 20 15 0 1200
51114621 vjudge3 C March 10, 2019, 6:23 a.m. OK MS C++ TESTS 20 15 0 1200
50693146 sa.sh C March 2, 2019, 4:38 p.m. OK MS C++ TESTS 20 15 0 1200
50671683 yq0214 C March 2, 2019, 7:19 a.m. OK MS C++ TESTS 20 15 0 1200
50517633 vjudge2 C Feb. 26, 2019, 7:32 a.m. OK MS C++ TESTS 20 15 0 1200
50409329 hd20175916 C Feb. 24, 2019, 12:30 a.m. OK MS C++ TESTS 20 15 0 1200
54979423 vjudge4 C June 2, 2019, 12:24 p.m. OK MS C++ TESTS 20 30 0 1200
57124454 vjudge4 C July 16, 2019, 3:22 a.m. OK MS C++ TESTS 20 30 0 1200
68850333 vjudge3 C Jan. 15, 2020, 8:45 a.m. OK MS C++ TESTS 20 30 0 1200
50411235 2017111799yjl C Feb. 24, 2019, 2:48 a.m. OK MS C++ 2017 TESTS 20 15 0 1200
54559108 hwangganzi C May 24, 2019, 1:05 p.m. OK MS C++ 2017 TESTS 20 30 0 1200
55239337 dragonliulong C June 7, 2019, 10:03 a.m. OK MS C++ 2017 TESTS 20 30 0 1200
50430974 zhu_biaiyi C Feb. 24, 2019, 2:01 p.m. OK MS C++ 2017 TESTS 20 30 0 1200
57351347 vjudge1 C July 20, 2019, 3:46 a.m. OK MS C++ 2017 TESTS 20 30 0 1200
50639853 bbisnouse C March 1, 2019, 1:28 p.m. OK MS C++ 2017 TESTS 20 30 0 1200
56848532 RuicyWu C July 11, 2019, 2:38 p.m. OK MS C++ 2017 TESTS 20 30 0 1200
50385178 Salma_11 C Feb. 23, 2019, 12:16 p.m. OK MS C++ 2017 TESTS 20 30 0 1200
50697915 mech C March 2, 2019, 7:05 p.m. OK MS C++ 2017 TESTS 20 30 0 1200
53992117 2017ccut_wuqishuo C May 11, 2019, 12:47 p.m. OK MS C++ 2017 TESTS 20 30 0 1200
67683688 stalst C Dec. 27, 2019, 7:47 a.m. OK PascalABC.NET TESTS 20 186 0 1200
50535177 Stanislav666 C Feb. 26, 2019, 3:22 p.m. OK PascalABC.NET TESTS 20 186 0 1200
50896956 fanos C March 6, 2019, 3:32 p.m. OK PascalABC.NET TESTS 20 187 0 1200
51230206 EclipseLizard C March 12, 2019, 3:51 p.m. OK PascalABC.NET TESTS 20 187 0 1200
51651723 GodOfMusic C March 21, 2019, 7:09 p.m. OK PascalABC.NET TESTS 20 202 0 1200
50896678 stanislav1 C March 6, 2019, 3:23 p.m. OK PascalABC.NET TESTS 20 295 0 1200
51305863 mm944 C March 14, 2019, 4:43 p.m. OK PascalABC.NET TESTS 20 296 0 1200
50403575 mayakin C Feb. 23, 2019, 7:22 p.m. OK PHP TESTS 20 46 0 1200
50410099 masonsbro C Feb. 24, 2019, 1:34 a.m. OK PyPy 2 TESTS 20 109 0 1200
50672586 SoSooding C March 2, 2019, 7:47 a.m. OK PyPy 2 TESTS 20 124 0 1200
50502931 GuybrushThreepwood C Feb. 25, 2019, 6:07 p.m. OK PyPy 2 TESTS 20 124 0 1200
50471116 rcpc-master C Feb. 25, 2019, 12:41 a.m. OK PyPy 2 TESTS 20 124 0 1200
56149360 raj1307 C June 27, 2019, 7:35 a.m. OK PyPy 2 TESTS 20 140 1228800 1200
52790594 shehebe C April 15, 2019, 5:08 p.m. OK PyPy 2 TESTS 20 140 1228800 1200
50389588 gatsko C Feb. 23, 2019, 1:30 p.m. OK PyPy 2 TESTS 20 140 1945600 1200
50775296 thenewguy39 C March 4, 2019, 8:05 a.m. OK PyPy 2 TESTS 20 171 0 1200
50522070 ElRusso C Feb. 26, 2019, 9:54 a.m. OK PyPy 3 TESTS 20 124 0 1200
60644540 SeVaGL C Sept. 15, 2019, 4:37 p.m. OK PyPy 3 TESTS 20 124 0 1200
52275297 Zhenya15072003 C April 3, 2019, 2:32 p.m. OK PyPy 3 TESTS 20 124 0 1200
51387539 KrisAlan C March 16, 2019, 7:42 p.m. OK PyPy 3 TESTS 20 124 0 1200
51097343 hg17june C March 9, 2019, 5:08 p.m. OK PyPy 3 TESTS 20 124 0 1200
51011533 surajsirvi88 C March 8, 2019, 9:41 a.m. OK PyPy 3 TESTS 20 124 0 1200
50928877 GangizzKhan C March 7, 2019, 1:04 p.m. OK PyPy 3 TESTS 20 124 0 1200
50738390 WNDL C March 3, 2019, 2:01 p.m. OK PyPy 3 TESTS 20 124 0 1200
50683353 flameofpassion C March 2, 2019, 12:32 p.m. OK PyPy 3 TESTS 20 124 0 1200
50472195 bandi.enkh C Feb. 25, 2019, 2:16 a.m. OK PyPy 3 TESTS 20 124 0 1200
50518830 nealzane C Feb. 26, 2019, 8:13 a.m. OK Python 2 TESTS 20 155 0 1200
52253717 harshsodi C April 3, 2019, 3:29 a.m. OK Python 2 TESTS 20 170 0 1200
52221675 aniket11 C April 2, 2019, 6:58 a.m. OK Python 2 TESTS 20 170 0 1200
50428528 b8810850 C Feb. 24, 2019, 12:49 p.m. OK Python 2 TESTS 20 170 0 1200
60360911 pktyagi1 C Sept. 10, 2019, 6:13 p.m. OK Python 2 TESTS 20 171 0 1200
54283513 soumyasarkar1998 C May 17, 2019, 2:39 p.m. OK Python 2 TESTS 20 171 0 1200
53053827 kaif_7 C April 20, 2019, 4:06 p.m. OK Python 2 TESTS 20 171 0 1200
55672313 shubhankarsharma00 C June 17, 2019, 8:22 a.m. OK Python 2 TESTS 20 186 0 1200
51897542 COFEEBrian C March 27, 2019, 12:15 p.m. OK Python 3 TESTS 20 93 0 1200
50776293 morriship C March 4, 2019, 8:42 a.m. OK Python 3 TESTS 20 93 0 1200
50635037 HatsuneMikuo C March 1, 2019, 11:21 a.m. OK Python 3 TESTS 20 93 0 1200
50491417 tt1724369779 C Feb. 25, 2019, 1:27 p.m. OK Python 3 TESTS 20 93 0 1200
50391459 tusharj045 C Feb. 23, 2019, 2:04 p.m. OK Python 3 TESTS 20 93 0 1200
50387580 ahmhekal C Feb. 23, 2019, 1:02 p.m. OK Python 3 TESTS 20 93 0 1200
53740537 ahManoTravei C May 4, 2019, 1:33 p.m. OK Python 3 TESTS 20 108 0 1200
52527858 pushforward C April 9, 2019, 12:15 p.m. OK Python 3 TESTS 20 108 0 1200
52521769 _Hibou_ C April 9, 2019, 9:09 a.m. OK Python 3 TESTS 20 108 0 1200
51609537 kabeer27 C March 21, 2019, 9:29 a.m. OK Python 3 TESTS 20 108 0 1200
50381786 danchu C Feb. 23, 2019, 12:01 p.m. OK Ruby TESTS 20 77 0 1200
50983971 kafun C March 7, 2019, 6:46 p.m. OK Rust TESTS 20 30 0 1200
50383560 yakamoto C Feb. 23, 2019, 12:09 p.m. OK Scala TESTS 20 467 0 1200

remove filters

Back to search problems