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 |
---|---|---|---|---|---|---|
1034 | Codeforces Round 511 (Div. 1) | FINISHED | False | 7200 | 194282699 | Sept. 21, 2018, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 456 ) | D | Intervals of Intervals | PROGRAMMING | binary search data structures two pointers | 3500 |
B'Little D is a friend of Little C who loves intervals very much instead of number " 3 ". Now he has n intervals on the number axis, the i -th of which is [a_i,b_i] . Only the n intervals can not satisfy him. He defines the value of an interval of intervals [l,r] ( 1 <= q l <= q r <= q n , l and r are both integers) as the total length of the union of intervals from the l -th to the r -th. He wants to select exactly k different intervals of intervals such that the sum of their values is maximal. Please help him calculate the maximal sum. First line contains two integers n and k ( 1 <= q n <= q 3 cdot 10^5 , 1 <= q k <= q min { frac{n(n+1)}{2},10^9 } ) -- the number of intervals Little D has and the number of intervals of intervals he will select. Each of the next n lines contains two integers a_i and b_i , the i -th line of the n lines describing the i -th interval ( 1 <= q a_i < b_i <= q 10^9 ). Print one integer -- the maximal sum of values Little D can get. For the first example, Little D will select [1,2] , the union of the first interval and the second interval is [1,4] , whose length is 3 . For the second example, Little D will select [1,2] , [2,3] and [1,3] , the answer is 5+6+4=15 . '... |
Codeforces Round #511 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
43596670 | tritanngo99 | D | Sept. 30, 2018, 7:36 a.m. | OK | GNU C++11 | TESTS | 40 | 530 | 35840000 | 3500 | |
50495338 | remoon | D | Feb. 25, 2019, 2:55 p.m. | OK | GNU C++11 | TESTS | 40 | 530 | 48844800 | 3500 | |
44099612 | 00zj | D | Oct. 11, 2018, 4:46 a.m. | OK | GNU C++11 | TESTS | 40 | 561 | 40652800 | 3500 | |
47853377 | skywalkert | D | Jan. 2, 2019, 7:22 p.m. | OK | GNU C++11 | TESTS | 40 | 561 | 45772800 | 3500 | |
50493809 | remoon | D | Feb. 25, 2019, 2:20 p.m. | OK | GNU C++11 | TESTS | 40 | 576 | 48844800 | 3500 | |
64441701 | mlby | D | Nov. 7, 2019, 4:41 a.m. | OK | GNU C++11 | TESTS | 40 | 576 | 49766400 | 3500 | |
44751699 | ReaLNero1 | D | Oct. 23, 2018, 8:18 p.m. | OK | GNU C++11 | TESTS | 40 | 592 | 40652800 | 3500 | |
46665954 | CMXRYNP | D | Dec. 6, 2018, 1:58 a.m. | OK | GNU C++11 | TESTS | 40 | 592 | 49868800 | 3500 | |
48405447 | vjudge5 | D | Jan. 15, 2019, 3:08 a.m. | OK | GNU C++11 | TESTS | 40 | 607 | 37990400 | 3500 | |
43925204 | tqyaaaaaaaang | D | Oct. 7, 2018, 4:31 a.m. | OK | GNU C++11 | TESTS | 40 | 623 | 58982400 | 3500 | |
44346442 | zhangqingqi | D | Oct. 15, 2018, 7:36 a.m. | OK | GNU C++14 | TESTS | 40 | 639 | 36966400 | 3500 | |
60326334 | idxcalcal | D | Sept. 10, 2019, 1:52 a.m. | OK | GNU C++14 | TESTS | 40 | 717 | 49254400 | 3500 | |
49896023 | ochilov-2004 | D | Feb. 14, 2019, 6:58 a.m. | OK | GNU C++14 | TESTS | 40 | 732 | 43212800 | 3500 | |
44583506 | Drin_E | D | Oct. 20, 2018, 9 a.m. | OK | GNU C++14 | TESTS | 40 | 763 | 35942400 | 3500 | |
65938364 | Toxel | D | Nov. 29, 2019, 4:17 a.m. | OK | GNU C++14 | TESTS | 40 | 795 | 50176000 | 3500 | |
64190580 | _DYT | D | Nov. 4, 2019, 7:34 a.m. | OK | GNU C++14 | TESTS | 40 | 826 | 40755200 | 3500 | |
48693145 | minhphuoc1998 | D | Jan. 21, 2019, 7:03 p.m. | OK | GNU C++14 | TESTS | 40 | 826 | 45158400 | 3500 | |
44757266 | mosfjh | D | Oct. 24, 2018, 4:03 a.m. | OK | GNU C++14 | TESTS | 40 | 842 | 55193600 | 3500 | |
43987525 | asd123wwww | D | Oct. 8, 2018, 8:14 a.m. | OK | GNU C++14 | TESTS | 40 | 857 | 64307200 | 3500 | |
43478547 | Lynstery | D | Sept. 27, 2018, 5:17 a.m. | OK | GNU C++14 | TESTS | 40 | 873 | 43212800 | 3500 | |
55691484 | Nakagawa.Kanon | D | June 17, 2019, 6:26 p.m. | OK | GNU C++17 | TESTS | 40 | 608 | 33177600 | 3500 | |
44067024 | Trisolaris | D | Oct. 10, 2018, 9:57 a.m. | OK | GNU C++17 | TESTS | 40 | 623 | 43315200 | 3500 | |
69555096 | gongsuidashen | D | Jan. 26, 2020, 8:27 a.m. | OK | GNU C++17 | TESTS | 40 | 670 | 40857600 | 3500 | |
49684810 | pandora_lee | D | Feb. 10, 2019, 6:21 a.m. | OK | GNU C++17 | TESTS | 40 | 670 | 41062400 | 3500 | |
44077280 | FizzyDavid | D | Oct. 10, 2018, 1:33 p.m. | OK | GNU C++17 | TESTS | 40 | 733 | 38502400 | 3500 | |
43237765 | bmerry | D | Sept. 22, 2018, 8:44 a.m. | OK | GNU C++17 | TESTS | 40 | 857 | 41062400 | 3500 | |
43363395 | DZYO | D | Sept. 24, 2018, 10:54 a.m. | OK | GNU C++17 | TESTS | 40 | 857 | 42291200 | 3500 | |
49312942 | _Happy_New_Year_ | D | Feb. 1, 2019, 8:55 a.m. | OK | GNU C++17 | TESTS | 40 | 857 | 44646400 | 3500 | |
66146855 | ngfam | D | Dec. 1, 2019, 5 p.m. | OK | GNU C++17 | TESTS | 40 | 873 | 45772800 | 3500 | |
66016383 | Kuroni | D | Nov. 30, 2019, 5:36 a.m. | OK | GNU C++17 | TESTS | 40 | 904 | 46796800 | 3500 | |
67982237 | Harpae | D | Dec. 30, 2019, 7:56 p.m. | OK | Java 8 | TESTS | 40 | 1887 | 126566400 | 3500 |
Back to search problems