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'Inaka has a disc, the circumference of which is n units. The circumference is equally divided by n points numbered clockwise from 1 to n , such that points i and i + 1 ( 1 <= q i < n ) are adjacent, and so are points n and 1 . There are m straight segments on the disc, the endpoints of which are all among the aforementioned n points. Inaka wants to know if her image is rotationally symmetrical, i.e. if there is an integer k ( 1 <= q k < n ), such that if all segments are rotated clockwise around the center of the circle by k units, the new image will be the same as the original one. The first line contains two space-separated integers n and m ( 2 <= q n <= q 100 ,000 , 1 <= q m <= q 200 ,000 ) -- the number of points and the number of segments, respectively. The i -th of the following m lines contains two space-separated integers a_i and b_i ( 1 <= q a_i, b_i <= q n , a_i neq b_i ) that describe a segment connecting points a_i and b_i . It is guaranteed that no segments coincide. Output one line -- "Yes" if the image is rotationally symmetrical, and "No" otherwise (both excluding quotation marks). You can output each letter in any case (upper or lower). The first two examples are illustrated below. Both images become the same as their respective original ones after a clockwise rotation of 120 degrees around the center. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
63709562 |
MRoy |
B |
Oct. 29, 2019, 9:33 a.m. |
OK |
GNU C11 |
TESTS |
65 |
93 |
3174400 |
|
1900 |
55610352 |
ReaLNero1 |
B |
June 16, 2019, 5:17 a.m. |
OK |
GNU C++11 |
TESTS |
65 |
46 |
3379200 |
|
1900 |
53954810 |
ProphetStorm |
B |
May 10, 2019, 11:26 a.m. |
OK |
GNU C++11 |
TESTS |
65 |
46 |
3379200 |
|
1900 |
53805713 |
newbiechdboom0 |
B |
May 6, 2019, 12:23 a.m. |
OK |
GNU C++11 |
TESTS |
65 |
61 |
9420800 |
|
1900 |
57335228 |
whydotlet |
B |
July 19, 2019, 3:48 p.m. |
OK |
GNU C++11 |
TESTS |
65 |
62 |
1638400 |
|
1900 |
53982726 |
ffffxk |
B |
May 11, 2019, 8 a.m. |
OK |
GNU C++11 |
TESTS |
65 |
78 |
4812800 |
|
1900 |
55057344 |
bhaag_milkha |
B |
June 3, 2019, 7:40 p.m. |
OK |
GNU C++11 |
TESTS |
65 |
93 |
5939200 |
|
1900 |
55235218 |
QF_OI |
B |
June 7, 2019, 8:02 a.m. |
OK |
GNU C++11 |
TESTS |
65 |
93 |
7577600 |
|
1900 |
68102574 |
vjudge4 |
B |
Jan. 3, 2020, 4:41 a.m. |
OK |
GNU C++11 |
TESTS |
65 |
93 |
7577600 |
|
1900 |
64626402 |
vjudge4 |
B |
Nov. 10, 2019, 8:40 a.m. |
OK |
GNU C++11 |
TESTS |
65 |
108 |
5529600 |
|
1900 |
67162084 |
Pyqe |
B |
Dec. 18, 2019, 2:17 p.m. |
OK |
GNU C++11 |
TESTS |
65 |
108 |
7065600 |
|
1900 |
53770320 |
tjd229 |
B |
May 5, 2019, 4:38 a.m. |
OK |
GNU C++14 |
TESTS |
65 |
108 |
4915200 |
|
1900 |
65945371 |
MELNIKOFF_OLEG |
B |
Nov. 29, 2019, 8:22 a.m. |
OK |
GNU C++14 |
TESTS |
65 |
109 |
4300800 |
|
1900 |
54894468 |
_-o.0-_ |
B |
June 1, 2019, 12:45 a.m. |
OK |
GNU C++14 |
TESTS |
65 |
109 |
4915200 |
|
1900 |
53749916 |
ACRush |
B |
May 4, 2019, 5:23 p.m. |
OK |
GNU C++14 |
TESTS |
64 |
109 |
4915200 |
|
1900 |
58390994 |
HouZAJ |
B |
Aug. 6, 2019, 1:42 p.m. |
OK |
GNU C++14 |
TESTS |
65 |
124 |
3174400 |
|
1900 |
53835527 |
davidberard |
B |
May 7, 2019, 2:20 a.m. |
OK |
GNU C++14 |
TESTS |
65 |
124 |
3891200 |
|
1900 |
54026542 |
lamjed_gaidi |
B |
May 12, 2019, 12:58 p.m. |
OK |
GNU C++14 |
TESTS |
65 |
124 |
4915200 |
|
1900 |
64630699 |
ljaneczk |
B |
Nov. 10, 2019, 10:04 a.m. |
OK |
GNU C++14 |
TESTS |
65 |
124 |
4915200 |
|
1900 |
62319458 |
derrickball |
B |
Oct. 10, 2019, 4:16 p.m. |
OK |
GNU C++14 |
TESTS |
65 |
124 |
4915200 |
|
1900 |
54017166 |
p1rattttt |
B |
May 12, 2019, 7:28 a.m. |
OK |
GNU C++14 |
TESTS |
65 |
124 |
4915200 |
|
1900 |
63056560 |
Golam_Rahman_Chowdhury |
B |
Oct. 21, 2019, 6:38 a.m. |
OK |
GNU C++17 |
TESTS |
65 |
77 |
3174400 |
|
1900 |
59097571 |
_PortgasD.Ace_ |
B |
Aug. 19, 2019, 2:46 p.m. |
OK |
GNU C++17 |
TESTS |
65 |
93 |
2560000 |
|
1900 |
53849198 |
yswness |
B |
May 7, 2019, 12:36 p.m. |
OK |
GNU C++17 |
TESTS |
65 |
108 |
3174400 |
|
1900 |
53766937 |
tsyr8924503 |
B |
May 5, 2019, 1:12 a.m. |
OK |
GNU C++17 |
TESTS |
65 |
108 |
3993600 |
|
1900 |
56027992 |
vjudge5 |
B |
June 25, 2019, 7:58 a.m. |
OK |
GNU C++17 |
TESTS |
65 |
124 |
3584000 |
|
1900 |
57893621 |
sxweetlollipop2912 |
B |
July 28, 2019, 12:43 p.m. |
OK |
GNU C++17 |
TESTS |
65 |
124 |
4915200 |
|
1900 |
54041784 |
ysads2010 |
B |
May 12, 2019, 4 p.m. |
OK |
GNU C++17 |
TESTS |
65 |
124 |
4915200 |
|
1900 |
53854488 |
yswness |
B |
May 7, 2019, 3:20 p.m. |
OK |
GNU C++17 |
TESTS |
65 |
124 |
4915200 |
|
1900 |
55515031 |
vamaddur |
B |
June 13, 2019, 4:26 a.m. |
OK |
GNU C++17 |
TESTS |
65 |
124 |
7372800 |
|
1900 |
54891420 |
vjudge3 |
B |
May 31, 2019, 8:44 p.m. |
OK |
GNU C++17 |
TESTS |
65 |
124 |
7372800 |
|
1900 |
61873924 |
synapse |
B |
Oct. 4, 2019, 7:20 p.m. |
OK |
Go |
TESTS |
65 |
280 |
5324800 |
|
1900 |
61874004 |
synapse |
B |
Oct. 4, 2019, 7:22 p.m. |
OK |
Go |
TESTS |
65 |
295 |
5324800 |
|
1900 |
54851253 |
efimmanevich |
B |
May 30, 2019, 4:42 p.m. |
OK |
Go |
TESTS |
65 |
436 |
14336000 |
|
1900 |
54452630 |
bcoskun |
B |
May 21, 2019, 2:17 p.m. |
OK |
Go |
TESTS |
65 |
467 |
18841600 |
|
1900 |
59185009 |
saurabhs1206 |
B |
Aug. 20, 2019, 6:14 p.m. |
OK |
Java 8 |
TESTS |
65 |
280 |
19251200 |
|
1900 |
53829733 |
saurabh0611 |
B |
May 6, 2019, 6:58 p.m. |
OK |
Java 8 |
TESTS |
65 |
311 |
15769600 |
|
1900 |
53764074 |
Suzukaze |
B |
May 4, 2019, 9:18 p.m. |
OK |
Java 8 |
TESTS |
64 |
327 |
14233600 |
|
1900 |
53765778 |
gojira |
B |
May 4, 2019, 11:19 p.m. |
OK |
Java 8 |
TESTS |
64 |
373 |
11059200 |
|
1900 |
54008496 |
smirnovva |
B |
May 11, 2019, 10:26 p.m. |
OK |
Java 8 |
TESTS |
65 |
935 |
15564800 |
|
1900 |
57623177 |
yaoct |
B |
July 24, 2019, 5:56 a.m. |
OK |
Java 8 |
TESTS |
65 |
1013 |
14233600 |
|
1900 |
54779938 |
puzink |
B |
May 28, 2019, 8:39 p.m. |
OK |
Java 8 |
TESTS |
65 |
1232 |
31846400 |
|
1900 |
54660326 |
schillij |
B |
May 26, 2019, 10:28 a.m. |
OK |
Java 8 |
TESTS |
65 |
2028 |
14848000 |
|
1900 |
54660456 |
schillij |
B |
May 26, 2019, 10:33 a.m. |
OK |
Java 8 |
TESTS |
65 |
2043 |
30924800 |
|
1900 |
54660150 |
schillij |
B |
May 26, 2019, 10:23 a.m. |
OK |
Java 8 |
TESTS |
65 |
2074 |
14848000 |
|
1900 |
53864162 |
scorpiowf |
B |
May 8, 2019, 1:29 a.m. |
OK |
MS C++ |
TESTS |
65 |
109 |
1638400 |
|
1900 |
53830251 |
hiliy |
B |
May 6, 2019, 7:22 p.m. |
OK |
MS C++ |
TESTS |
65 |
405 |
9728000 |
|
1900 |
53890023 |
pseuda |
B |
May 8, 2019, 10:30 p.m. |
OK |
MS C++ 2017 |
TESTS |
65 |
389 |
11776000 |
|
1900 |
60666121 |
kopok2 |
B |
Sept. 16, 2019, 8:09 a.m. |
OK |
PyPy 3 |
TESTS |
65 |
1949 |
59494400 |
|
1900 |
remove filters
Back to search problems