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 |
|---|---|---|---|---|---|---|
| 471 | Codeforces Round 269 (Div. 2) | FINISHED | False | 7200 | 364660223 | Sept. 26, 2014, 3:30 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 88 ) | E | MUH and Lots and Lots of Segments | PROGRAMMING | data structures dsu | 2700 |
Polar bears Menshykov and Uslada from the zoo of St. Petersburg and elephant Horace from the zoo of Kiev decided to do some painting. As they were trying to create their first masterpiece, they made a draft on a piece of paper. The draft consists of n segments. Each segment was either horizontal or vertical. Now the friends want to simplify the draft by deleting some segments or parts of segments so that the final masterpiece meets three conditions: Horace wants to be able to paint the whole picture in one stroke: by putting the brush on the paper and never taking it off until the picture is ready. The brush can paint the same place multiple times. That's why all the remaining segments must form a single connected shape. Menshykov wants the resulting shape to be simple. He defines a simple shape as a shape that doesn't contain any cycles. Initially all the segment on the draft have integer startpoint and endpoint coordinates. Uslada doesn't like real coordinates and she wants this condition to be fulfilled after all the changes. As in other parts the draft is already beautiful, the friends decided to delete such parts of the draft that the sum of lengths of the remaining segments is as large as possible. Your task is to count this maximum sum of the lengths that remain after all the extra segments are removed. The first line of the input contains integer n ( 1 ≤ n ≤ 2·10 5 ) — the number of segments on the draft. The next n lines contain four integers each: x 1 , y 1 , x 2 , y 2 ( - 10 9 ≤ x 1 ≤ x 2 ≤ 10 9 ; - 10 9 ≤ y 1 ≤ y 2 ≤ 10 9 ) — the two startpoint and the two endpoint coordinates of a segment. All segments are non-degenerative and either are strictly horizontal or strictly vertical. No two horizontal segments share common points. No two vertical segments share common points. Print a single integer — the maximum sum of lengths for the remaining segments. The shapes that you can get in the two given samples are: In the first sample you need to delet |
| Codeforces Round #269 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 34534452 | zyding | E | Jan. 25, 2018, 3:27 a.m. | OK | GNU C++ | TESTS | 30 | 249 | 37376000 | 2700 | |
| 14801295 | 131131yhx | E | Dec. 14, 2015, 11:41 a.m. | OK | GNU C++ | TESTS | 30 | 358 | 112128000 | 2700 | |
| 14801126 | 131131yhx | E | Dec. 14, 2015, 11:28 a.m. | OK | GNU C++ | TESTS | 30 | 358 | 112128000 | 2700 | |
| 36221066 | vjudge1 | E | March 12, 2018, 11:01 a.m. | OK | GNU C++ | TESTS | 30 | 374 | 36352000 | 2700 | |
| 34521488 | zyding | E | Jan. 24, 2018, 3:29 p.m. | OK | GNU C++ | TESTS | 30 | 405 | 51814400 | 2700 | |
| 27538544 | miaom | E | June 3, 2017, 7:37 a.m. | OK | GNU C++ | TESTS | 30 | 421 | 158003200 | 2700 | |
| 8020142 | yubowenok | E | Sept. 29, 2014, 4:08 a.m. | OK | GNU C++ | TESTS | 30 | 467 | 59699200 | 2700 | |
| 8930532 | krijgertje | E | Dec. 2, 2014, 10:28 a.m. | OK | GNU C++ | TESTS | 30 | 499 | 20070400 | 2700 | |
| 10123426 | skywalkert | E | March 2, 2015, 6:02 p.m. | OK | GNU C++ | TESTS | 30 | 561 | 34508800 | 2700 | |
| 7988870 | KrK | E | Sept. 27, 2014, 8:54 p.m. | OK | GNU C++ | TESTS | 30 | 561 | 49356800 | 2700 | |
| 7978166 | marat.snowbear | E | Sept. 26, 2014, 11:56 p.m. | OK | GNU C++0x | TESTS | 30 | 530 | 31436800 | 2700 | |
| 8024994 | zimpha | E | Sept. 29, 2014, 12:42 p.m. | OK | GNU C++0x | TESTS | 30 | 561 | 40755200 | 2700 | |
| 8041095 | Monyura | E | Sept. 30, 2014, 9:50 p.m. | OK | GNU C++0x | TESTS | 30 | 795 | 53350400 | 2700 | |
| 7988488 | IgorAkhmetov | E | Sept. 27, 2014, 7:46 p.m. | OK | GNU C++0x | TESTS | 30 | 888 | 24883200 | 2700 | |
| 7985219 | andrew.volchek | E | Sept. 27, 2014, 1:16 p.m. | OK | GNU C++0x | TESTS | 30 | 982 | 36966400 | 2700 | |
| 40987867 | ReaLNero1 | E | July 30, 2018, 9:33 p.m. | OK | GNU C++11 | TESTS | 30 | 296 | 24268800 | 2700 | |
| 34623292 | ohweonfire | E | Jan. 28, 2018, 4:47 a.m. | OK | GNU C++11 | TESTS | 30 | 312 | 26316800 | 2700 | |
| 51373323 | Zhang_RQ | E | March 16, 2019, 1:01 p.m. | OK | GNU C++11 | TESTS | 30 | 343 | 59392000 | 2700 | |
| 51373719 | Zhang_RQ | E | March 16, 2019, 1:11 p.m. | OK | GNU C++11 | TESTS | 30 | 358 | 59289600 | 2700 | |
| 67274984 | ElangBondol | E | Dec. 20, 2019, 9:50 a.m. | OK | GNU C++11 | TESTS | 30 | 374 | 158003200 | 2700 | |
| 57818882 | py_ultron | E | July 26, 2019, 9:29 p.m. | OK | GNU C++11 | TESTS | 30 | 374 | 158003200 | 2700 | |
| 57888486 | lopare | E | July 28, 2019, 10:55 a.m. | OK | GNU C++11 | TESTS | 30 | 389 | 158003200 | 2700 | |
| 14800895 | joisino | E | Dec. 14, 2015, 11:11 a.m. | OK | GNU C++11 | TESTS | 30 | 452 | 77516800 | 2700 | |
| 14800929 | joisino | E | Dec. 14, 2015, 11:14 a.m. | OK | GNU C++11 | TESTS | 30 | 467 | 77516800 | 2700 | |
| 14652960 | MiFaFaOvO | E | Dec. 4, 2015, 6:17 p.m. | OK | GNU C++11 | TESTS | 30 | 483 | 295628800 | 2700 | |
| 51942719 | ccsu_cat_love_jiejie | E | March 28, 2019, 3:13 p.m. | OK | GNU C++14 | TESTS | 30 | 405 | 158105600 | 2700 | |
| 67958648 | mota_haathi | E | Dec. 30, 2019, 10:41 a.m. | OK | GNU C++14 | TESTS | 30 | 420 | 158003200 | 2700 | |
| 51932207 | ccsu_cat_love_jiejie | E | March 28, 2019, 10:58 a.m. | OK | GNU C++14 | TESTS | 30 | 421 | 158003200 | 2700 | |
| 23515946 | Ali.Pi | E | Jan. 3, 2017, 12:10 p.m. | OK | GNU C++14 | TESTS | 30 | 577 | 51302400 | 2700 | |
| 36734801 | CQzhangyu | E | March 29, 2018, 11:14 p.m. | OK | GNU C++14 | TESTS | 30 | 748 | 39628800 | 2700 | |
| 60476869 | ruo | E | Sept. 13, 2019, 8:37 a.m. | OK | GNU C++17 | TESTS | 30 | 374 | 101171200 | 2700 | |
| 51373238 | Zhang_RQ | E | March 16, 2019, 12:59 p.m. | OK | GNU C++17 | TESTS | 30 | 390 | 59494400 | 2700 | |
| 45988925 | Shayan.P | E | Nov. 20, 2018, 8:32 a.m. | OK | GNU C++17 | TESTS | 30 | 561 | 45260800 | 2700 | |
| 39656736 | gepardo | E | June 25, 2018, 5:43 p.m. | OK | GNU C++17 | TESTS | 30 | 717 | 41676800 | 2700 | |
| 39656769 | gepardo | E | June 25, 2018, 5:44 p.m. | OK | GNU C++17 | TESTS | 30 | 780 | 41676800 | 2700 |
Back to search problems