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"Hag is a very talented person. He has always had an artist inside him but his father forced him to study mechanical engineering. Yesterday he spent all of his time cutting a giant piece of wood trying to make it look like a goose. Anyway, his dad found out that he was doing arts rather than studying mechanics and other boring subjects. He confronted Hag with the fact that he is a spoiled son that does not care about his future, and if he continues to do arts he will cut his 25 Lira monthly allowance. Hag is trying to prove to his dad that the wooden piece is a project for mechanics subject. He also told his dad that the wooden piece is a strictly convex polygon with n vertices. Hag brought two pins and pinned the polygon with them in the 1 -st and 2 -nd vertices to the wall. His dad has q queries to Hag of two types. Please help Hag to answer his father's queries. You can assume that the wood that forms the polygon has uniform density and the polygon has a positive thickness, same in all points. After every query of the 1-st type Hag's dad tries to move the polygon a bit and watches it stabilize again. The first line contains two integers n and q ( 3 <= q n <= q 10 ,000 , 1 <= q q <= q 200000 ) -- the number of vertices in the polygon and the number of queries. The next n lines describe the wooden polygon, the i -th line contains two integers x_i and y_i ( |x_i|, |y_i| <= q 10^8 ) -- the coordinates of the i -th vertex of the polygon. It is guaranteed that polygon is strictly convex and the vertices are given in the counter-clockwise order and all vertices are distinct. The next q lines describe the queries, one per line. Each query starts with its type 1 or 2 . Each query of the first type continues with two integers f and t ( 1 <= f, t <= n ) -- the vertex the pin is taken from, and the vertex the pin is put to and the polygon finishes rotat"... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
37825807 |
rainboy |
E |
May 1, 2018, 9:13 p.m. |
OK |
GNU C |
TESTS |
31 |
312 |
3686400 |
|
3000 |
38110831 |
a1214034447 |
E |
May 11, 2018, 10:14 a.m. |
OK |
GNU C |
TESTS |
31 |
327 |
3993600 |
|
3000 |
40932303 |
ReaLNero1 |
E |
July 30, 2018, 1:42 a.m. |
OK |
GNU C++ |
TESTS |
31 |
218 |
409600 |
|
3000 |
38186308 |
Scut82 |
E |
May 13, 2018, 11:25 a.m. |
OK |
GNU C++ |
TESTS |
31 |
233 |
4198400 |
|
3000 |
38206143 |
Scut82 |
E |
May 14, 2018, 5:21 a.m. |
OK |
GNU C++ |
TESTS |
31 |
248 |
4300800 |
|
3000 |
38935548 |
vjudge5 |
E |
June 4, 2018, 5:59 a.m. |
OK |
GNU C++ |
TESTS |
31 |
249 |
3993600 |
|
3000 |
38251343 |
Scut82 |
E |
May 14, 2018, 10:33 p.m. |
OK |
GNU C++ |
TESTS |
31 |
249 |
4300800 |
|
3000 |
38150174 |
-Invoid |
E |
May 13, 2018, 1:04 a.m. |
OK |
GNU C++ |
TESTS |
31 |
421 |
3993600 |
|
3000 |
41929197 |
vjudge2 |
E |
Aug. 21, 2018, 9:05 a.m. |
OK |
GNU C++ |
TESTS |
31 |
436 |
6041600 |
|
3000 |
37825953 |
begv |
E |
May 1, 2018, 9:25 p.m. |
OK |
GNU C++ |
TESTS |
31 |
1778 |
8396800 |
|
3000 |
38648356 |
vjudge2 |
E |
May 27, 2018, 6:07 a.m. |
OK |
GNU C++ |
TESTS |
31 |
1872 |
512000 |
|
3000 |
38001159 |
guille |
E |
May 7, 2018, 3:59 p.m. |
OK |
GNU C++ |
TESTS |
31 |
2043 |
12390400 |
|
3000 |
37822117 |
A.Freeman |
E |
May 1, 2018, 5:36 p.m. |
OK |
GNU C11 |
TESTS |
31 |
1014 |
3584000 |
|
3000 |
54331926 |
dyxg |
E |
May 18, 2019, 6:21 a.m. |
OK |
GNU C++11 |
TESTS |
31 |
202 |
9420800 |
|
3000 |
54506148 |
WOSHIGEPACHONG2 |
E |
May 23, 2019, 4 a.m. |
OK |
GNU C++11 |
TESTS |
31 |
218 |
9420800 |
|
3000 |
38472730 |
Never_See |
E |
May 21, 2018, 2:22 a.m. |
OK |
GNU C++11 |
TESTS |
31 |
234 |
716800 |
|
3000 |
38472698 |
Never_See |
E |
May 21, 2018, 2:19 a.m. |
OK |
GNU C++11 |
TESTS |
31 |
249 |
512000 |
|
3000 |
37828384 |
vjudge3 |
E |
May 2, 2018, 1:32 a.m. |
OK |
GNU C++11 |
TESTS |
31 |
249 |
3891200 |
|
3000 |
48867370 |
Gods |
E |
Jan. 24, 2019, 4:03 a.m. |
OK |
GNU C++11 |
TESTS |
31 |
264 |
6451200 |
|
3000 |
40625614 |
shiautsung |
E |
July 22, 2018, 5:52 a.m. |
OK |
GNU C++11 |
TESTS |
31 |
280 |
0 |
|
3000 |
68071138 |
hzk_cpp |
E |
Jan. 2, 2020, 10:21 a.m. |
OK |
GNU C++11 |
TESTS |
31 |
280 |
204800 |
|
3000 |
37930056 |
krijgertje |
E |
May 6, 2018, 1:20 p.m. |
OK |
GNU C++11 |
TESTS |
31 |
280 |
5120000 |
|
3000 |
37996947 |
DeaphetS |
E |
May 7, 2018, 1:37 p.m. |
OK |
GNU C++11 |
TESTS |
31 |
280 |
5939200 |
|
3000 |
68069531 |
vjudge5 |
E |
Jan. 2, 2020, 9:37 a.m. |
OK |
GNU C++14 |
TESTS |
31 |
342 |
204800 |
|
3000 |
53221982 |
Shedneryan |
E |
April 24, 2019, 12:20 p.m. |
OK |
GNU C++14 |
TESTS |
31 |
342 |
614400 |
|
3000 |
45229642 |
bi11a1 |
E |
Nov. 3, 2018, 6:13 a.m. |
OK |
GNU C++14 |
TESTS |
31 |
373 |
307200 |
|
3000 |
37980715 |
ThePhenomenal |
E |
May 6, 2018, 9:40 p.m. |
OK |
GNU C++14 |
TESTS |
31 |
373 |
4198400 |
|
3000 |
42484752 |
HIT_Zero |
E |
Sept. 5, 2018, 8:18 a.m. |
OK |
GNU C++14 |
TESTS |
31 |
374 |
307200 |
|
3000 |
38350040 |
songpengyu |
E |
May 17, 2018, 1:14 p.m. |
OK |
GNU C++14 |
TESTS |
31 |
374 |
409600 |
|
3000 |
52642590 |
hank55663 |
E |
April 12, 2019, 1:07 p.m. |
OK |
GNU C++14 |
TESTS |
31 |
374 |
512000 |
|
3000 |
37829307 |
fshp971 |
E |
May 2, 2018, 2:57 a.m. |
OK |
GNU C++14 |
TESTS |
31 |
374 |
3788800 |
|
3000 |
59617571 |
cz_xuyixuan |
E |
Aug. 28, 2019, 1:13 p.m. |
OK |
GNU C++14 |
TESTS |
31 |
374 |
4812800 |
|
3000 |
46053195 |
minson123 |
E |
Nov. 22, 2018, 9:12 a.m. |
OK |
GNU C++14 |
TESTS |
31 |
389 |
204800 |
|
3000 |
50302442 |
201530800126 |
E |
Feb. 22, 2019, 3:28 a.m. |
OK |
GNU C++17 |
TESTS |
31 |
358 |
204800 |
|
3000 |
46651017 |
Zerpro |
E |
Dec. 5, 2018, 2:02 p.m. |
OK |
GNU C++17 |
TESTS |
31 |
358 |
307200 |
|
3000 |
58679871 |
gtx1080 |
E |
Aug. 12, 2019, 6:22 p.m. |
OK |
GNU C++17 |
TESTS |
31 |
374 |
409600 |
|
3000 |
41926629 |
liji |
E |
Aug. 21, 2018, 7:49 a.m. |
OK |
GNU C++17 |
TESTS |
31 |
374 |
512000 |
|
3000 |
69072079 |
I-Love-Islam |
E |
Jan. 18, 2020, 10:58 p.m. |
OK |
GNU C++17 |
TESTS |
31 |
374 |
819200 |
|
3000 |
37826573 |
WNG |
E |
May 1, 2018, 10:27 p.m. |
OK |
GNU C++17 |
TESTS |
31 |
389 |
3891200 |
|
3000 |
41121337 |
3016218074 |
E |
Aug. 2, 2018, 12:07 p.m. |
OK |
GNU C++17 |
TESTS |
31 |
390 |
204800 |
|
3000 |
37829298 |
lintoto |
E |
May 2, 2018, 2:56 a.m. |
OK |
GNU C++17 |
TESTS |
31 |
390 |
3686400 |
|
3000 |
41926277 |
liji |
E |
Aug. 21, 2018, 7:38 a.m. |
OK |
GNU C++17 |
TESTS |
31 |
405 |
512000 |
|
3000 |
37834890 |
zjhl2 |
E |
May 2, 2018, 9 a.m. |
OK |
GNU C++17 |
TESTS |
31 |
405 |
3584000 |
|
3000 |
37890938 |
unicorn20141 |
E |
May 4, 2018, 7:58 p.m. |
OK |
Java 8 |
TESTS |
31 |
592 |
45875200 |
|
3000 |
38211726 |
7dan |
E |
May 14, 2018, 10:43 a.m. |
OK |
Java 8 |
TESTS |
31 |
608 |
21094400 |
|
3000 |
38152310 |
tdx |
E |
May 13, 2018, 4:50 a.m. |
OK |
Java 8 |
TESTS |
31 |
639 |
21094400 |
|
3000 |
38152138 |
tdx |
E |
May 13, 2018, 4:34 a.m. |
OK |
Java 8 |
TESTS |
31 |
670 |
21094400 |
|
3000 |
38988964 |
MizuhashiParsee |
E |
June 6, 2018, 8:56 a.m. |
OK |
Java 8 |
TESTS |
31 |
841 |
102400 |
|
3000 |
37824606 |
uwi |
E |
May 1, 2018, 7:37 p.m. |
OK |
Java 8 |
TESTS |
31 |
997 |
21913600 |
|
3000 |
37821761 |
Dukkha |
E |
May 1, 2018, 5:23 p.m. |
OK |
Java 8 |
TESTS |
31 |
1060 |
22016000 |
|
3000 |
37825190 |
SecondThread |
E |
May 1, 2018, 8:22 p.m. |
OK |
Java 8 |
TESTS |
31 |
1138 |
22016000 |
|
3000 |
37824291 |
SecondThread |
E |
May 1, 2018, 7:19 p.m. |
OK |
Java 8 |
TESTS |
31 |
1154 |
21913600 |
|
3000 |
37825639 |
tbuzzelli |
E |
May 1, 2018, 8:58 p.m. |
OK |
Java 8 |
TESTS |
31 |
1169 |
22016000 |
|
3000 |
37986259 |
wj2dy |
E |
May 7, 2018, 6:07 a.m. |
OK |
MS C++ |
TESTS |
31 |
311 |
3993600 |
|
3000 |
37913182 |
wolffd |
E |
May 5, 2018, 6:57 p.m. |
OK |
PyPy 2 |
TESTS |
31 |
2308 |
31641600 |
|
3000 |
37835769 |
neverwin |
E |
May 2, 2018, 9:49 a.m. |
OK |
PyPy 3 |
TESTS |
31 |
1559 |
29388800 |
|
3000 |
38085610 |
Yee_172 |
E |
May 10, 2018, 5:43 a.m. |
OK |
PyPy 3 |
TESTS |
31 |
1560 |
44953600 |
|
3000 |
37859061 |
nhho |
E |
May 3, 2018, 10:32 a.m. |
OK |
Python 3 |
TESTS |
31 |
1185 |
17305600 |
|
3000 |
38435045 |
Ali_Pi |
E |
May 19, 2018, 3:14 p.m. |
OK |
Python 3 |
TESTS |
31 |
1232 |
10444800 |
|
3000 |
37835814 |
neverwin |
E |
May 2, 2018, 9:52 a.m. |
OK |
Python 3 |
TESTS |
31 |
1840 |
7475200 |
|
3000 |
38085596 |
Yee_172 |
E |
May 10, 2018, 5:42 a.m. |
OK |
Python 3 |
TESTS |
31 |
2027 |
18329600 |
|
3000 |
38085664 |
Yee_172 |
E |
May 10, 2018, 5:47 a.m. |
OK |
Python 3 |
TESTS |
31 |
2058 |
17920000 |
|
3000 |
37912848 |
wolffd |
E |
May 5, 2018, 6:31 p.m. |
OK |
Python 3 |
TESTS |
31 |
2074 |
8089600 |
|
3000 |
38080955 |
pyrus |
E |
May 9, 2018, 8:49 p.m. |
OK |
Python 3 |
TESTS |
31 |
2136 |
23449600 |
|
3000 |
37865408 |
Korrah |
E |
May 3, 2018, 2:41 p.m. |
OK |
Python 3 |
TESTS |
31 |
2152 |
15872000 |
|
3000 |
remove filters
Back to search problems