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 |
---|---|---|---|---|---|---|
1381 | Codeforces Round 658 (Div. 1) | FINISHED | False | 7200 | 142010711 | July 21, 2020, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 269 ) | E | Origami | PROGRAMMING | geometry math sortings | 3300 |
B"After being discouraged by 13 time-limit-exceeded verdicts on an ugly geometry problem, you decided to take a relaxing break for arts and crafts. There is a piece of paper in the shape of a simple polygon with n vertices. The polygon may be non-convex, but we all know that proper origami paper has the property that any horizontal line intersects the boundary of the polygon in at most two points. If you fold the paper along the vertical line x=f , what will be the area of the resulting shape? When you fold, the part of the paper to the left of the line is symmetrically reflected on the right side. Your task is to answer q independent queries for values f_1, ldots,f_q . The first line contains two integers n , q ( 3 <= n <= 10^5, 1 <= q <= 10^5 ) -- the number of polygon vertices and queries, respectively. Each of the next n lines contains two integers x_i , y_i ( |x_i|, |y_i| <= 10^5 ) -- the coordinates of the i -th point of the polygon. The polygon has an edge connecting each pair of adjacent points in the input, and also an edge between (x_1,y_1) and (x_n,y_n) . It is guaranteed that the polygon is non-degenerate and that any horizontal line intersects the boundary of the polygon in at most two points. In particular, no boundary edge is strictly horizontal. Two adjacent sides may be collinear. Each of the next q lines contains a single integer f_i ( min limits_{j=1}^n(x_j)< f_i< max limits_{j=1}^n(x_j) ) -- the x -coordinate of the i -th fold query. It is guaranteed that all f_i are distinct. For each query, output the area A_i of the paper if you fold it along the line x=f_i . Your answer is considered correct if its absolute or relative error does not exceed 10^{-4} . Formally, let your answer be a , and the jury's answer be b . Your answer is accepted if and only if frac{|a - b|}{ max{(1, |b|)}} <= 10^{-4}"... |
Codeforces Round #658 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
87584998 | rainboy | E | July 21, 2020, 4:16 p.m. | OK | GNU C11 | TESTS | 35 | 1465 | 59801600 | 3300 | |
87630708 | tzaph_ | E | July 22, 2020, 4:08 a.m. | OK | GNU C++14 | TESTS | 35 | 904 | 42700800 | 3300 | |
87622599 | rama_pang | E | July 22, 2020, 1:10 a.m. | OK | GNU C++14 | TESTS | 35 | 1107 | 31539200 | 3300 | |
87584976 | Errichto | E | July 21, 2020, 4:16 p.m. | OK | GNU C++17 | TESTS | 35 | 312 | 35635200 | 3300 | |
87574089 | Baklazan | E | July 21, 2020, 3:52 p.m. | OK | GNU C++17 | TESTS | 35 | 545 | 54681600 | 3300 | |
87616965 | Jatana | E | July 21, 2020, 9:57 p.m. | OK | GNU C++17 | TESTS | 35 | 592 | 88166400 | 3300 | |
87630011 | __fr__y__ | E | July 22, 2020, 3:54 a.m. | OK | GNU C++17 | TESTS | 35 | 935 | 97075200 | 3300 | |
87567737 | Benq | E | July 21, 2020, 3:39 p.m. | OK | GNU C++17 | TESTS | 35 | 967 | 97075200 | 3300 | |
87589949 | ksun48 | E | July 21, 2020, 4:27 p.m. | OK | GNU C++17 | TESTS | 35 | 2496 | 83763200 | 3300 | |
87597504 | jiangly | E | July 21, 2020, 5:30 p.m. | OK | GNU C++17 (64) | TESTS | 35 | 311 | 57139200 | 3300 | |
87615103 | w0nsh | E | July 21, 2020, 9:12 p.m. | OK | GNU C++17 (64) | TESTS | 35 | 405 | 105574400 | 3300 | |
87611342 | Monogon | E | July 21, 2020, 7:59 p.m. | OK | GNU C++17 (64) | TESTS | 35 | 530 | 33894400 | 3300 | |
87596216 | ecnerwala | E | July 21, 2020, 5:24 p.m. | OK | GNU C++17 (64) | TESTS | 35 | 546 | 22118400 | 3300 | |
87597449 | Ari | E | July 21, 2020, 5:30 p.m. | OK | GNU C++17 (64) | TESTS | 35 | 795 | 34201600 | 3300 | |
87589785 | Petr | E | July 21, 2020, 4:27 p.m. | OK | GNU C++17 (64) | TESTS | 35 | 811 | 56627200 | 3300 | |
87620112 | Golovanov399 | E | July 21, 2020, 11:39 p.m. | OK | GNU C++17 (64) | TESTS | 35 | 2370 | 39731200 | 3300 |
Back to search problems