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 |
---|---|---|---|---|---|---|
1781 | VK Cup 2022 - Отборочный раунд (Engine) | FINISHED | False | 10800 | 58038899 | Jan. 15, 2023, 12:05 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 1310 ) | E | Rectangle Shrinking | PROGRAMMING | binary search data structures greedy implementation two pointers |
B"You have a rectangular grid of height 2 and width 10^9 consisting of unit cells. There are n rectangles placed on this grid, and the borders of these rectangles pass along cell borders. The i -th rectangle covers all cells in rows from u_i to d_i inclusive and columns from l_i to r_i inclusive ( 1 <= u_i <= d_i <= 2 ; 1 <= l_i <= r_i <= 10^9 ). The initial rectangles can intersect, be nested, and coincide arbitrarily. You should either remove each rectangle, or replace it with any of its non-empty subrectangles. In the latter case, the new subrectangle must lie inside the initial rectangle, and its borders must still pass along cell borders. In particular, it is allowed for the subrectangle to be equal to the initial rectangle. After that replacement, no two (non-removed) rectangles are allowed to have common cells, and the total area covered with the new rectangles must be as large as possible. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10^4 ). The description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= n <= 2 cdot 10^5 ) -- the number of rectangles. Each of the next n lines contains four integers u_i, l_i, d_i, r_i ( 1 <= u_i <= d_i <= 2 ; 1 <= l_i <= r_i <= 10^9 ) -- the coordinates of cells located in the top-left and the bottom-right corners of the rectangle, respectively. It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, first print an integer s -- the largest possible covered by new rectangles area. Then print n lines with your solution to cover this area. In the i -th of these lines print four integers u'_i, l'_i, d'_i, r'_i . If you remove the i -th rectangle, print u'_i = l'_i = d'_i = r'_i = 0 . Otherwise, these numbers"... |
Tutorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
189349072 | Gassa | E | Jan. 15, 2023, 2:30 p.m. | OK | D | TESTS | 44 | 639 | 27750400 | ||
189393413 | YeahPotato | E | Jan. 16, 2023, 3:45 a.m. | OK | GNU C++14 | TESTS | 44 | 561 | 113664000 | ||
189348960 | awoo | E | Jan. 15, 2023, 2:30 p.m. | OK | GNU C++14 | TESTS | 44 | 1123 | 84070400 | ||
189345744 | TeaPot | E | Jan. 15, 2023, 2:15 p.m. | OK | GNU C++14 | TESTS | 44 | 1341 | 211763200 | ||
189365208 | knightL | E | Jan. 15, 2023, 4:49 p.m. | OK | GNU C++14 | TESTS | 44 | 1762 | 124518400 | ||
189334811 | vepifanov | E | Jan. 15, 2023, 1:29 p.m. | OK | GNU C++17 | TESTS | 44 | 233 | 12902400 | ||
189380666 | DavitMarg | E | Jan. 15, 2023, 8:49 p.m. | OK | GNU C++17 | TESTS | 44 | 326 | 14336000 | ||
189337829 | YakutovDmitriy | E | Jan. 15, 2023, 1:41 p.m. | OK | GNU C++17 | TESTS | 44 | 327 | 5836800 | ||
189382810 | Edvard | E | Jan. 15, 2023, 9:51 p.m. | OK | GNU C++17 | TESTS | 44 | 420 | 71168000 | ||
189335697 | -imc- | E | Jan. 15, 2023, 1:32 p.m. | OK | GNU C++17 | TESTS | 44 | 452 | 13107200 | ||
189354809 | TonySnark | E | Jan. 15, 2023, 2:56 p.m. | OK | GNU C++17 | TESTS | 44 | 483 | 18739200 | ||
189382172 | Tima | E | Jan. 15, 2023, 9:31 p.m. | OK | GNU C++17 | TESTS | 44 | 530 | 202035200 | ||
189340539 | TolyaHo | E | Jan. 15, 2023, 1:53 p.m. | OK | GNU C++17 | TESTS | 44 | 576 | 20070400 | ||
189352809 | Nikitosh | E | Jan. 15, 2023, 2:47 p.m. | OK | GNU C++17 | TESTS | 44 | 576 | 20582400 | ||
189356801 | little_misfortune | E | Jan. 15, 2023, 3:03 p.m. | OK | GNU C++17 | TESTS | 44 | 592 | 11878400 | ||
189342004 | ALILILILILI-KHAN | E | Jan. 15, 2023, 1:59 p.m. | OK | GNU C++17 (64) | TESTS | 44 | 280 | 10649600 | ||
189326924 | 353cerega | E | Jan. 15, 2023, 1 p.m. | OK | GNU C++17 (64) | TESTS | 44 | 295 | 28160000 | ||
189342565 | Kirill22 | E | Jan. 15, 2023, 2:01 p.m. | OK | GNU C++17 (64) | TESTS | 44 | 311 | 22220800 | ||
189331187 | 244mhq | E | Jan. 15, 2023, 1:14 p.m. | OK | GNU C++17 (64) | TESTS | 44 | 326 | 18227200 | ||
189346707 | glebustim | E | Jan. 15, 2023, 2:19 p.m. | OK | GNU C++17 (64) | TESTS | 44 | 327 | 17817600 | ||
189347618 | Andreasyan | E | Jan. 15, 2023, 2:24 p.m. | OK | GNU C++17 (64) | TESTS | 44 | 343 | 50073600 | ||
189329054 | tabr | E | Jan. 15, 2023, 1:07 p.m. | OK | GNU C++17 (64) | TESTS | 44 | 358 | 18022400 | ||
189352919 | BlackAnt | E | Jan. 15, 2023, 2:48 p.m. | OK | GNU C++17 (64) | TESTS | 44 | 358 | 22630400 | ||
189346862 | dimss | E | Jan. 15, 2023, 2:20 p.m. | OK | GNU C++17 (64) | TESTS | 44 | 374 | 44339200 | ||
189338159 | Siberian | E | Jan. 15, 2023, 1:43 p.m. | OK | GNU C++17 (64) | TESTS | 44 | 420 | 16486400 | ||
189325130 | Golovanov399 | E | Jan. 15, 2023, 12:54 p.m. | OK | GNU C++20 (64) | TESTS | 44 | 171 | 6144000 | ||
189354659 | vladmart | E | Jan. 15, 2023, 2:55 p.m. | OK | GNU C++20 (64) | TESTS | 44 | 186 | 13312000 | ||
189349138 | ak-group | E | Jan. 15, 2023, 2:31 p.m. | OK | GNU C++20 (64) | TESTS | 44 | 202 | 8089600 | ||
189334524 | budalnik | E | Jan. 15, 2023, 1:27 p.m. | OK | GNU C++20 (64) | TESTS | 44 | 202 | 11468800 | ||
189391295 | Kalashnikov | E | Jan. 16, 2023, 2:58 a.m. | OK | GNU C++20 (64) | TESTS | 44 | 202 | 15769600 | ||
189348175 | DimmyT | E | Jan. 15, 2023, 2:26 p.m. | OK | GNU C++20 (64) | TESTS | 44 | 202 | 24166400 | ||
189327345 | Ormlis | E | Jan. 15, 2023, 1:01 p.m. | OK | GNU C++20 (64) | TESTS | 44 | 217 | 9011200 | ||
189334120 | Petr | E | Jan. 15, 2023, 1:26 p.m. | OK | GNU C++20 (64) | TESTS | 44 | 217 | 13619200 | ||
189351468 | amokrousov | E | Jan. 15, 2023, 2:41 p.m. | OK | GNU C++20 (64) | TESTS | 44 | 217 | 19353600 | ||
189327570 | Allvik06 | E | Jan. 15, 2023, 1:02 p.m. | OK | GNU C++20 (64) | TESTS | 44 | 218 | 6451200 | ||
189341132 | mmaxio | E | Jan. 15, 2023, 1:55 p.m. | OK | Java 11 | TESTS | 44 | 420 | 18636800 | ||
189377946 | dusty.and.rusty | E | Jan. 15, 2023, 7:50 p.m. | OK | Java 17 | TESTS | 44 | 1060 | 36249600 | ||
189330833 | Egor | E | Jan. 15, 2023, 1:13 p.m. | OK | Rust 2021 | TESTS | 44 | 155 | 15257600 |
Back to search problems