Codeforces Round 545 (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
1137 Codeforces Round 545 (Div. 1) FINISHED False 9000 179787299 March 8, 2019, 9:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 512 ) E Train Car Selection PROGRAMMING data structures greedy 2800

B"Vasya likes to travel by train, but doesn't like when the car he travels in is located in the tail of the train. Vasya gets on the train at the station. The train consists of n cars indexed from 1 to n counting from the locomotive (head of the train). Three types of events occur while the train is moving: At each moment of time we will index the cars from the head of the train, starting from 1 . Note that when adding new cars to the head of the train, the indexing of the old ones may shift. To choose which car to go in, Vasya will use the value A_i for each car (where i is a car index), which is calculated as follows: Vasya hasn't decided yet where he will get on the train and where will get off the train, so after each event of one of the three types he wants to know the least index of the car, such that its value A_i is minimal. Since there is a lot of cars, Vasya asked you to write a program that answers his question. The first line contains two integers n and m ( 1 <= q n <= q 10^9 , 1 <= q m <= q 300 ,000 ), the number of cars in the train at the time of departure from the station and the number of stations, respectively. Next m lines contain the descriptions of events. Each event is one of the following three types: It is guaranteed that at any time the train length does not exceed 10^9 . Also it's guaranteed that the integers A_i will not grow too high. Formally, it's guaranteed that if we sum the largest addition over all events of the 3 -rd type (that is, b + (n - 1) cdot s , where n is the number of cars at that moment) then the acquired sum would be at most 10^{18} . After each of the m queries print two integers: j and A_j -- the number of the car closest to the head of the train, such that its value A_j is minimal, and the value A_j itself. "...

Tutorials

Codeforces Round #545 – Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
52062784 Scut82 E March 31, 2019, 2:55 a.m. OK GNU C++11 TESTS 83 93 0 2800
52467370 LJC00118 E April 7, 2019, 4:27 p.m. OK GNU C++11 TESTS 83 93 7270400 2800
51260336 LJC00118 E March 13, 2019, 1:03 p.m. OK GNU C++11 TESTS 83 93 7270400 2800
51321477 QAQAutoMaton E March 15, 2019, 7:17 a.m. OK GNU C++11 TESTS 83 93 9011200 2800
51296275 Minamoto E March 14, 2019, 12:33 p.m. OK GNU C++11 TESTS 83 93 28569600 2800
59814831 oduesp E Aug. 31, 2019, 2:53 p.m. OK GNU C++11 TESTS 83 108 7270400 2800
51285213 Minamoto E March 14, 2019, 6:51 a.m. OK GNU C++11 TESTS 83 108 28569600 2800
64439186 HiOkami E Nov. 7, 2019, 3:16 a.m. OK GNU C++11 TESTS 83 124 1638400 2800
60348892 HiOkami E Sept. 10, 2019, 1:34 p.m. OK GNU C++11 TESTS 83 124 4812800 2800
51280410 jzqjzq E March 14, 2019, 3:13 a.m. OK GNU C++11 TESTS 83 124 4812800 2800
52001405 q234rty E March 30, 2019, 6:24 a.m. OK GNU C++14 TESTS 83 108 14848000 2800
52001306 q234rty E March 30, 2019, 6:21 a.m. OK GNU C++14 TESTS 83 109 14848000 2800
51191578 bqq E March 11, 2019, 6:07 p.m. OK GNU C++14 TESTS 83 202 4812800 2800
54844770 mobu233 E May 30, 2019, 1:20 p.m. OK GNU C++14 TESTS 83 217 4812800 2800
51162937 zhou888 E March 11, 2019, 1:10 p.m. OK GNU C++14 TESTS 83 217 4812800 2800
51849124 When E March 26, 2019, 6:52 a.m. OK GNU C++14 TESTS 83 217 7270400 2800
51598846 fwat E March 21, 2019, 1:19 a.m. OK GNU C++14 TESTS 83 217 7270400 2800
51166072 zsyzsy E March 11, 2019, 2:20 p.m. OK GNU C++14 TESTS 83 218 4812800 2800
61394480 _DYT E Sept. 28, 2019, 12:59 a.m. OK GNU C++14 TESTS 83 233 4812800 2800
51155944 zjp_shadow E March 11, 2019, 10:43 a.m. OK GNU C++14 TESTS 83 233 4812800 2800
51123587 CMXRYNP E March 10, 2019, 10:33 a.m. OK GNU C++17 TESTS 83 77 14643200 2800
59784542 cjxj233 E Aug. 31, 2019, 5 a.m. OK GNU C++17 TESTS 83 124 24268800 2800
51132453 haj_lemon E March 10, 2019, 2:20 p.m. OK GNU C++17 TESTS 83 202 4812800 2800
51965318 H2SH2SO4O4O4 E March 29, 2019, 9:36 a.m. OK GNU C++17 TESTS 83 217 4812800 2800
51123513 Als123 E March 10, 2019, 10:31 a.m. OK GNU C++17 TESTS 83 218 4812800 2800
59261897 HyscereXD E Aug. 22, 2019, 8:57 a.m. OK GNU C++17 TESTS 83 218 24064000 2800
61964358 vjudge5 E Oct. 6, 2019, 8:25 a.m. OK GNU C++17 TESTS 83 233 4812800 2800
61963926 Lower_Rating E Oct. 6, 2019, 8:18 a.m. OK GNU C++17 TESTS 83 233 4812800 2800
51134500 Eimaen E March 10, 2019, 3:22 p.m. OK GNU C++17 TESTS 83 233 4812800 2800
52891016 gubeiqg E April 17, 2019, 7:52 a.m. OK GNU C++17 TESTS 83 234 4812800 2800
51025103 mmaxio E March 8, 2019, 11:27 a.m. OK Java 8 TESTS 83 202 0 2800
67407333 dalt E Dec. 22, 2019, 6:56 a.m. OK Java 8 TESTS 83 389 53657600 2800
51018934 Petr E March 8, 2019, 10:40 a.m. OK Java 8 TESTS 83 420 14540800 2800
51419771 hld67890 E March 17, 2019, 3:54 p.m. OK MS C++ 2017 TESTS 83 327 7475200 2800

remove filters

Back to search problems