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 186521987 Feb. 23, 2019, 10:20 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 6846 ) F Asya And Kittens PROGRAMMING constructive algorithms ds 1700

B"Asya loves animals very much. Recently, she purchased n kittens, enumerated them from 1 and n and then put them into the cage. The cage consists of one row of n cells, enumerated with integers from 1 to n from left to right. Adjacent cells had a partially transparent partition wall between them, hence there were n - 1 partitions originally. Initially, each cell contained exactly one kitten with some number. Observing the kittens, Asya noticed, that they are very friendly and often a pair of kittens in neighboring cells wants to play together. So Asya started to remove partitions between neighboring cells. In particular, on the day i , Asya: Since Asya has never putted partitions back, after n - 1 days the cage contained a single cell, having all kittens. For every day, Asya remembers numbers of kittens x_i and y_i , who wanted to play together, however she doesn't remember how she placed kittens in the cage in the beginning. Please help her and find any possible initial arrangement of the kittens into n cells. The first line contains a single integer n ( 2 <= n <= 150 ,000 ) -- the number of kittens. Each of the following n - 1 lines contains integers x_i and y_i ( 1 <= x_i, y_i <= n , x_i ne y_i ) -- indices of kittens, which got together due to the border removal on the corresponding day. It's guaranteed, that the kittens x_i and y_i were in the different cells before this day. For every cell from 1 to n print a single integer -- the index of the kitten from 1 to n , who was originally in it. All printed integers must be distinct. It's guaranteed, that there is at least one answer possible. In case there are multiple possible answers, print any of them. The answer for the example contains one of several possible initial arrangements of the kittens. The picture below shows how the cells were united for th"...

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
51136551 Mint_Dentifrice F March 10, 2019, 4:25 p.m. OK FPC TESTS 52 530 1843200 1700
50472649 2683331518 F Feb. 25, 2019, 2:51 a.m. OK GNU C++11 TESTS 52 46 2048000 1700
50623868 Zechariah_2001 F March 1, 2019, 4:25 a.m. OK GNU C++11 TESTS 52 46 3584000 1700
50391846 Zechariah_2001 F Feb. 23, 2019, 2:13 p.m. OK GNU C++11 TESTS 52 46 3584000 1700
50389126 Peter_Matthew F Feb. 23, 2019, 1:22 p.m. OK GNU C++11 TESTS 51 46 7168000 1700
50384206 ultoxtung F Feb. 23, 2019, 12:12 p.m. OK GNU C++11 TESTS 51 62 1843200 1700
50692553 EncodeTalker F March 2, 2019, 4:23 p.m. OK GNU C++11 TESTS 52 62 3276800 1700
50387775 Zechariah_2001 F Feb. 23, 2019, 1:04 p.m. OK GNU C++11 TESTS 51 62 3584000 1700
50469918 GCCCCCCC F Feb. 24, 2019, 11:07 p.m. OK GNU C++11 TESTS 52 62 3788800 1700
51163452 _23333 F March 11, 2019, 1:22 p.m. OK GNU C++11 TESTS 52 62 4096000 1700
51294784 liu_zhan F March 14, 2019, 12:02 p.m. OK GNU C++11 TESTS 52 62 6041600 1700
50663809 HatsuneMikuo F March 2, 2019, 2:15 a.m. OK GNU C++14 TESTS 52 62 11776000 1700
50663804 interestingLSY F March 2, 2019, 2:14 a.m. OK GNU C++14 TESTS 52 78 11776000 1700
50490218 Tommy_Vercetti F Feb. 25, 2019, 1:04 p.m. OK GNU C++14 TESTS 52 93 4403200 1700
50678353 sewage F March 2, 2019, 10:21 a.m. OK GNU C++14 TESTS 52 109 1843200 1700
50476698 Salix F Feb. 25, 2019, 6:27 a.m. OK GNU C++14 TESTS 52 109 1843200 1700
50398427 Jayson_jun F Feb. 23, 2019, 5:01 p.m. OK GNU C++14 TESTS 52 109 1843200 1700
59991689 tingyu F Sept. 4, 2019, 9:35 a.m. OK GNU C++14 TESTS 52 109 2355200 1700
50483809 StupidTurtle F Feb. 25, 2019, 10:32 a.m. OK GNU C++14 TESTS 52 109 2355200 1700
51248005 ArcherYH F March 13, 2019, 6:41 a.m. OK GNU C++14 TESTS 52 109 2457600 1700
51089729 TShT F March 9, 2019, 2:09 p.m. OK GNU C++14 TESTS 52 109 2457600 1700
50396391 cookiedoth F Feb. 23, 2019, 4:04 p.m. OK GNU C++17 TESTS 52 46 3993600 1700
50396333 cookiedoth F Feb. 23, 2019, 4:03 p.m. OK GNU C++17 TESTS 52 46 5222400 1700
50396150 cookiedoth F Feb. 23, 2019, 3:59 p.m. OK GNU C++17 TESTS 52 62 6041600 1700
50702599 .tx F March 2, 2019, 11:41 p.m. OK GNU C++17 TESTS 52 62 13824000 1700
50411022 Sheryang F Feb. 24, 2019, 2:37 a.m. OK GNU C++17 TESTS 52 93 30003200 1700
51371299 2465806616 F March 16, 2019, 12:03 p.m. OK GNU C++17 TESTS 52 108 2969600 1700
50421528 Time_lord F Feb. 24, 2019, 9:19 a.m. OK GNU C++17 TESTS 52 108 7782400 1700
69550253 Rahul_cpp F Jan. 26, 2020, 6:05 a.m. OK GNU C++17 TESTS 52 109 1843200 1700
67442744 Cloud_ F Dec. 22, 2019, 8:10 p.m. OK GNU C++17 TESTS 52 109 1843200 1700
50478493 vjudge3 F Feb. 25, 2019, 7:34 a.m. OK GNU C++17 TESTS 52 109 1843200 1700
50392817 dai F Feb. 23, 2019, 2:35 p.m. OK Go TESTS 52 264 26112000 1700
50392672 dai F Feb. 23, 2019, 2:32 p.m. OK Go TESTS 52 733 26112000 1700
50389741 Pradyumn.Agrawal F Feb. 23, 2019, 1:32 p.m. OK Java 8 TESTS 51 140 0 1700
50499580 coderbond007 F Feb. 25, 2019, 4:39 p.m. OK Java 8 TESTS 52 155 0 1700
50407190 Ziklon F Feb. 23, 2019, 9:49 p.m. OK Java 8 TESTS 52 155 0 1700
50407157 Ziklon F Feb. 23, 2019, 9:46 p.m. OK Java 8 TESTS 52 155 0 1700
50387438 iceburst F Feb. 23, 2019, 1:01 p.m. OK Java 8 TESTS 51 170 0 1700
54849812 thisbeit F May 30, 2019, 3:57 p.m. OK Java 8 TESTS 52 171 0 1700
50389289 mTvTm F Feb. 23, 2019, 1:25 p.m. OK Java 8 TESTS 51 171 0 1700
57936896 7dan F July 29, 2019, 11:07 a.m. OK Java 8 TESTS 52 202 0 1700
50531338 rookie19 F Feb. 26, 2019, 1:46 p.m. OK Java 8 TESTS 52 202 1740800 1700
54237667 hj5657 F May 16, 2019, 11:32 a.m. OK Java 8 TESTS 52 217 0 1700
65511341 Spheniscine F Nov. 22, 2019, 4:02 a.m. OK Kotlin TESTS 52 342 16998400 1700
59846957 og.kostya F Sept. 1, 2019, 9:53 a.m. OK Mono C# TESTS 52 124 8806400 1700
52633873 eki F April 12, 2019, 8:49 a.m. OK Mono C# TESTS 52 202 11878400 1700
54820684 camypaper F May 30, 2019, 2:18 a.m. OK Mono C# TESTS 52 218 23244800 1700
50755480 claw88 F March 3, 2019, 5:16 p.m. OK Mono C# TESTS 52 248 22220800 1700
53826778 toysheeyeyraku F May 6, 2019, 4:40 p.m. OK Mono C# TESTS 52 717 24166400 1700
53893497 vjudge3 F May 9, 2019, 3:19 a.m. OK MS C++ TESTS 52 93 1843200 1700
51413702 vjudge2 F March 17, 2019, 1:07 p.m. OK MS C++ TESTS 52 109 2969600 1700
51222427 R99 F March 12, 2019, 12:56 p.m. OK MS C++ TESTS 52 109 3584000 1700
50519153 hnust_jiangcong F Feb. 26, 2019, 8:24 a.m. OK MS C++ TESTS 52 124 5632000 1700
51402600 vjudge1 F March 17, 2019, 8:11 a.m. OK MS C++ TESTS 52 124 5734400 1700
50519363 hnust_jiangcong F Feb. 26, 2019, 8:31 a.m. OK MS C++ TESTS 52 124 5734400 1700
50580339 NuM F Feb. 27, 2019, 8:51 p.m. OK MS C++ TESTS 52 124 16588800 1700
53278095 vjudge1 F April 25, 2019, 10:38 a.m. OK MS C++ TESTS 52 124 33996800 1700
61766996 vjudge4 F Oct. 3, 2019, 8:56 a.m. OK MS C++ TESTS 52 155 16179200 1700
51479106 vjudge4 F March 19, 2019, 10:44 a.m. OK MS C++ TESTS 52 202 24166400 1700
54655271 hwangganzi F May 26, 2019, 7:58 a.m. OK MS C++ 2017 TESTS 52 124 5222400 1700
50489036 2017111799yjl F Feb. 25, 2019, 12:42 p.m. OK MS C++ 2017 TESTS 52 155 4505600 1700
62250969 shebao F Oct. 10, 2019, 9:15 a.m. OK MS C++ 2017 TESTS 52 155 5017600 1700
62250628 shebao F Oct. 10, 2019, 9:09 a.m. OK MS C++ 2017 TESTS 52 155 5017600 1700
50892301 bbisnouse F March 6, 2019, 1:38 p.m. OK MS C++ 2017 TESTS 52 156 2457600 1700
58192291 pmitkov F Aug. 2, 2019, 8:26 p.m. OK MS C++ 2017 TESTS 52 187 10547200 1700
55085883 Still_Theory F June 4, 2019, 12:34 p.m. OK MS C++ 2017 TESTS 52 343 6348800 1700
50741184 sdhd F March 3, 2019, 3:34 p.m. OK MS C++ 2017 TESTS 52 343 15872000 1700
50384414 TrickmanOff F Feb. 23, 2019, 12:13 p.m. OK MS C++ 2017 TESTS 51 373 4915200 1700
66971208 vjudge4 F Dec. 15, 2019, 1:15 p.m. OK MS C++ 2017 TESTS 52 374 2662400 1700
50397218 Mukundan314 F Feb. 23, 2019, 4:28 p.m. OK PyPy 2 TESTS 52 342 26214400 1700
50395826 c1729 F Feb. 23, 2019, 3:51 p.m. OK PyPy 2 TESTS 52 374 26316800 1700
50572105 noob77777 F Feb. 27, 2019, 3:58 p.m. OK PyPy 2 TESTS 52 592 34099200 1700
50572048 noob77777 F Feb. 27, 2019, 3:57 p.m. OK PyPy 2 TESTS 52 623 33280000 1700
61557300 Ceicei F Sept. 30, 2019, 2:26 p.m. OK PyPy 2 TESTS 52 1076 13619200 1700
50422775 gatsko F Feb. 24, 2019, 9:56 a.m. OK PyPy 2 TESTS 52 1076 29798400 1700
50422124 gatsko F Feb. 24, 2019, 9:37 a.m. OK PyPy 2 TESTS 52 1091 29081600 1700
51428707 amr.magdy F March 17, 2019, 9:19 p.m. OK PyPy 2 TESTS 52 1170 32358400 1700
50396594 c1729 F Feb. 23, 2019, 4:10 p.m. OK PyPy 3 TESTS 52 358 40960000 1700
50410636 c1729 F Feb. 24, 2019, 2:12 a.m. OK PyPy 3 TESTS 52 389 40960000 1700
54356084 bkalra92 F May 18, 2019, 5:40 p.m. OK PyPy 3 TESTS 52 561 27955200 1700
50415526 yellowflash F Feb. 24, 2019, 6:19 a.m. OK PyPy 3 TESTS 52 592 33689600 1700
50529356 nethish F Feb. 26, 2019, 1:03 p.m. OK PyPy 3 TESTS 52 592 52019200 1700
57181076 brosucks F July 17, 2019, 7:16 a.m. OK PyPy 3 TESTS 52 624 25804800 1700
50383798 htkb F Feb. 23, 2019, 12:10 p.m. OK PyPy 3 TESTS 51 701 42496000 1700
50554479 satyamcse F Feb. 27, 2019, 7:06 a.m. OK PyPy 3 TESTS 52 764 173465600 1700
60709169 CubeCakes F Sept. 17, 2019, 7:13 a.m. OK PyPy 3 TESTS 52 1388 24883200 1700
50410234 saku7 F Feb. 24, 2019, 1:45 a.m. OK PyPy 3 TESTS 52 1403 34406400 1700
55505996 rainerh F June 12, 2019, 5:55 p.m. OK Python 2 TESTS 52 748 30924800 1700
55250137 vjudge2 F June 7, 2019, 12:23 p.m. OK Python 2 TESTS 52 748 31027200 1700
50388827 c1729 F Feb. 23, 2019, 1:17 p.m. OK Python 2 TESTS 51 1310 29696000 1700
51807112 zhangmnthuime F March 24, 2019, 11:19 p.m. OK Python 2 TESTS 52 1637 104652800 1700
50384645 Tanphi F Feb. 23, 2019, 12:14 p.m. OK Python 3 TESTS 51 763 37171200 1700
50805363 indianfootball F March 5, 2019, 4:56 a.m. OK Python 3 TESTS 52 779 23654400 1700
68450176 Ulys-ses F Jan. 9, 2020, 2:03 p.m. OK Python 3 TESTS 52 841 17100800 1700
50394699 e2346666 F Feb. 23, 2019, 3:23 p.m. OK Python 3 TESTS 52 857 16486400 1700
57136202 Vasiliy_48 F July 16, 2019, 9 a.m. OK Python 3 TESTS 52 935 23552000 1700
68638787 ivan_m_chas F Jan. 12, 2020, 6:49 a.m. OK Python 3 TESTS 52 935 26419200 1700
50382148 shade33 F Feb. 23, 2019, 12:03 p.m. OK Python 3 TESTS 51 951 19558400 1700
50408818 mizukurage F Feb. 23, 2019, 11:41 p.m. OK Python 3 TESTS 52 951 23449600 1700
50579288 kirizhik F Feb. 27, 2019, 7:59 p.m. OK Python 3 TESTS 52 951 23552000 1700
50408850 mizukurage F Feb. 23, 2019, 11:44 p.m. OK Python 3 TESTS 52 951 23552000 1700
50398281 rinzu F Feb. 23, 2019, 4:57 p.m. OK Ruby TESTS 52 654 4300800 1700
50412732 danchu F Feb. 24, 2019, 4:14 a.m. OK Ruby TESTS 52 873 7065600 1700
50387825 arzk F Feb. 23, 2019, 1:04 p.m. OK Ruby TESTS 51 904 54169600 1700
50798973 shivawu F March 4, 2019, 8:55 p.m. OK Rust TESTS 52 139 5836800 1700
50798896 shivawu F March 4, 2019, 8:50 p.m. OK Rust TESTS 52 140 5836800 1700
50816731 pekempey F March 5, 2019, 11:50 a.m. OK Rust TESTS 52 280 7065600 1700

remove filters

Back to search problems