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'Allen is playing Number Clicker on his phone. He starts with an integer u on the screen. Every second, he can press one of 3 buttons. Allen wants to press at most 200 buttons and end up with v on the screen. Help him! The first line of the input contains 3 positive integers: u, v, p ( 0 <= u, v <= p-1 , 3 <= p <= 10^9 + 9 ). p is guaranteed to be prime. On the first line, print a single integer ell , the number of button presses. On the second line, print integers c_1, ... , c_ ell , the button presses. For 1 <= i <= ell , 1 <= c_i <= 3 . We can show that the answer always exists. In the first example the integer on the screen changes as 1 to 2 to 3 . In the second example the integer on the screen changes as 3 to 2 . '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
69505347 |
hos.lyric |
E |
Jan. 25, 2020, 8:21 a.m. |
OK |
D |
TESTS |
114 |
623 |
32358400 |
|
2700 |
39658536 |
matipau |
E |
June 25, 2018, 7:12 p.m. |
OK |
GNU C |
TESTS |
114 |
1497 |
16076800 |
|
2700 |
42232266 |
Timsei |
E |
Aug. 29, 2018, 7:22 a.m. |
OK |
GNU C++ |
TESTS |
114 |
31 |
0 |
|
2700 |
41694213 |
hmfzy |
E |
Aug. 17, 2018, 2:57 p.m. |
OK |
GNU C++ |
TESTS |
114 |
670 |
26316800 |
|
2700 |
39621802 |
DEGwer |
E |
June 24, 2018, 5:41 p.m. |
OK |
GNU C++ |
TESTS |
114 |
670 |
31027200 |
|
2700 |
40644528 |
notFancy |
E |
July 22, 2018, 2:55 p.m. |
OK |
GNU C++ |
TESTS |
114 |
920 |
29696000 |
|
2700 |
39949669 |
Worldwide_D |
E |
July 4, 2018, 9:28 a.m. |
OK |
GNU C++ |
TESTS |
114 |
1247 |
50892800 |
|
2700 |
41699889 |
vjudge3 |
E |
Aug. 17, 2018, 3:12 p.m. |
OK |
GNU C++ |
TESTS |
114 |
1263 |
55091200 |
|
2700 |
39988759 |
guille |
E |
July 5, 2018, 3:32 p.m. |
OK |
GNU C++ |
TESTS |
114 |
3213 |
20992000 |
|
2700 |
41969279 |
Jonothor_Darry |
E |
Aug. 22, 2018, 2:06 p.m. |
OK |
GNU C++ |
TESTS |
114 |
3853 |
255283200 |
|
2700 |
57869443 |
lopare |
E |
July 28, 2019, 12:19 a.m. |
OK |
GNU C++11 |
TESTS |
114 |
31 |
0 |
|
2700 |
57738945 |
py_ultron |
E |
July 25, 2019, 10:50 a.m. |
OK |
GNU C++11 |
TESTS |
114 |
31 |
0 |
|
2700 |
40908721 |
YangDavid |
E |
July 29, 2018, 7:28 a.m. |
OK |
GNU C++11 |
TESTS |
114 |
31 |
0 |
|
2700 |
40314255 |
PlayfulPanda |
E |
July 14, 2018, 9:36 a.m. |
OK |
GNU C++11 |
TESTS |
114 |
31 |
0 |
|
2700 |
40314138 |
PlayfulPanda |
E |
July 14, 2018, 9:32 a.m. |
OK |
GNU C++11 |
TESTS |
114 |
31 |
0 |
|
2700 |
39690431 |
251 |
E |
June 27, 2018, 4 a.m. |
OK |
GNU C++11 |
TESTS |
114 |
31 |
0 |
|
2700 |
39690274 |
251 |
E |
June 27, 2018, 3:48 a.m. |
OK |
GNU C++11 |
TESTS |
114 |
31 |
0 |
|
2700 |
39642276 |
nimphy |
E |
June 25, 2018, 7:50 a.m. |
OK |
GNU C++11 |
TESTS |
114 |
31 |
0 |
|
2700 |
39636737 |
MofK |
E |
June 25, 2018, 3:09 a.m. |
OK |
GNU C++11 |
TESTS |
114 |
31 |
0 |
|
2700 |
39626741 |
MofK |
E |
June 24, 2018, 6:20 p.m. |
OK |
GNU C++11 |
TESTS |
114 |
31 |
0 |
|
2700 |
55810603 |
Scut82 |
E |
June 20, 2019, 3:26 a.m. |
OK |
GNU C++14 |
TESTS |
114 |
30 |
13312000 |
|
2700 |
69874724 |
Scut82 |
E |
Jan. 31, 2020, 3:13 a.m. |
OK |
GNU C++14 |
TESTS |
114 |
31 |
0 |
|
2700 |
69874575 |
Scut82 |
E |
Jan. 31, 2020, 3:08 a.m. |
OK |
GNU C++14 |
TESTS |
114 |
31 |
0 |
|
2700 |
55871877 |
_user090203 |
E |
June 21, 2019, 3:11 p.m. |
OK |
GNU C++14 |
TESTS |
114 |
31 |
0 |
|
2700 |
55808532 |
Scut82 |
E |
June 20, 2019, 1:37 a.m. |
OK |
GNU C++14 |
TESTS |
114 |
31 |
0 |
|
2700 |
55807535 |
Scut82 |
E |
June 20, 2019, 12:29 a.m. |
OK |
GNU C++14 |
TESTS |
114 |
31 |
0 |
|
2700 |
45068315 |
gamegame |
E |
Oct. 29, 2018, 6:17 p.m. |
OK |
GNU C++14 |
TESTS |
114 |
31 |
0 |
|
2700 |
55810195 |
Scut82 |
E |
June 20, 2019, 3:09 a.m. |
OK |
GNU C++14 |
TESTS |
114 |
31 |
102400 |
|
2700 |
41970329 |
Lynstery |
E |
Aug. 22, 2018, 2:42 p.m. |
OK |
GNU C++14 |
TESTS |
114 |
31 |
102400 |
|
2700 |
39641151 |
otrecnoc |
E |
June 25, 2018, 7:07 a.m. |
OK |
GNU C++14 |
TESTS |
114 |
31 |
102400 |
|
2700 |
39632252 |
.I. |
E |
June 24, 2018, 9:11 p.m. |
OK |
GNU C++17 |
TESTS |
114 |
30 |
0 |
|
2700 |
67468079 |
tuwuna |
E |
Dec. 23, 2019, 11:48 a.m. |
OK |
GNU C++17 |
TESTS |
114 |
31 |
0 |
|
2700 |
55640880 |
Thanous |
E |
June 16, 2019, 11:17 a.m. |
OK |
GNU C++17 |
TESTS |
114 |
31 |
0 |
|
2700 |
40977389 |
ReaLNero1 |
E |
July 30, 2018, 4:10 p.m. |
OK |
GNU C++17 |
TESTS |
114 |
31 |
0 |
|
2700 |
40931737 |
ReaLNero1 |
E |
July 30, 2018, 1:16 a.m. |
OK |
GNU C++17 |
TESTS |
114 |
31 |
0 |
|
2700 |
39678867 |
Ali_Pi |
E |
June 26, 2018, 2:53 p.m. |
OK |
GNU C++17 |
TESTS |
114 |
31 |
102400 |
|
2700 |
41319798 |
crathva |
E |
Aug. 7, 2018, 11:44 p.m. |
OK |
GNU C++17 |
TESTS |
114 |
31 |
204800 |
|
2700 |
39781287 |
CrafterKolyan |
E |
June 29, 2018, 8:16 p.m. |
OK |
GNU C++17 |
TESTS |
114 |
61 |
0 |
|
2700 |
54576114 |
KrK |
E |
May 24, 2019, 11:36 p.m. |
OK |
GNU C++17 |
TESTS |
114 |
62 |
8806400 |
|
2700 |
39637863 |
q234rty |
E |
June 25, 2018, 4:28 a.m. |
OK |
GNU C++17 |
TESTS |
114 |
124 |
11264000 |
|
2700 |
39623425 |
Petr |
E |
June 24, 2018, 5:54 p.m. |
OK |
Java 8 |
TESTS |
114 |
155 |
0 |
|
2700 |
39630037 |
Lewin |
E |
June 24, 2018, 8:07 p.m. |
OK |
Java 8 |
TESTS |
114 |
514 |
0 |
|
2700 |
39663125 |
kessido |
E |
June 26, 2018, 2:13 a.m. |
OK |
Java 8 |
TESTS |
114 |
1045 |
41164800 |
|
2700 |
39660995 |
kessido |
E |
June 25, 2018, 10:24 p.m. |
OK |
Java 8 |
TESTS |
114 |
1154 |
82739200 |
|
2700 |
39663094 |
kessido |
E |
June 26, 2018, 2:10 a.m. |
OK |
Java 8 |
TESTS |
114 |
1185 |
83046400 |
|
2700 |
39619759 |
qwerty787788 |
E |
June 24, 2018, 5:26 p.m. |
OK |
Java 8 |
TESTS |
114 |
1201 |
49766400 |
|
2700 |
39663197 |
kessido |
E |
June 26, 2018, 2:18 a.m. |
OK |
Java 8 |
TESTS |
114 |
1528 |
63180800 |
|
2700 |
39633670 |
kessido |
E |
June 24, 2018, 10:45 p.m. |
OK |
Java 8 |
TESTS |
114 |
1543 |
83251200 |
|
2700 |
39663215 |
kessido |
E |
June 26, 2018, 2:20 a.m. |
OK |
Java 8 |
TESTS |
114 |
1746 |
150732800 |
|
2700 |
39663111 |
kessido |
E |
June 26, 2018, 2:12 a.m. |
OK |
Java 8 |
TESTS |
114 |
2885 |
252620800 |
|
2700 |
40232389 |
pericle |
E |
July 12, 2018, 12:48 p.m. |
OK |
MS C++ |
TESTS |
114 |
1201 |
59289600 |
|
2700 |
remove filters
Back to search problems