Codeforces Round 542 [Alex Lopashev Thanks-Round] (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
1129 Codeforces Round 542 [Alex Lopashev Thanks-Round] (Div. 1) FINISHED False 7200 186157463 Feb. 24, 2019, 3:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4116 ) A2 Toy Train PROGRAMMING brute force greedy 1800

B'Alice received a set of Toy Train xe2 x84 xa2 from Bob. It consists of one train and a connected railway network of n stations, enumerated from 1 through n . The train occupies one station at a time and travels around the network of stations in a circular manner. More precisely, the immediate station that the train will visit after station i is station i+1 if 1 <= q i < n or station 1 if i = n . It takes the train 1 second to travel to its next station as described. Bob gave Alice a fun task before he left: to deliver m candies that are initially at some stations to their independent destinations using the train. The candies are enumerated from 1 through m . Candy i ( 1 <= q i <= q m ), now at station a_i , should be delivered to station b_i ( a_i neq b_i ). The train has infinite capacity, and it is possible to load off any number of candies at a station. However, only at most one candy can be loaded from a station onto the train before it leaves the station. You can choose any candy at this station. The time it takes to move the candies is negligible. Now, Alice wonders how much time is needed for the train to deliver all candies. Your task is to find, for each station, the minimum time the train would need to deliver all the candies were it to start from there. The first line contains two space-separated integers n and m ( 2 <= q n <= q 5 ,000 ; 1 <= q m <= q 20 ,000 ) -- the number of stations and the number of candies, respectively. The i -th of the following m lines contains two space-separated integers a_i and b_i ( 1 <= q a_i, b_i <= q n ; a_i neq b_i ) -- the station that initially contains candy i and the destination station of the candy, respectively. In the first and only line, print n space-separated integers, the i -th of which is the minimum time, in seconds, the train would need to de'...

Tutorials

65520

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
51759271 rr_ A2 March 23, 2019, 1 p.m. OK D TESTS 100 156 4198400 1800
50442772 hos.lyric A2 Feb. 24, 2019, 4 p.m. OK D TESTS 50 171 4198400 1800
50553299 CLF A2 Feb. 27, 2019, 6:21 a.m. OK GNU C11 TESTS 100 93 0 1800
50467096 sansen A2 Feb. 24, 2019, 8:32 p.m. OK GNU C11 TESTS 50 156 0 1800
50441700 rainboy A2 Feb. 24, 2019, 3:57 p.m. OK GNU C11 TESTS 50 217 0 1800
50493716 Aviously A2 Feb. 25, 2019, 2:18 p.m. OK GNU C++11 TESTS 50 31 204800 1800
60372331 HyscereXD A2 Sept. 11, 2019, 3:22 a.m. OK GNU C++11 TESTS 100 31 307200 1800
51939863 krijgertje A2 March 28, 2019, 2:01 p.m. OK GNU C++11 TESTS 100 31 409600 1800
51154183 xuziling A2 March 11, 2019, 9:40 a.m. OK GNU C++11 TESTS 100 31 409600 1800
50550545 _ShadowSong A2 Feb. 27, 2019, 3:43 a.m. OK GNU C++11 TESTS 100 31 512000 1800
50568909 DoanPhuDuc A2 Feb. 27, 2019, 2:25 p.m. OK GNU C++11 TESTS 100 31 2048000 1800
52519185 JSK_Darko A2 April 9, 2019, 7:41 a.m. OK GNU C++11 TESTS 100 31 2252800 1800
50676895 duhao110101 A2 March 2, 2019, 9:38 a.m. OK GNU C++11 TESTS 100 31 2252800 1800
53306164 vjudge3 A2 April 26, 2019, 3:17 a.m. OK GNU C++11 TESTS 100 31 2252800 1800
51827569 searchstar A2 March 25, 2019, 2:39 p.m. OK GNU C++11 TESTS 100 46 0 1800
50512553 ZhihuiLiu A2 Feb. 26, 2019, 2:50 a.m. OK GNU C++14 TESTS 50 31 102400 1800
53567927 nikolapesic2802 A2 April 30, 2019, 1:30 p.m. OK GNU C++14 TESTS 100 31 102400 1800
50485444 lucaperju A2 Feb. 25, 2019, 11:19 a.m. OK GNU C++14 TESTS 50 31 409600 1800
50439126 nhho A2 Feb. 24, 2019, 3:49 p.m. OK GNU C++14 TESTS 50 31 512000 1800
50453084 sqrtdecompton A2 Feb. 24, 2019, 4:50 p.m. OK GNU C++14 TESTS 50 31 512000 1800
63706773 hitonanode A2 Oct. 29, 2019, 8:40 a.m. OK GNU C++14 TESTS 100 31 512000 1800
50443015 lucaperju A2 Feb. 24, 2019, 4:01 p.m. OK GNU C++14 TESTS 50 31 716800 1800
50448322 Diuven A2 Feb. 24, 2019, 4:24 p.m. OK GNU C++14 TESTS 50 31 1024000 1800
50605627 iaNTU A2 Feb. 28, 2019, 2:25 p.m. OK GNU C++14 TESTS 100 31 3584000 1800
50620539 shdut A2 March 1, 2019, 12:43 a.m. OK GNU C++14 TESTS 100 31 4812800 1800
51650694 mgoncharov A2 March 21, 2019, 6:42 p.m. OK GNU C++17 TESTS 100 31 102400 1800
50778781 2bcn A2 March 4, 2019, 10:13 a.m. OK GNU C++17 TESTS 100 31 102400 1800
50470289 Dup4 A2 Feb. 24, 2019, 11:35 p.m. OK GNU C++17 TESTS 50 31 204800 1800
50902109 .tx A2 March 6, 2019, 5:56 p.m. OK GNU C++17 TESTS 100 31 409600 1800
50594653 bigbigbigcat111 A2 Feb. 28, 2019, 9:28 a.m. OK GNU C++17 TESTS 100 31 409600 1800
50466852 vstrimaitis A2 Feb. 24, 2019, 8:23 p.m. OK GNU C++17 TESTS 50 31 512000 1800
64534893 Akulyat A2 Nov. 8, 2019, 4:39 p.m. OK GNU C++17 TESTS 100 31 1433600 1800
50464654 rui-de A2 Feb. 24, 2019, 7:14 p.m. OK GNU C++17 TESTS 50 31 2764800 1800
50490356 bitetheDDDDt A2 Feb. 25, 2019, 1:06 p.m. OK GNU C++17 TESTS 50 46 0 1800
50572308 klimmek55 A2 Feb. 27, 2019, 4:05 p.m. OK GNU C++17 TESTS 100 46 0 1800
52356016 cylixstar A2 April 5, 2019, 4:52 p.m. OK Haskell TESTS 100 62 4300800 1800
50443511 Musin A2 Feb. 24, 2019, 4:03 p.m. OK Java 8 TESTS 50 124 0 1800
52544931 beroul A2 April 9, 2019, 8:33 p.m. OK Java 8 TESTS 100 140 0 1800
50446726 Dukkha A2 Feb. 24, 2019, 4:16 p.m. OK Java 8 TESTS 50 186 0 1800
51897063 dtsarun A2 March 27, 2019, 12:02 p.m. OK Java 8 TESTS 100 218 0 1800
50984216 Xylenox A2 March 7, 2019, 6:52 p.m. OK Java 8 TESTS 100 218 0 1800
50518614 mikkk A2 Feb. 26, 2019, 8:05 a.m. OK Java 8 TESTS 50 218 0 1800
50463958 Suunn A2 Feb. 24, 2019, 6:58 p.m. OK Java 8 TESTS 50 218 0 1800
51256966 CrazyFlower A2 March 13, 2019, 11:43 a.m. OK Java 8 TESTS 100 233 0 1800
50489379 PrakharJain A2 Feb. 25, 2019, 12:48 p.m. OK Java 8 TESTS 50 233 0 1800
50438095 ilyakor A2 Feb. 24, 2019, 3:46 p.m. OK Java 8 TESTS 50 234 0 1800
50450864 riantkb A2 Feb. 24, 2019, 4:37 p.m. OK Mono C# TESTS 50 312 3276800 1800
51402550 vjudge4 A2 March 17, 2019, 8:10 a.m. OK MS C++ TESTS 100 46 102400 1800
64145198 TianPingXing A2 Nov. 3, 2019, 9:38 a.m. OK MS C++ TESTS 100 62 0 1800
64069685 1912607519 A2 Nov. 2, 2019, 6:59 a.m. OK MS C++ TESTS 100 78 102400 1800
64069941 1912607519 A2 Nov. 2, 2019, 7:04 a.m. OK MS C++ TESTS 100 78 102400 1800
51001590 LoneFox A2 March 8, 2019, 7:01 a.m. OK MS C++ TESTS 100 93 102400 1800
50521203 XRDS-BJFU101 A2 Feb. 26, 2019, 9:29 a.m. OK MS C++ TESTS 50 108 102400 1800
61979402 vjudge1 A2 Oct. 6, 2019, 11:31 a.m. OK MS C++ TESTS 100 109 0 1800
62013027 vjudge3 A2 Oct. 6, 2019, 3:54 p.m. OK MS C++ TESTS 100 109 204800 1800
64070380 1912607519 A2 Nov. 2, 2019, 7:12 a.m. OK MS C++ TESTS 100 124 0 1800
64078543 TianSunXing A2 Nov. 2, 2019, 9:27 a.m. OK MS C++ TESTS 100 171 102400 1800
64097781 TianJianXing A2 Nov. 2, 2019, 2:27 p.m. OK MS C++ 2017 TESTS 100 62 0 1800
50441522 vpike A2 Feb. 24, 2019, 3:56 p.m. OK MS C++ 2017 TESTS 50 93 307200 1800
50464821 xtalclr A2 Feb. 24, 2019, 7:18 p.m. OK MS C++ 2017 TESTS 50 109 0 1800
56034331 0-jij-0 A2 June 25, 2019, 11:19 a.m. OK MS C++ 2017 TESTS 100 124 102400 1800
60913258 vjudge4 A2 Sept. 20, 2019, 6:56 a.m. OK MS C++ 2017 TESTS 100 124 102400 1800
55543848 BessieTheCow A2 June 13, 2019, 10:57 p.m. OK MS C++ 2017 TESTS 100 124 102400 1800
50581344 petko_mitkov A2 Feb. 27, 2019, 9:45 p.m. OK MS C++ 2017 TESTS 100 124 102400 1800
58996744 jjang36524 A2 Aug. 18, 2019, 11:45 a.m. OK MS C++ 2017 TESTS 100 140 307200 1800
50876326 victorhu3 A2 March 6, 2019, 6:26 a.m. OK MS C++ 2017 TESTS 100 140 409600 1800
50440853 aeremin A2 Feb. 24, 2019, 3:54 p.m. OK MS C++ 2017 TESTS 50 467 512000 1800
50558446 Stanislav666 A2 Feb. 27, 2019, 9:25 a.m. OK PascalABC.NET TESTS 100 1482 512000 1800
50520297 mayakin A2 Feb. 26, 2019, 9:01 a.m. OK PHP TESTS 50 77 4198400 1800
50462720 pajenegod A2 Feb. 24, 2019, 6:39 p.m. OK PyPy 2 TESTS 50 186 4710400 1800
50671467 SoSooding A2 March 2, 2019, 7:13 a.m. OK PyPy 2 TESTS 100 483 3379200 1800
50510396 c1729 A2 Feb. 25, 2019, 11:30 p.m. OK PyPy 2 TESTS 50 826 2662400 1800
50438137 --d A2 Feb. 24, 2019, 3:46 p.m. OK PyPy 3 TESTS 50 342 3072000 1800
50741050 sdhd A2 March 3, 2019, 3:29 p.m. OK PyPy 3 TESTS 100 561 5529600 1800
50439842 algmyr A2 Feb. 24, 2019, 3:51 p.m. OK PyPy 3 TESTS 50 982 5632000 1800
50465863 Nika86 A2 Feb. 24, 2019, 7:47 p.m. OK Python 2 TESTS 50 234 921600 1800
50452242 whatshisbucket A2 Feb. 24, 2019, 4:45 p.m. OK Python 3 TESTS 50 155 1228800 1800
51234506 romanysik A2 March 12, 2019, 5:54 p.m. OK Python 3 TESTS 100 186 1638400 1800

remove filters

Back to search problems