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 |
|---|---|---|---|---|---|---|
| 607 | Codeforces Round 336 (Div. 1) | FINISHED | False | 7200 | 325517123 | Dec. 23, 2015, 4:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 291 ) | E | Cross Sum | PROGRAMMING | binary search geometry | 3300 |
Genos has been given n distinct lines on the Cartesian plane. Let be a list of intersection points of these lines. A single point might appear multiple times in this list if it is the intersection of multiple pairs of lines. The order of the list does not matter. Given a query point ( p , q ) , let be the corresponding list of distances of all points in to the query point. Distance here refers to euclidean distance. As a refresher, the euclidean distance between two points ( x 1 , y 1 ) and ( x 2 , y 2 ) is . Genos is given a point ( p , q ) and a positive integer m . He is asked to find the sum of the m smallest elements in . Duplicate elements in are treated as separate elements. Genos is intimidated by Div1 E problems so he asked for your help. The first line of the input contains a single integer n ( 2 ≤ n ≤ 50 000 ) — the number of lines. The second line contains three integers x , y and m ( | x |, | y | ≤ 1 000 000 , ) — the encoded coordinates of the query point and the integer m from the statement above. The query point ( p , q ) is obtained as . In other words, divide x and y by 1000 to get the actual query point. denotes the length of the list and it is guaranteed that . Each of the next n lines contains two integers a i and b i ( | a i |, | b i | ≤ 1 000 000 ) — the parameters for a line of the form: . It is guaranteed that no two lines are the same, that is ( a i , b i ) ≠ ( a j , b j ) if i ≠ j . Print a single real number, the sum of m smallest elements of . Your answer will be considered correct if its absolute or relative error does not exceed 10 - 6 . To clarify, let's assume that your answer is a and the answer of the jury is b . The checker program will consider your answer correct if . In the first sample, the three closest points have distances and . In the second sample, the two lines y = 1000 x - 1000 and intersect at (2000000, 1999999000) . This point has a distance of from ( - 1000, - 1000) . In the third sample, the three lines al |
| Codeforces Round #336 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 29214986 | laofudasuan | E | Aug. 5, 2017, 9:30 a.m. | OK | GNU C++ | TESTS | 58 | 1544 | 11776000 | 3300 | |
| 29214979 | laofudasuan | E | Aug. 5, 2017, 9:29 a.m. | OK | GNU C++ | TESTS | 58 | 1544 | 11776000 | 3300 | |
| 35896151 | _____k_____ | E | March 3, 2018, 5:03 p.m. | OK | GNU C++ | TESTS | 58 | 1560 | 11673600 | 3300 | |
| 35895549 | ______n______ | E | March 3, 2018, 4:47 p.m. | OK | GNU C++ | TESTS | 58 | 1560 | 11673600 | 3300 | |
| 35895312 | ______u______ | E | March 3, 2018, 4:41 p.m. | OK | GNU C++ | TESTS | 58 | 1560 | 11673600 | 3300 | |
| 35895137 | _____i_____ | E | March 3, 2018, 4:36 p.m. | OK | GNU C++ | TESTS | 58 | 1560 | 11673600 | 3300 | |
| 35893276 | ______i______ | E | March 3, 2018, 3:47 p.m. | OK | GNU C++ | TESTS | 58 | 1560 | 11673600 | 3300 | |
| 35887019 | ______h______ | E | March 3, 2018, 1:57 p.m. | OK | GNU C++ | TESTS | 58 | 1560 | 11673600 | 3300 | |
| 35886607 | ______k______ | E | March 3, 2018, 1:50 p.m. | OK | GNU C++ | TESTS | 58 | 1560 | 11673600 | 3300 | |
| 35883636 | ______M______ | E | March 3, 2018, 12:57 p.m. | OK | GNU C++ | TESTS | 58 | 1560 | 11673600 | 3300 | |
| 15153842 | Al.Cash | E | Jan. 1, 2016, 11:19 p.m. | OK | GNU C++11 | TESTS | 58 | 1060 | 6348800 | 3300 | |
| 15157081 | Al.Cash | E | Jan. 2, 2016, 10:11 a.m. | OK | GNU C++11 | TESTS | 58 | 1076 | 6348800 | 3300 | |
| 40985544 | ReaLNero1 | E | July 30, 2018, 8 p.m. | OK | GNU C++11 | TESTS | 58 | 1107 | 6348800 | 3300 | |
| 15153835 | Al.Cash | E | Jan. 1, 2016, 11:17 p.m. | OK | GNU C++11 | TESTS | 58 | 1356 | 6348800 | 3300 | |
| 52252970 | _AxclbkJ_ | E | April 3, 2019, 2:46 a.m. | OK | GNU C++11 | TESTS | 58 | 1372 | 8089600 | 3300 | |
| 52252887 | _AxclbkJ_ | E | April 3, 2019, 2:40 a.m. | OK | GNU C++11 | TESTS | 58 | 1372 | 8089600 | 3300 | |
| 69820447 | tacmon | E | Jan. 30, 2020, 7:38 a.m. | OK | GNU C++11 | TESTS | 58 | 1482 | 8908800 | 3300 | |
| 64747060 | Lagoon_ | E | Nov. 12, 2019, 1:54 p.m. | OK | GNU C++11 | TESTS | 58 | 1497 | 66150400 | 3300 | |
| 15038765 | pacu | E | Dec. 27, 2015, 1:45 a.m. | OK | GNU C++11 | TESTS | 58 | 1528 | 21504000 | 3300 | |
| 15038756 | pacu | E | Dec. 27, 2015, 1:43 a.m. | OK | GNU C++11 | TESTS | 58 | 1528 | 21504000 | 3300 | |
| 67992346 | cz_xuyixuan | E | Dec. 31, 2019, 5:55 a.m. | OK | GNU C++14 | TESTS | 58 | 1466 | 6656000 | 3300 | |
| 63831131 | Cyanic | E | Oct. 30, 2019, 1:40 p.m. | OK | GNU C++14 | TESTS | 58 | 1512 | 9011200 | 3300 | |
| 67704964 | ytxytx | E | Dec. 27, 2019, 2:47 p.m. | OK | GNU C++14 | TESTS | 58 | 1560 | 5836800 | 3300 | |
| 38253478 | kut_kjb1994 | E | May 15, 2018, 1:53 a.m. | OK | GNU C++14 | TESTS | 58 | 1560 | 10035200 | 3300 | |
| 63831083 | Cyanic | E | Oct. 30, 2019, 1:39 p.m. | OK | GNU C++14 | TESTS | 58 | 1575 | 9011200 | 3300 | |
| 66643185 | nealchen | E | Dec. 11, 2019, 3:35 p.m. | OK | GNU C++14 | TESTS | 58 | 1606 | 6656000 | 3300 | |
| 37245730 | nqiiii | E | April 12, 2018, 10:38 a.m. | OK | GNU C++14 | TESTS | 58 | 1621 | 18124800 | 3300 | |
| 58943618 | Scut82 | E | Aug. 17, 2019, 7:59 a.m. | OK | GNU C++14 | TESTS | 58 | 1699 | 4812800 | 3300 | |
| 65530525 | apiadu | E | Nov. 22, 2019, 12:15 p.m. | OK | GNU C++14 | TESTS | 58 | 1762 | 5017600 | 3300 | |
| 63830547 | Cyanic | E | Oct. 30, 2019, 1:31 p.m. | OK | GNU C++14 | TESTS | 58 | 1762 | 9011200 | 3300 | |
| 69831455 | gongsuidashen | E | Jan. 30, 2020, 10:36 a.m. | OK | GNU C++17 | TESTS | 58 | 1357 | 8192000 | 3300 | |
| 67685181 | Elegia | E | Dec. 27, 2019, 8:32 a.m. | OK | GNU C++17 | TESTS | 58 | 1528 | 6041600 | 3300 | |
| 63722756 | vjudge5 | E | Oct. 29, 2019, 11:49 a.m. | OK | GNU C++17 | TESTS | 58 | 1903 | 6860800 | 3300 | |
| 63722486 | LJZ_C | E | Oct. 29, 2019, 11:45 a.m. | OK | GNU C++17 | TESTS | 58 | 1918 | 6860800 | 3300 | |
| 63372289 | AprilGrimoire | E | Oct. 25, 2019, 9:49 a.m. | OK | GNU C++17 | TESTS | 58 | 3229 | 8806400 | 3300 | |
| 66019300 | ppc_qjd | E | Nov. 30, 2019, 6:45 a.m. | OK | GNU C++17 | TESTS | 58 | 3478 | 7168000 | 3300 | |
| 68660893 | ruo | E | Jan. 12, 2020, 1:36 p.m. | OK | GNU C++17 | TESTS | 58 | 3540 | 5222400 | 3300 | |
| 69906846 | jah_melon | E | Jan. 31, 2020, 2:21 p.m. | OK | GNU C++17 | TESTS | 58 | 3572 | 9932800 | 3300 | |
| 65579550 | mocania | E | Nov. 23, 2019, 10:33 a.m. | OK | GNU C++17 | TESTS | 58 | 5194 | 22732800 | 3300 | |
| 65334622 | HirasawaaYui | E | Nov. 19, 2019, 8:20 a.m. | OK | GNU C++17 | TESTS | 58 | 6816 | 21811200 | 3300 | |
| 44824642 | tri | E | Oct. 25, 2018, 5:05 a.m. | OK | Java 8 | TESTS | 58 | 4320 | 3379200 | 3300 | |
| 17179290 | raggzy | E | April 6, 2016, 1:49 a.m. | OK | Java 8 | TESTS | 58 | 4633 | 39833600 | 3300 | |
| 28692789 | mualanhlung017 | E | July 19, 2017, 9:59 a.m. | OK | Java 8 | TESTS | 58 | 6848 | 269004800 | 3300 | |
| 15279637 | Los_Angelos_Laycurse | E | Jan. 10, 2016, 11:53 a.m. | OK | MS C++ | TESTS | 58 | 1465 | 8396800 | 3300 | |
| 15279626 | Los_Angelos_Laycurse | E | Jan. 10, 2016, 11:52 a.m. | OK | MS C++ | TESTS | 58 | 1465 | 8396800 | 3300 | |
| 15280069 | Los_Angelos_Laycurse | E | Jan. 10, 2016, 12:41 p.m. | OK | MS C++ | TESTS | 58 | 1482 | 8396800 | 3300 | |
| 15038709 | pacu | E | Dec. 27, 2015, 1:23 a.m. | OK | MS C++ | TESTS | 58 | 1794 | 21504000 | 3300 | |
| 15038677 | pacu | E | Dec. 27, 2015, 1:14 a.m. | OK | MS C++ | TESTS | 58 | 1856 | 21504000 | 3300 | |
| 15038695 | pacu | E | Dec. 27, 2015, 1:20 a.m. | OK | MS C++ | TESTS | 58 | 1872 | 21504000 | 3300 | |
| 15280055 | Los_Angelos_Laycurse | E | Jan. 10, 2016, 12:39 p.m. | OK | MS C++ | TESTS | 58 | 2573 | 8396800 | 3300 | |
| 15280060 | Los_Angelos_Laycurse | E | Jan. 10, 2016, 12:40 p.m. | OK | MS C++ | TESTS | 58 | 2698 | 8396800 | 3300 |
Back to search problems