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 |
---|---|---|---|---|---|---|
1389 | Educational Codeforces Round 92 (Rated for Div. 2) | FINISHED | False | 7200 | 141146663 | July 29, 2020, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 4360 ) | D | Segment Intersections | PROGRAMMING | binary search brute force greedy implementation math |
B"You are given two lists of segments [al_1, ar_1], [al_2, ar_2], ... , [al_n, ar_n] and [bl_1, br_1], [bl_2, br_2], ... , [bl_n, br_n] . Initially, all segments [al_i, ar_i] are equal to [l_1, r_1] and all segments [bl_i, br_i] are equal to [l_2, r_2] . In one step, you can choose one segment (either from the first or from the second list) and extend it by 1 . In other words, suppose you've chosen segment [x, y] then you can transform it either into [x - 1, y] or into [x, y + 1] . Let's define a total intersection I as the sum of lengths of intersections of the corresponding pairs of segments, i.e. sum limits_{i=1}^{n}{ text{intersection_length}([al_i, ar_i], [bl_i, br_i])} . Empty intersection has length 0 and length of a segment [x, y] is equal to y - x . What is the minimum number of steps you need to make I greater or equal to k ? The first line contains the single integer t ( 1 <= t <= 1000 ) -- the number of test cases. The first line of each test case contains two integers n and k ( 1 <= n <= 2 cdot 10^5 ; 1 <= k <= 10^9 ) -- the length of lists and the minimum required total intersection. The second line of each test case contains two integers l_1 and r_1 ( 1 <= l_1 <= r_1 <= 10^9 ) -- the segment all [al_i, ar_i] are equal to initially. The third line of each test case contains two integers l_2 and r_2 ( 1 <= l_2 <= r_2 <= 10^9 ) -- the segment all [bl_i, br_i] are equal to initially. It's guaranteed that the sum of n doesn't exceed 2 cdot 10^5 . Print t integers -- one per test case. For each test case, print the minimum number of step you need to make I greater or equal to k . In the first test case, we can achieve total intersection 5 , for example, using next strategy: In the second test case, we can make [al_1, ar"... |
80809 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
88939555 | dyxx | D | Aug. 5, 2020, 11:12 a.m. | OK | GNU C11 | TESTS | 20 | 15 | 3686400 | ||
89162811 | JoseTomas01 | D | Aug. 7, 2020, 12:09 a.m. | OK | GNU C11 | TESTS | 20 | 31 | 3686400 | ||
90304511 | _int_me | D | Aug. 18, 2020, 11:51 a.m. | OK | GNU C++11 | TESTS | 20 | 15 | 0 | ||
91272774 | Lazy_boy99 | D | Aug. 29, 2020, 9:34 a.m. | OK | GNU C++11 | TESTS | 20 | 15 | 0 | ||
91025989 | hulean | D | Aug. 26, 2020, 6:57 a.m. | OK | GNU C++11 | TESTS | 20 | 15 | 0 | ||
89122366 | Eganrak | D | Aug. 6, 2020, 12:51 p.m. | OK | GNU C++11 | TESTS | 20 | 15 | 3686400 | ||
89370310 | ZCDHJ | D | Aug. 9, 2020, 2:59 a.m. | OK | GNU C++11 | TESTS | 20 | 15 | 3891200 | ||
89370388 | ZCDHJ | D | Aug. 9, 2020, 3:03 a.m. | OK | GNU C++11 | TESTS | 20 | 15 | 3891200 | ||
89397120 | CTP_314 | D | Aug. 9, 2020, 11:55 a.m. | OK | GNU C++11 | TESTS | 20 | 15 | 3891200 | ||
88927933 | Adelard | D | Aug. 5, 2020, 8:15 a.m. | OK | GNU C++11 | TESTS | 20 | 15 | 4096000 | ||
91554653 | Igor_Zielinski | D | Sept. 1, 2020, 10 a.m. | OK | GNU C++11 | TESTS | 20 | 30 | 0 | ||
91646388 | BLUESKY007 | D | Sept. 2, 2020, 1:51 p.m. | OK | GNU C++11 | TESTS | 20 | 30 | 0 | ||
88701492 | TPC-er | D | Aug. 2, 2020, 3:40 a.m. | OK | GNU C++14 | TESTS | 20 | 30 | 3686400 | ||
90766515 | Hyperbolic | D | Aug. 23, 2020, 3:06 p.m. | OK | GNU C++14 | TESTS | 20 | 30 | 3686400 | ||
89138364 | qu_bit | D | Aug. 6, 2020, 3:41 p.m. | OK | GNU C++14 | TESTS | 20 | 30 | 3686400 | ||
89510727 | KasuganoSora6 | D | Aug. 10, 2020, 12:54 p.m. | OK | GNU C++14 | TESTS | 20 | 30 | 3788800 | ||
91610221 | vjudge3 | D | Sept. 2, 2020, 4:21 a.m. | OK | GNU C++14 | TESTS | 20 | 31 | 0 | ||
91559675 | hchauhan7816 | D | Sept. 1, 2020, 11:18 a.m. | OK | GNU C++14 | TESTS | 20 | 31 | 0 | ||
91530288 | assem99 | D | Sept. 1, 2020, 1:39 a.m. | OK | GNU C++14 | TESTS | 20 | 31 | 0 | ||
91320297 | dy2000 | D | Aug. 30, 2020, 3:32 a.m. | OK | GNU C++14 | TESTS | 20 | 31 | 0 | ||
91632964 | sahilverma_01 | D | Sept. 2, 2020, 10:49 a.m. | OK | GNU C++14 | TESTS | 20 | 31 | 0 | ||
91651788 | sahilverma_01 | D | Sept. 2, 2020, 2:57 p.m. | OK | GNU C++14 | TESTS | 20 | 31 | 0 | ||
90017326 | Elysia | D | Aug. 15, 2020, 12:16 p.m. | OK | GNU C++17 | TESTS | 20 | 30 | 0 | ||
91599752 | Hisoka | D | Sept. 1, 2020, 9:11 p.m. | OK | GNU C++17 | TESTS | 20 | 30 | 0 | ||
91581009 | knightingale | D | Sept. 1, 2020, 3:47 p.m. | OK | GNU C++17 | TESTS | 20 | 30 | 0 | ||
89824707 | ktk.prajapati | D | Aug. 13, 2020, 7:46 p.m. | OK | GNU C++17 | TESTS | 20 | 30 | 204800 | ||
89203852 | HaGeza | D | Aug. 7, 2020, 12:32 p.m. | OK | GNU C++17 | TESTS | 20 | 30 | 3686400 | ||
89073942 | lior5654 | D | Aug. 5, 2020, 10:03 p.m. | OK | GNU C++17 | TESTS | 20 | 30 | 3686400 | ||
88918312 | Mmcoder | D | Aug. 5, 2020, 5:40 a.m. | OK | GNU C++17 | TESTS | 20 | 30 | 3686400 | ||
88702567 | Vangoph | D | Aug. 2, 2020, 4:17 a.m. | OK | GNU C++17 | TESTS | 20 | 30 | 3686400 | ||
89207650 | littlemonk | D | Aug. 7, 2020, 1:28 p.m. | OK | GNU C++17 | TESTS | 20 | 30 | 3788800 | ||
88759475 | lakshay_nasa | D | Aug. 2, 2020, 8:27 p.m. | OK | GNU C++17 | TESTS | 20 | 30 | 3788800 | ||
89800803 | iaNTU | D | Aug. 13, 2020, 2:03 p.m. | OK | GNU C++17 (64) | TESTS | 20 | 15 | 0 | ||
90466833 | errorgorn | D | Aug. 20, 2020, 1:37 p.m. | OK | GNU C++17 (64) | TESTS | 20 | 15 | 0 | ||
89835618 | lightseba | D | Aug. 14, 2020, 2:23 a.m. | OK | GNU C++17 (64) | TESTS | 20 | 15 | 0 | ||
89776438 | kunaltawatia | D | Aug. 13, 2020, 8:39 a.m. | OK | GNU C++17 (64) | TESTS | 20 | 15 | 204800 | ||
89310224 | vjudge5 | D | Aug. 8, 2020, 6:16 a.m. | OK | GNU C++17 (64) | TESTS | 20 | 15 | 4198400 | ||
89191797 | aeiou1 | D | Aug. 7, 2020, 9:22 a.m. | OK | GNU C++17 (64) | TESTS | 20 | 15 | 4300800 | ||
89116248 | sharrad99 | D | Aug. 6, 2020, 11:43 a.m. | OK | GNU C++17 (64) | TESTS | 20 | 15 | 4300800 | ||
88781965 | Anila9007 | D | Aug. 3, 2020, 8:07 a.m. | OK | GNU C++17 (64) | TESTS | 20 | 15 | 4300800 | ||
90510300 | Joker_Gamer | D | Aug. 21, 2020, 7:26 a.m. | OK | GNU C++17 (64) | TESTS | 20 | 15 | 4505600 | ||
88720007 | clearlove20 | D | Aug. 2, 2020, 9:46 a.m. | OK | GNU C++17 (64) | TESTS | 20 | 15 | 4915200 | ||
88824073 | meooow | D | Aug. 3, 2020, 6:52 p.m. | OK | Go | TESTS | 20 | 31 | 10854400 | ||
88824109 | meooow | D | Aug. 3, 2020, 6:53 p.m. | OK | Go | TESTS | 20 | 46 | 10854400 | ||
89155086 | pohzipohzi | D | Aug. 6, 2020, 7:37 p.m. | OK | Go | TESTS | 20 | 46 | 13004800 | ||
90357107 | PizzaLovers007 | D | Aug. 19, 2020, 4:40 a.m. | OK | Java 11 | TESTS | 20 | 171 | 0 | ||
88645449 | Richard727 | D | Aug. 1, 2020, 8:08 a.m. | OK | Java 11 | TESTS | 20 | 187 | 23756800 | ||
89069736 | skittles1412 | D | Aug. 5, 2020, 8:09 p.m. | OK | Java 11 | TESTS | 20 | 187 | 24985600 | ||
88831453 | jay_vish | D | Aug. 3, 2020, 10:52 p.m. | OK | Java 11 | TESTS | 20 | 202 | 23859200 | ||
89153571 | FominSergey | D | Aug. 6, 2020, 7:09 p.m. | OK | Java 11 | TESTS | 20 | 202 | 24473600 | ||
88697603 | kabirpathak | D | Aug. 2, 2020, 12:53 a.m. | OK | Java 11 | TESTS | 20 | 218 | 24473600 | ||
88907581 | StepMommy | D | Aug. 5, 2020, 12:46 a.m. | OK | Java 11 | TESTS | 20 | 265 | 24473600 | ||
88687707 | mwen | D | Aug. 1, 2020, 6:34 p.m. | OK | Java 8 | TESTS | 20 | 109 | 20480000 | ||
88657701 | lazypanda | D | Aug. 1, 2020, 11 a.m. | OK | Java 8 | TESTS | 20 | 109 | 20480000 | ||
88653640 | an09mous | D | Aug. 1, 2020, 10:02 a.m. | OK | Java 8 | TESTS | 20 | 109 | 20582400 | ||
88885693 | bhautik_77 | D | Aug. 4, 2020, 3:44 p.m. | OK | Java 8 | TESTS | 20 | 109 | 20684800 | ||
89907284 | eng_hardik | D | Aug. 14, 2020, 2:58 p.m. | OK | Java 8 | TESTS | 20 | 124 | 0 | ||
88688047 | mwen | D | Aug. 1, 2020, 6:41 p.m. | OK | Java 8 | TESTS | 20 | 124 | 20480000 | ||
89474118 | yaoct | D | Aug. 10, 2020, 2:26 a.m. | OK | Java 8 | TESTS | 20 | 124 | 20582400 | ||
88702267 | jxin31415 | D | Aug. 2, 2020, 4:07 a.m. | OK | Java 8 | TESTS | 20 | 124 | 20787200 | ||
88644265 | shubho96 | D | Aug. 1, 2020, 7:51 a.m. | OK | Java 8 | TESTS | 20 | 140 | 20480000 | ||
90385820 | vlad.iftimescu | D | Aug. 19, 2020, noon | OK | Java 8 | TESTS | 20 | 156 | 0 | ||
88910242 | wuchaojie925 | D | Aug. 5, 2020, 2:22 a.m. | OK | Kotlin | TESTS | 20 | 124 | 21299200 | ||
88910113 | wuchaojie925 | D | Aug. 5, 2020, 2:18 a.m. | OK | Kotlin | TESTS | 20 | 139 | 21708800 | ||
88911536 | wuchaojie925 | D | Aug. 5, 2020, 2:59 a.m. | OK | Kotlin | TESTS | 20 | 140 | 21299200 | ||
88910364 | wuchaojie925 | D | Aug. 5, 2020, 2:25 a.m. | OK | Kotlin | TESTS | 20 | 140 | 21299200 | ||
90183768 | juxtaposek | D | Aug. 17, 2020, 1:16 a.m. | OK | Kotlin | TESTS | 20 | 155 | 0 | ||
88718218 | ahmed2807 | D | Aug. 2, 2020, 9:18 a.m. | OK | Kotlin | TESTS | 20 | 155 | 21708800 | ||
89611176 | Harry122 | D | Aug. 11, 2020, 10:25 p.m. | OK | Kotlin | TESTS | 20 | 155 | 21708800 | ||
91252432 | Even_Bao | D | Aug. 29, 2020, 3:05 a.m. | OK | Kotlin | TESTS | 20 | 170 | 0 | ||
90002255 | felix412441 | D | Aug. 15, 2020, 8:39 a.m. | OK | Kotlin | TESTS | 20 | 170 | 0 | ||
88851161 | canderys | D | Aug. 4, 2020, 7:43 a.m. | OK | Kotlin | TESTS | 20 | 170 | 21708800 | ||
90307394 | azukun | D | Aug. 18, 2020, 12:31 p.m. | OK | Mono C# | TESTS | 20 | 62 | 2662400 | ||
89506828 | EmK | D | Aug. 10, 2020, 11:59 a.m. | OK | Mono C# | TESTS | 20 | 77 | 108953600 | ||
89837918 | itised | D | Aug. 14, 2020, 3:22 a.m. | OK | MS C++ 2017 | TESTS | 20 | 31 | 0 | ||
90011740 | Ivan_Dunko | D | Aug. 15, 2020, 10:51 a.m. | OK | MS C++ 2017 | TESTS | 20 | 31 | 0 | ||
88862745 | getN1ght | D | Aug. 4, 2020, 10:35 a.m. | OK | MS C++ 2017 | TESTS | 20 | 31 | 3686400 | ||
89394686 | savinovalex | D | Aug. 9, 2020, 11:14 a.m. | OK | MS C++ 2017 | TESTS | 20 | 46 | 3686400 | ||
89136021 | yumtam | D | Aug. 6, 2020, 3:17 p.m. | OK | PyPy 2 | TESTS | 20 | 109 | 23859200 | ||
89514526 | nowrin_brown | D | Aug. 10, 2020, 1:45 p.m. | OK | PyPy 3 | TESTS | 20 | 155 | 23040000 | ||
88638517 | neterukun | D | Aug. 1, 2020, 6:22 a.m. | OK | PyPy 3 | TESTS | 20 | 186 | 23142400 | ||
89131538 | YMSeah | D | Aug. 6, 2020, 2:30 p.m. | OK | PyPy 3 | TESTS | 20 | 202 | 23859200 | ||
89573140 | roaris | D | Aug. 11, 2020, 11:38 a.m. | OK | PyPy 3 | TESTS | 20 | 218 | 23756800 | ||
89521980 | roaris | D | Aug. 10, 2020, 3:21 p.m. | OK | PyPy 3 | TESTS | 20 | 218 | 24473600 | ||
89145601 | lakshyatyagi24 | D | Aug. 6, 2020, 5:04 p.m. | OK | PyPy 3 | TESTS | 20 | 233 | 24985600 | ||
88867920 | vishwas_007 | D | Aug. 4, 2020, 12:05 p.m. | OK | PyPy 3 | TESTS | 20 | 234 | 25088000 | ||
91504462 | yumi-yutaku | D | Aug. 31, 2020, 3:25 p.m. | OK | PyPy 3 | TESTS | 20 | 280 | 4710400 | ||
89301156 | bryanhe | D | Aug. 8, 2020, 3:17 a.m. | OK | PyPy 3 | TESTS | 20 | 280 | 26931200 | ||
88821014 | DeepBorys | D | Aug. 3, 2020, 5:53 p.m. | OK | PyPy 3 | TESTS | 20 | 280 | 27340800 | ||
88923648 | janardhan_6635 | D | Aug. 5, 2020, 7:06 a.m. | OK | Python 3 | TESTS | 20 | 108 | 6963200 | ||
88729423 | steph1 | D | Aug. 2, 2020, 12:07 p.m. | OK | Python 3 | TESTS | 20 | 108 | 6963200 | ||
88923918 | janardhan_6635 | D | Aug. 5, 2020, 7:10 a.m. | OK | Python 3 | TESTS | 20 | 109 | 6963200 | ||
88896024 | Camazotz | D | Aug. 4, 2020, 6:15 p.m. | OK | Python 3 | TESTS | 20 | 109 | 6963200 | ||
88693842 | tycyd | D | Aug. 1, 2020, 9:18 p.m. | OK | Python 3 | TESTS | 20 | 109 | 6963200 | ||
88753708 | sagalpreet | D | Aug. 2, 2020, 6:09 p.m. | OK | Python 3 | TESTS | 20 | 124 | 107315200 | ||
88817994 | Andrey_R | D | Aug. 3, 2020, 5:01 p.m. | OK | Ruby | TESTS | 20 | 576 | 49459200 | ||
88702115 | Strorkis | D | Aug. 2, 2020, 4:02 a.m. | OK | Rust | TESTS | 20 | 31 | 3788800 |
Back to search problems