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"The campus has m rooms numbered from 0 to m - 1 . Also the x -mouse lives in the campus. The x -mouse is not just a mouse: each second x -mouse moves from room i to the room i cdot x mod{m} (in fact, it teleports from one room to another since it doesn't visit any intermediate room). Starting position of the x -mouse is unknown. You are responsible to catch the x -mouse in the campus, so you are guessing about minimum possible number of traps (one trap in one room) you need to place. You are sure that if the x -mouse enters a trapped room, it immediately gets caught. And the only observation you made is text{GCD} (x, m) = 1 . The only line contains two integers m and x ( 2 <= m <= 10^{14} , 1 <= x < m , text{GCD} (x, m) = 1 ) -- the number of rooms and the parameter of x -mouse. Print the only integer -- minimum number of traps you need to install to catch the x -mouse. In the first example you can, for example, put traps in rooms 0 , 2 , 3 . If the x -mouse starts in one of this rooms it will be caught immediately. If x -mouse starts in the 1 -st rooms then it will move to the room 3 , where it will be caught. In the second example you can put one trap in room 0 and one trap in any other room since x -mouse will visit all rooms 1..m-1 if it will start in any of these rooms. "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
42262373 |
vjudge2 |
G |
Aug. 30, 2018, 4:24 a.m. |
OK |
GNU C++ |
TESTS |
143 |
280 |
3891200 |
|
2800 |
42262695 |
vjudge2 |
G |
Aug. 30, 2018, 4:43 a.m. |
OK |
GNU C++ |
TESTS |
143 |
280 |
7270400 |
|
2800 |
42147805 |
dyxx |
G |
Aug. 27, 2018, 10:04 a.m. |
OK |
GNU C++ |
TESTS |
143 |
421 |
21401600 |
|
2800 |
41808692 |
samjia2000 |
G |
Aug. 19, 2018, 1:06 a.m. |
OK |
GNU C++ |
TESTS |
143 |
421 |
21401600 |
|
2800 |
42203781 |
Serval |
G |
Aug. 28, 2018, 10:21 a.m. |
OK |
GNU C++ |
TESTS |
143 |
436 |
46182400 |
|
2800 |
41806911 |
luogu_bot2 |
G |
Aug. 18, 2018, 10:38 p.m. |
OK |
GNU C++ |
TESTS |
143 |
467 |
512000 |
|
2800 |
42203735 |
Serval |
G |
Aug. 28, 2018, 10:20 a.m. |
OK |
GNU C++ |
TESTS |
143 |
468 |
46182400 |
|
2800 |
41901248 |
zhoujundong |
G |
Aug. 20, 2018, 12:15 p.m. |
OK |
GNU C++ |
TESTS |
143 |
561 |
2764800 |
|
2800 |
42202200 |
vjudge5 |
G |
Aug. 28, 2018, 9:22 a.m. |
OK |
GNU C++ |
TESTS |
143 |
607 |
76595200 |
|
2800 |
41801283 |
reffo |
G |
Aug. 18, 2018, 6:53 p.m. |
OK |
GNU C++ |
TESTS |
143 |
1029 |
80179200 |
|
2800 |
57868901 |
lopare |
G |
July 27, 2019, 11:44 p.m. |
OK |
GNU C++11 |
TESTS |
143 |
93 |
0 |
|
2800 |
57737752 |
py_ultron |
G |
July 25, 2019, 10:28 a.m. |
OK |
GNU C++11 |
TESTS |
143 |
93 |
0 |
|
2800 |
42861999 |
zhouyuyang |
G |
Sept. 14, 2018, 1:25 p.m. |
OK |
GNU C++11 |
TESTS |
143 |
93 |
0 |
|
2800 |
64733605 |
SuperFF |
G |
Nov. 12, 2019, 9:21 a.m. |
OK |
GNU C++11 |
TESTS |
143 |
109 |
0 |
|
2800 |
43626582 |
tritanngo99 |
G |
Sept. 30, 2018, 11:22 p.m. |
OK |
GNU C++11 |
TESTS |
143 |
109 |
0 |
|
2800 |
42878945 |
scott_wu |
G |
Sept. 15, 2018, 4:55 a.m. |
OK |
GNU C++11 |
TESTS |
143 |
109 |
0 |
|
2800 |
43693870 |
zhangjunhua |
G |
Oct. 2, 2018, 3:35 p.m. |
OK |
GNU C++11 |
TESTS |
143 |
140 |
102400 |
|
2800 |
42482387 |
CN_zwang2002 |
G |
Sept. 5, 2018, 6:39 a.m. |
OK |
GNU C++11 |
TESTS |
143 |
187 |
0 |
|
2800 |
41820731 |
pperm |
G |
Aug. 19, 2018, 9:27 a.m. |
OK |
GNU C++11 |
TESTS |
143 |
202 |
307200 |
|
2800 |
44435595 |
MisakaKuma |
G |
Oct. 17, 2018, 9:49 a.m. |
OK |
GNU C++11 |
TESTS |
143 |
202 |
80384000 |
|
2800 |
41812289 |
consecutivelimit |
G |
Aug. 19, 2018, 4:04 a.m. |
OK |
GNU C++14 |
TESTS |
143 |
109 |
0 |
|
2800 |
41828902 |
abeker |
G |
Aug. 19, 2018, 1:34 p.m. |
OK |
GNU C++14 |
TESTS |
143 |
109 |
102400 |
|
2800 |
68628340 |
problem-solved |
G |
Jan. 12, 2020, 12:42 a.m. |
OK |
GNU C++14 |
TESTS |
143 |
171 |
614400 |
|
2800 |
68574669 |
problem-solved |
G |
Jan. 11, 2020, 4:24 a.m. |
OK |
GNU C++14 |
TESTS |
143 |
202 |
512000 |
|
2800 |
41807618 |
antguz |
G |
Aug. 18, 2018, 11:31 p.m. |
OK |
GNU C++14 |
TESTS |
143 |
218 |
614400 |
|
2800 |
64205770 |
Potassium_ |
G |
Nov. 4, 2019, 12:49 p.m. |
OK |
GNU C++14 |
TESTS |
143 |
218 |
80691200 |
|
2800 |
44051885 |
erogame |
G |
Oct. 9, 2018, 7:40 p.m. |
OK |
GNU C++14 |
TESTS |
143 |
234 |
614400 |
|
2800 |
41993074 |
Origenes |
G |
Aug. 23, 2018, 10:11 a.m. |
OK |
GNU C++14 |
TESTS |
143 |
249 |
0 |
|
2800 |
41795432 |
chemthan |
G |
Aug. 18, 2018, 4:46 p.m. |
OK |
GNU C++14 |
TESTS |
143 |
249 |
921600 |
|
2800 |
41794784 |
chemthan |
G |
Aug. 18, 2018, 4:39 p.m. |
OK |
GNU C++14 |
TESTS |
143 |
249 |
921600 |
|
2800 |
62245762 |
yhchang3 |
G |
Oct. 10, 2019, 5:49 a.m. |
OK |
GNU C++17 |
TESTS |
143 |
93 |
204800 |
|
2800 |
42696051 |
ReaLNero1 |
G |
Sept. 9, 2018, 7:13 a.m. |
OK |
GNU C++17 |
TESTS |
143 |
93 |
307200 |
|
2800 |
42721514 |
ReaLNero1 |
G |
Sept. 10, 2018, 2:08 a.m. |
OK |
GNU C++17 |
TESTS |
143 |
108 |
0 |
|
2800 |
41999153 |
Goncharenko |
G |
Aug. 23, 2018, 1:57 p.m. |
OK |
GNU C++17 |
TESTS |
143 |
108 |
0 |
|
2800 |
41991324 |
lixinyue |
G |
Aug. 23, 2018, 9:02 a.m. |
OK |
GNU C++17 |
TESTS |
143 |
109 |
0 |
|
2800 |
41871701 |
_SOCIOPATH |
G |
Aug. 19, 2018, 6:43 p.m. |
OK |
GNU C++17 |
TESTS |
143 |
109 |
0 |
|
2800 |
41817885 |
crisis627 |
G |
Aug. 19, 2018, 7:35 a.m. |
OK |
GNU C++17 |
TESTS |
143 |
109 |
6348800 |
|
2800 |
42221590 |
jimola |
G |
Aug. 28, 2018, 9:09 p.m. |
OK |
GNU C++17 |
TESTS |
143 |
156 |
1331200 |
|
2800 |
41794075 |
isaf27 |
G |
Aug. 18, 2018, 4:34 p.m. |
OK |
GNU C++17 |
TESTS |
143 |
171 |
204800 |
|
2800 |
46815686 |
YenSean |
G |
Dec. 9, 2018, 12:26 p.m. |
OK |
GNU C++17 |
TESTS |
143 |
202 |
204800 |
|
2800 |
41821569 |
lucyanna2018 |
G |
Aug. 19, 2018, 9:50 a.m. |
OK |
MS C++ |
TESTS |
143 |
327 |
0 |
|
2800 |
52740015 |
vjudge3 |
G |
April 14, 2019, 8:30 a.m. |
OK |
MS C++ |
TESTS |
143 |
795 |
2457600 |
|
2800 |
52740184 |
vjudge5 |
G |
April 14, 2019, 8:35 a.m. |
OK |
MS C++ |
TESTS |
143 |
826 |
2457600 |
|
2800 |
41957497 |
ecnerwala |
G |
Aug. 22, 2018, 7:30 a.m. |
OK |
PyPy 3 |
TESTS |
143 |
389 |
3276800 |
|
2800 |
remove filters
Back to search problems