Codeforces Round 523 (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
1061 Codeforces Round 523 (Div. 2) FINISHED False 7200 194624124 Nov. 22, 2018, 3:45 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2394 ) D TV Shows PROGRAMMING data structures greedy implementation sortings 2000

B'There are n TV shows you want to watch. Suppose the whole time is split into equal parts called "minutes". The i -th of the shows is going from l_i -th to r_i -th minute, both ends inclusive. You need a TV to watch a TV show and you can 't watch two TV shows which air at the same time on the same TV, so it is possible you will need multiple TVs in some minutes. For example, if segments [l_i, r_i] and [l_j, r_j] intersect, then shows i and j can 't be watched simultaneously on one TV. Once you start watching a show on some TV it is not possible to "move" it to another TV (since it would be too distracting), or to watch another show on the same TV until this show ends. There is a TV Rental shop near you. It rents a TV for x rupees, and charges y ( y < x ) rupees for every extra minute you keep the TV. So in order to rent a TV for minutes [a; b] you will need to pay x + y cdot (b - a) . You can assume, that taking and returning of the TV doesn 't take any time and doesn 't distract from watching other TV shows. Find the minimum possible cost to view all shows. Since this value could be too large, print it modulo 10^9 + 7 . The first line contains integers n , x and y ( 1 <= n <= 10^5 , 1 <= y < x <= 10^9 ) -- the number of TV shows, the cost to rent a TV for the first minute and the cost to rent a TV for every subsequent minute. Each of the next n lines contains two integers l_i and r_i ( 1 <= l_i <= r_i <= 10^9 ) denoting the start and the end minute of the i -th TV show. Print exactly one integer -- the minimum cost to view all the shows taken modulo 10^9 + 7 . In the first example, the optimal strategy would be to rent 3 TVs to watch: This way the cost for the first TV is 4 + 3 cdot (2 - 1) = 7 , for the second is 4 + 3 cdot (10 - 4) = 22 and for the third is 4 + 3 cdot (11 - 2) = 31 , whic'...

Tutorials

Tutorial (en)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
46108944 Rajib_119 D Nov. 23, 2018, 11:09 a.m. OK GNU C++11 TESTS 75 46 2560000 2000
55983905 luogu_bot3 D June 24, 2019, 1:03 a.m. OK GNU C++11 TESTS 75 46 3481600 2000
46118211 menjiantong D Nov. 23, 2018, 2:55 p.m. OK GNU C++11 TESTS 75 46 3481600 2000
46125378 Riqirez D Nov. 23, 2018, 6:45 p.m. OK GNU C++11 TESTS 75 46 3584000 2000
47862961 _zay D Jan. 3, 2019, 7:37 a.m. OK GNU C++11 TESTS 75 46 4812800 2000
46095104 Diego1149 D Nov. 22, 2018, 10:54 p.m. OK GNU C++11 TESTS 75 61 1638400 2000
60071789 1910903 D Sept. 5, 2019, 11:22 a.m. OK GNU C++11 TESTS 75 61 4096000 2000
46088300 LuckyAurora D Nov. 22, 2018, 5:44 p.m. OK GNU C++11 TESTS 75 61 10649600 2000
46135195 frodakcin D Nov. 24, 2018, 5:19 a.m. OK GNU C++11 TESTS 75 62 1843200 2000
46134726 chrt D Nov. 24, 2018, 4:55 a.m. OK GNU C++11 TESTS 75 62 2048000 2000
46078505 wleung_bvg D Nov. 22, 2018, 4:44 p.m. OK GNU C++14 TESTS 75 61 2150400 2000
62953065 tokitsukaze D Oct. 19, 2019, 7:26 p.m. OK GNU C++14 TESTS 75 62 4300800 2000
46107781 Vendetta. D Nov. 23, 2018, 10:27 a.m. OK GNU C++14 TESTS 75 77 2150400 2000
47892627 joseraul D Jan. 4, 2019, 7:54 a.m. OK GNU C++14 TESTS 75 77 4300800 2000
46091055 De.Wilde D Nov. 22, 2018, 7:32 p.m. OK GNU C++14 TESTS 75 77 4812800 2000
46083490 Ace_02 D Nov. 22, 2018, 5:16 p.m. OK GNU C++14 TESTS 75 78 1638400 2000
46110322 Vendetta. D Nov. 23, 2018, 11:52 a.m. OK GNU C++14 TESTS 75 78 2150400 2000
46082194 enochjung D Nov. 22, 2018, 5:07 p.m. OK GNU C++14 TESTS 75 78 2150400 2000
46544307 minson123 D Dec. 3, 2018, 1:45 p.m. OK GNU C++14 TESTS 75 78 2355200 2000
46113993 alwys_kush D Nov. 23, 2018, 1:06 p.m. OK GNU C++14 TESTS 75 78 2355200 2000
46083275 not_antony D Nov. 22, 2018, 5:15 p.m. OK GNU C++17 TESTS 75 62 2969600 2000
46098532 endereye D Nov. 23, 2018, 3:17 a.m. OK GNU C++17 TESTS 75 77 2969600 2000
46118449 201612201402013 D Nov. 23, 2018, 3:02 p.m. OK GNU C++17 TESTS 75 78 1433600 2000
55210061 RCG D June 6, 2019, 2:14 p.m. OK GNU C++17 TESTS 75 78 1638400 2000
53799090 Lucina D May 5, 2019, 5:14 p.m. OK GNU C++17 TESTS 75 78 1843200 2000
46101120 qhqh D Nov. 23, 2018, 5:54 a.m. OK GNU C++17 TESTS 75 78 1843200 2000
46126337 alexradu04 D Nov. 23, 2018, 7:25 p.m. OK GNU C++17 TESTS 75 78 2252800 2000
46094867 mihelifi D Nov. 22, 2018, 10:30 p.m. OK GNU C++17 TESTS 75 78 2662400 2000
46081221 train_driver D Nov. 22, 2018, 5:01 p.m. OK GNU C++17 TESTS 75 78 3481600 2000
46079052 Omar_Elawady D Nov. 22, 2018, 4:48 p.m. OK GNU C++17 TESTS 75 78 3584000 2000
46079759 Martynas D Nov. 22, 2018, 4:52 p.m. OK Go TESTS 75 218 4505600 2000
46105472 wolfib D Nov. 23, 2018, 8:52 a.m. OK Java 8 TESTS 75 186 0 2000
46076321 uwi D Nov. 22, 2018, 4:32 p.m. OK Java 8 TESTS 75 202 0 2000
46099319 BaZ_ D Nov. 23, 2018, 4:14 a.m. OK Java 8 TESTS 75 217 0 2000
48086162 amolpratap007 D Jan. 8, 2019, 11:27 a.m. OK Java 8 TESTS 75 218 0 2000
46099392 llamaoo7 D Nov. 23, 2018, 4:20 a.m. OK Java 8 TESTS 75 218 0 2000
47893218 donli D Jan. 4, 2019, 8:23 a.m. OK Java 8 TESTS 75 233 0 2000
46081723 IDzekh D Nov. 22, 2018, 5:04 p.m. OK Java 8 TESTS 75 234 4096000 2000
46582169 AJ47 D Dec. 4, 2018, 11:41 a.m. OK Java 8 TESTS 75 249 0 2000
46098330 megaspazz D Nov. 23, 2018, 3:04 a.m. OK Java 8 TESTS 75 249 4608000 2000
46083973 aabdelzaher D Nov. 22, 2018, 5:19 p.m. OK Java 8 TESTS 75 249 5427200 2000
46082116 shaviava D Nov. 22, 2018, 5:07 p.m. OK Kotlin TESTS 75 452 32358400 2000
46098880 Zvigintsev D Nov. 23, 2018, 3:42 a.m. OK Mono C# TESTS 75 171 10956800 2000
48407231 eki D Jan. 15, 2019, 5:01 a.m. OK Mono C# TESTS 75 233 11673600 2000
46199018 omikad D Nov. 25, 2018, 10:11 a.m. OK Mono C# TESTS 75 280 29388800 2000
46081261 peregrinus D Nov. 22, 2018, 5:01 p.m. OK Mono C# TESTS 75 358 91033600 2000
46085582 olpetOdessaONU D Nov. 22, 2018, 5:30 p.m. OK MS C++ TESTS 75 62 2867200 2000
48666019 vjudge1 D Jan. 21, 2019, 8:11 a.m. OK MS C++ TESTS 75 78 3993600 2000
48678043 vjudge5 D Jan. 21, 2019, 12:19 p.m. OK MS C++ TESTS 75 93 3993600 2000
46084380 Corvus D Nov. 22, 2018, 5:22 p.m. OK MS C++ TESTS 75 93 3993600 2000
48666888 vjudge4 D Jan. 21, 2019, 8:35 a.m. OK MS C++ TESTS 75 93 5734400 2000
56752387 vjudge4 D July 9, 2019, 12:27 p.m. OK MS C++ TESTS 75 93 5734400 2000
48665963 vjudge5 D Jan. 21, 2019, 8:10 a.m. OK MS C++ TESTS 75 109 4812800 2000
48677773 vjudge4 D Jan. 21, 2019, 12:13 p.m. OK MS C++ TESTS 75 124 6451200 2000
62992223 vjudge1 D Oct. 20, 2019, 9:47 a.m. OK MS C++ TESTS 75 155 10547200 2000
46536053 kou1 D Dec. 3, 2018, 9:04 a.m. OK MS C++ TESTS 75 155 10547200 2000
51288857 AleksanderBalobanov D March 14, 2019, 8:58 a.m. OK MS C++ 2017 TESTS 75 93 3276800 2000
46195363 c1729 D Nov. 25, 2018, 8:01 a.m. OK PyPy 2 TESTS 75 296 14643200 2000
46104201 yakamoto D Nov. 23, 2018, 8:08 a.m. OK Scala TESTS 75 935 0 2000

remove filters

Back to search problems