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.
Problems
B'Denis holds a Geometers Anonymous Club meeting in SIS. He has prepared n convex polygons numbered from 1 to n for the club. He plans to offer members of the club to calculate Minkowski sums of these polygons. More precisely, he plans to give q tasks, the i -th of them asks to calculate the sum of Minkowski of polygons with indices from l_i to r_i inclusive. The sum of Minkowski of two sets A and B is the set C = {a + b : a in A, b in B } . It can be proven that if A and B are convex polygons then C will also be a convex polygon. To calculate the sum of Minkowski of p polygons ( p > 2 ), you need to calculate the sum of Minkowski of the first p - 1 polygons, and then calculate the sum of Minkowski of the resulting polygon and the p -th polygon. For the convenience of checking answers, Denis has decided to prepare and calculate the number of vertices in the sum of Minkowski for each task he prepared. Help him to do it. The first line of the input contains one integer n -- the number of convex polygons Denis prepared ( 1 <= n <= 100 ,000 ). Then n convex polygons follow. The description of the i -th polygon starts with one integer k_i -- the number of vertices in the i -th polygon ( 3 <= k_i ). The next k_i lines contain two integers x_{ij} , y_{ij} each -- coordinates of vertices of the i -th polygon in counterclockwise order ( |x_{ij}|, |y_{ij}| <= 10 ^ 9 ). It is guaranteed, that there are no three consecutive vertices lying on the same line. The total number of vertices over all polygons does not exceed 300 ,000 . The following line contains one integer q -- the number of tasks ( 1 <= q <= 100 ,000 ). The next q lines contain descriptions of tasks. Description of the i -th task contains two integers l_i and r_i ( 1 <= l_i <= r_i <= n ). For e'... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
59570973 |
ILoLy |
F |
Aug. 27, 2019, 12:34 p.m. |
OK |
GNU C++11 |
TESTS |
24 |
171 |
74444800 |
|
2700 |
57260030 |
FrozenBlood |
F |
July 18, 2019, 4:36 a.m. |
OK |
GNU C++11 |
TESTS |
22 |
187 |
29388800 |
|
2700 |
59570919 |
ILoLy |
F |
Aug. 27, 2019, 12:33 p.m. |
OK |
GNU C++11 |
TESTS |
24 |
187 |
74444800 |
|
2700 |
57242020 |
qkoqhh |
F |
July 17, 2019, 5:53 p.m. |
OK |
GNU C++11 |
TESTS |
22 |
218 |
14438400 |
|
2700 |
57634825 |
chenyewei_1234 |
F |
July 24, 2019, 10:17 a.m. |
OK |
GNU C++11 |
TESTS |
23 |
233 |
24166400 |
|
2700 |
57259622 |
chenyewei_1234 |
F |
July 18, 2019, 4:22 a.m. |
OK |
GNU C++11 |
TESTS |
22 |
233 |
24166400 |
|
2700 |
57259577 |
chenyewei_1234 |
F |
July 18, 2019, 4:20 a.m. |
OK |
GNU C++11 |
TESTS |
22 |
234 |
24166400 |
|
2700 |
57259554 |
chenyewei_1234 |
F |
July 18, 2019, 4:19 a.m. |
OK |
GNU C++11 |
TESTS |
22 |
234 |
24166400 |
|
2700 |
57259601 |
chenyewei_1234 |
F |
July 18, 2019, 4:21 a.m. |
OK |
GNU C++11 |
TESTS |
22 |
249 |
24166400 |
|
2700 |
57260388 |
AkaiLemon |
F |
July 18, 2019, 4:49 a.m. |
OK |
GNU C++11 |
TESTS |
22 |
264 |
26419200 |
|
2700 |
58917438 |
tokitsukaze |
F |
Aug. 16, 2019, 3:34 p.m. |
OK |
GNU C++14 |
TESTS |
24 |
280 |
27033600 |
|
2700 |
58917623 |
tokitsukaze |
F |
Aug. 16, 2019, 3:39 p.m. |
OK |
GNU C++14 |
TESTS |
24 |
295 |
27033600 |
|
2700 |
58917109 |
tokitsukaze |
F |
Aug. 16, 2019, 3:27 p.m. |
OK |
GNU C++14 |
TESTS |
24 |
327 |
24576000 |
|
2700 |
58130588 |
cuom1999 |
F |
Aug. 1, 2019, 2:08 p.m. |
OK |
GNU C++14 |
TESTS |
23 |
342 |
21708800 |
|
2700 |
57250793 |
schtomi97 |
F |
July 17, 2019, 10:44 p.m. |
OK |
GNU C++14 |
TESTS |
22 |
358 |
17612800 |
|
2700 |
58807756 |
Scut82 |
F |
Aug. 14, 2019, 9:34 a.m. |
OK |
GNU C++14 |
TESTS |
24 |
390 |
20275200 |
|
2700 |
57289405 |
Lagrang3 |
F |
July 18, 2019, 3:59 p.m. |
OK |
GNU C++14 |
TESTS |
22 |
420 |
21094400 |
|
2700 |
57286876 |
Lagrang3 |
F |
July 18, 2019, 2:59 p.m. |
OK |
GNU C++14 |
TESTS |
22 |
421 |
21094400 |
|
2700 |
57286604 |
Lagrang3 |
F |
July 18, 2019, 2:52 p.m. |
OK |
GNU C++14 |
TESTS |
22 |
421 |
21094400 |
|
2700 |
57312632 |
dlwocks31 |
F |
July 19, 2019, 7:03 a.m. |
OK |
GNU C++14 |
TESTS |
22 |
436 |
17203200 |
|
2700 |
57339108 |
neal |
F |
July 19, 2019, 5:35 p.m. |
OK |
GNU C++17 |
TESTS |
22 |
155 |
15257600 |
|
2700 |
57339071 |
neal |
F |
July 19, 2019, 5:34 p.m. |
OK |
GNU C++17 |
TESTS |
22 |
155 |
15257600 |
|
2700 |
57305912 |
neal |
F |
July 19, 2019, 3:44 a.m. |
OK |
GNU C++17 |
TESTS |
22 |
186 |
33382400 |
|
2700 |
57306007 |
neal |
F |
July 19, 2019, 3:49 a.m. |
OK |
GNU C++17 |
TESTS |
22 |
202 |
33382400 |
|
2700 |
59421582 |
lesskreker |
F |
Aug. 24, 2019, 9:31 p.m. |
OK |
GNU C++17 |
TESTS |
24 |
233 |
18739200 |
|
2700 |
57305980 |
neal |
F |
July 19, 2019, 3:47 a.m. |
OK |
GNU C++17 |
TESTS |
22 |
248 |
39628800 |
|
2700 |
57305973 |
neal |
F |
July 19, 2019, 3:47 a.m. |
OK |
GNU C++17 |
TESTS |
22 |
249 |
39628800 |
|
2700 |
69809969 |
LJZ_C |
F |
Jan. 30, 2020, 3:55 a.m. |
OK |
GNU C++17 |
TESTS |
24 |
280 |
16384000 |
|
2700 |
57510802 |
Qingyu |
F |
July 22, 2019, 1:43 p.m. |
OK |
GNU C++17 |
TESTS |
23 |
311 |
48230400 |
|
2700 |
57263799 |
nickluo |
F |
July 18, 2019, 6:22 a.m. |
OK |
GNU C++17 |
TESTS |
22 |
312 |
21401600 |
|
2700 |
57252570 |
dalt |
F |
July 18, 2019, 12:36 a.m. |
OK |
Java 8 |
TESTS |
22 |
686 |
33792000 |
|
2700 |
57567192 |
RANCAFE |
F |
July 23, 2019, 3:25 a.m. |
OK |
MS C++ 2017 |
TESTS |
23 |
529 |
23552000 |
|
2700 |
57454483 |
CrashMaster |
F |
July 21, 2019, 11:03 a.m. |
OK |
MS C++ 2017 |
TESTS |
23 |
811 |
20377600 |
|
2700 |
57299487 |
EbTech |
F |
July 18, 2019, 9:46 p.m. |
OK |
Rust |
TESTS |
22 |
311 |
14745600 |
|
2700 |
57299965 |
EbTech |
F |
July 18, 2019, 10:18 p.m. |
OK |
Rust |
TESTS |
22 |
327 |
14745600 |
|
2700 |
57333491 |
EbTech |
F |
July 19, 2019, 3:07 p.m. |
OK |
Rust |
TESTS |
22 |
342 |
14745600 |
|
2700 |
57298774 |
EbTech |
F |
July 18, 2019, 9:08 p.m. |
OK |
Rust |
TESTS |
22 |
405 |
14745600 |
|
2700 |
57333394 |
EbTech |
F |
July 19, 2019, 3:04 p.m. |
OK |
Rust |
TESTS |
22 |
468 |
14745600 |
|
2700 |
57550053 |
EbTech |
F |
July 22, 2019, 5:08 p.m. |
OK |
Rust |
TESTS |
23 |
592 |
162611200 |
|
2700 |
57548508 |
EbTech |
F |
July 22, 2019, 4:44 p.m. |
OK |
Rust |
TESTS |
23 |
639 |
211968000 |
|
2700 |
remove filters
Back to search problems