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.
Problems
B'Polycarp plays a computer game in a post-apocalyptic setting. The zombies have taken over the world, and Polycarp with a small team of survivors is defending against hordes trying to invade their base. The zombies are invading for x minutes starting from minute 0 . There are n entrances to the base, and every minute one zombie attempts to enter through every entrance. The survivors can defend the entrances against the zombies. There are two options: If an entrance is defended either or both ways during some minute, no zombie goes through. Every entrance is defended by a single dedicated survivor. The i -th entrance is defended manually from minute l_i until minute r_i , non-inclusive -- [l_i, r_i) . There are k generators that can be used to defend the entrances automatically. Every entrance should be connected to exactly one generator, but a generator can be connected to multiple entrances (or even none of them). Each generator will work for exactly m consecutive minutes. Polycarp can choose when to power on each generator independently of each other, the m minute long interval should be fully inside the [0, x) time interval. Polycarp is a weird gamer. He wants the game to be as difficult as possible for him. So he wants to connect each entrance to a generator and choose the time for each generator in such a way that as many zombies as possible enter the base. Please, help him to achieve that! The first line contains four integers n, k, x and m ( 1 <= k <= n <= 2000 ; 1 <= m <= x <= 10^9 ) -- the number of entrances, the number of generators, the duration of the zombie invasion and the duration of all generators. The i -th of the next n lines contains two integers l_i and r_i ( 0 <= l_i < r_i <= x ) -- the time interval the i -th entrance is defended manually. Print a single integer -- the largest number of zombies that can e'... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
206041497 |
luogu_bot5 |
F |
May 16, 2023, 3:05 a.m. |
OK |
GNU C++14 |
TESTS |
91 |
280 |
144998400 |
|
3200 |
206317279 |
Lasya24 |
F |
May 18, 2023, 9 a.m. |
OK |
GNU C++14 |
TESTS |
91 |
733 |
102400 |
|
3200 |
206043770 |
hemanth746 |
F |
May 16, 2023, 3:56 a.m. |
OK |
GNU C++14 |
TESTS |
91 |
733 |
102400 |
|
3200 |
206043639 |
2000030318cse |
F |
May 16, 2023, 3:53 a.m. |
OK |
GNU C++14 |
TESTS |
91 |
733 |
102400 |
|
3200 |
206038319 |
richcat |
F |
May 16, 2023, 1:43 a.m. |
OK |
GNU C++14 |
TESTS |
91 |
748 |
102400 |
|
3200 |
206314955 |
soudhamini_2000031088 |
F |
May 18, 2023, 8:37 a.m. |
OK |
GNU C++14 |
TESTS |
91 |
764 |
102400 |
|
3200 |
206302720 |
2100030662.cseh |
F |
May 18, 2023, 6:15 a.m. |
OK |
GNU C++14 |
TESTS |
91 |
764 |
102400 |
|
3200 |
205957564 |
2000030103 |
F |
May 15, 2023, 8:32 a.m. |
OK |
GNU C++14 |
TESTS |
91 |
795 |
102400 |
|
3200 |
206458040 |
cyh_toby |
F |
May 19, 2023, 2:36 p.m. |
OK |
GNU C++14 |
TESTS |
91 |
1981 |
193024000 |
|
3200 |
206457969 |
cyh_toby |
F |
May 19, 2023, 2:36 p.m. |
OK |
GNU C++14 |
TESTS |
91 |
2043 |
193024000 |
|
3200 |
206517571 |
Lynkcat |
F |
May 19, 2023, 3:53 p.m. |
OK |
GNU C++17 |
TESTS |
91 |
421 |
193740800 |
|
3200 |
206573432 |
bkifhr8 |
F |
May 19, 2023, 10:31 p.m. |
OK |
GNU C++17 |
TESTS |
91 |
577 |
49459200 |
|
3200 |
206484874 |
ibimschecker |
F |
May 19, 2023, 3:02 p.m. |
OK |
GNU C++17 |
TESTS |
91 |
639 |
128716800 |
|
3200 |
206253678 |
lalith_6055 |
F |
May 17, 2023, 5:03 p.m. |
OK |
GNU C++17 |
TESTS |
91 |
670 |
112844800 |
|
3200 |
206183989 |
2000030919 |
F |
May 17, 2023, 8:11 a.m. |
OK |
GNU C++17 |
TESTS |
91 |
764 |
102400 |
|
3200 |
205942870 |
2000030309_geethika |
F |
May 15, 2023, 5:14 a.m. |
OK |
GNU C++17 |
TESTS |
91 |
764 |
102400 |
|
3200 |
205942255 |
Karthik1106 |
F |
May 15, 2023, 5:04 a.m. |
OK |
GNU C++17 |
TESTS |
91 |
764 |
102400 |
|
3200 |
205940805 |
sasisushma |
F |
May 15, 2023, 4:40 a.m. |
OK |
GNU C++17 |
TESTS |
91 |
764 |
102400 |
|
3200 |
206322480 |
Jaheer |
F |
May 18, 2023, 9:52 a.m. |
OK |
GNU C++17 |
TESTS |
91 |
780 |
102400 |
|
3200 |
206305479 |
klu2000031511 |
F |
May 18, 2023, 6:49 a.m. |
OK |
GNU C++17 |
TESTS |
91 |
780 |
102400 |
|
3200 |
206039046 |
Alex_Wei |
F |
May 16, 2023, 2:05 a.m. |
OK |
GNU C++17 (64) |
TESTS |
91 |
202 |
145305600 |
|
3200 |
206038873 |
Alex_Wei |
F |
May 16, 2023, 1:59 a.m. |
OK |
GNU C++17 (64) |
TESTS |
91 |
218 |
145305600 |
|
3200 |
206362469 |
Bolshevik |
F |
May 18, 2023, 4:03 p.m. |
OK |
GNU C++17 (64) |
TESTS |
91 |
234 |
145715200 |
|
3200 |
206185565 |
lgkm39 |
F |
May 17, 2023, 8:29 a.m. |
OK |
GNU C++17 (64) |
TESTS |
91 |
264 |
180428800 |
|
3200 |
206037887 |
dXqwq |
F |
May 16, 2023, 1:30 a.m. |
OK |
GNU C++17 (64) |
TESTS |
91 |
280 |
160768000 |
|
3200 |
206296048 |
KHAJA31269 |
F |
May 18, 2023, 4:25 a.m. |
OK |
GNU C++17 (64) |
TESTS |
91 |
514 |
102400 |
|
3200 |
206179236 |
jwalapc |
F |
May 17, 2023, 7:15 a.m. |
OK |
GNU C++17 (64) |
TESTS |
91 |
514 |
102400 |
|
3200 |
205930607 |
xiaoziyao |
F |
May 15, 2023, 12:41 a.m. |
OK |
GNU C++17 (64) |
TESTS |
91 |
514 |
102400 |
|
3200 |
206169106 |
V.L.Manaswini |
F |
May 17, 2023, 3:55 a.m. |
OK |
GNU C++17 (64) |
TESTS |
91 |
546 |
102400 |
|
3200 |
205774353 |
TrendBattles |
F |
May 14, 2023, 1:03 a.m. |
OK |
GNU C++17 (64) |
TESTS |
91 |
982 |
102400 |
|
3200 |
206414819 |
shnirelman |
F |
May 19, 2023, 7:18 a.m. |
OK |
GNU C++20 (64) |
TESTS |
91 |
155 |
162508800 |
|
3200 |
206103451 |
natalia7992 |
F |
May 16, 2023, 3:04 p.m. |
OK |
GNU C++20 (64) |
TESTS |
91 |
202 |
144998400 |
|
3200 |
206041476 |
cnnfls_csy |
F |
May 16, 2023, 3:05 a.m. |
OK |
GNU C++20 (64) |
TESTS |
91 |
202 |
144998400 |
|
3200 |
206447495 |
Nero |
F |
May 19, 2023, 12:48 p.m. |
OK |
GNU C++20 (64) |
TESTS |
91 |
233 |
105574400 |
|
3200 |
206517844 |
Lynkcat |
F |
May 19, 2023, 3:54 p.m. |
OK |
GNU C++20 (64) |
TESTS |
91 |
264 |
193433600 |
|
3200 |
206447668 |
Nero |
F |
May 19, 2023, 12:50 p.m. |
OK |
GNU C++20 (64) |
TESTS |
91 |
295 |
105574400 |
|
3200 |
206037900 |
hehezhoutxdy |
F |
May 16, 2023, 1:30 a.m. |
OK |
GNU C++20 (64) |
TESTS |
91 |
295 |
160768000 |
|
3200 |
206435285 |
ftiasch |
F |
May 19, 2023, 10:43 a.m. |
OK |
GNU C++20 (64) |
TESTS |
91 |
358 |
116531200 |
|
3200 |
206342552 |
bdgrsrn |
F |
May 18, 2023, 12:59 p.m. |
OK |
GNU C++20 (64) |
TESTS |
91 |
405 |
52428800 |
|
3200 |
206447959 |
Nero |
F |
May 19, 2023, 12:53 p.m. |
OK |
GNU C++20 (64) |
TESTS |
91 |
420 |
105574400 |
|
3200 |
remove filters
Back to search problems