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'You are given two integer numbers, n and x . You may perform several operations with the integer x . Each operation you perform is the following one: choose any digit y that occurs in the decimal representation of x at least once, and replace x by x cdot y . You want to make the length of decimal representation of x (without leading zeroes) equal to n . What is the minimum number of operations required to do that? The only line of the input contains two integers n and x ( 2 <= n <= 19 ; 1 <= x < 10^{n-1} ). Print one integer -- the minimum number of operations required to make the length of decimal representation of x (without leading zeroes) equal to n , or -1 if it is impossible. In the second example, the following sequence of operations achieves the goal: '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
158358893 |
avtoruxadze |
D |
May 25, 2022, 7:01 a.m. |
OK |
C# 8 |
TESTS |
209 |
140 |
5529600 |
|
1700 |
158430443 |
GTrigger |
D |
May 25, 2022, 5:57 p.m. |
OK |
GNU C11 |
TESTS |
209 |
280 |
18534400 |
|
1700 |
158429267 |
GTrigger |
D |
May 25, 2022, 5:56 p.m. |
OK |
GNU C11 |
TESTS |
209 |
296 |
18534400 |
|
1700 |
158306147 |
refresh888 |
D |
May 24, 2022, 2:11 p.m. |
OK |
GNU C++14 |
TESTS |
208 |
15 |
0 |
|
1700 |
158303283 |
wwsys_fuyu |
D |
May 24, 2022, 1:39 p.m. |
OK |
GNU C++14 |
TESTS |
208 |
15 |
0 |
|
1700 |
158291245 |
Daas |
D |
May 24, 2022, 11:19 a.m. |
OK |
GNU C++14 |
TESTS |
207 |
15 |
0 |
|
1700 |
158285027 |
cfdqwqdfc |
D |
May 24, 2022, 9:57 a.m. |
OK |
GNU C++14 |
TESTS |
207 |
15 |
0 |
|
1700 |
158283507 |
cavalryly |
D |
May 24, 2022, 9:34 a.m. |
OK |
GNU C++14 |
TESTS |
207 |
15 |
0 |
|
1700 |
158273687 |
HasanLegend |
D |
May 24, 2022, 7:21 a.m. |
OK |
GNU C++14 |
TESTS |
207 |
15 |
0 |
|
1700 |
158423277 |
pazuzu |
D |
May 25, 2022, 5:47 p.m. |
OK |
GNU C++14 |
TESTS |
209 |
15 |
0 |
|
1700 |
158391496 |
1564269628 |
D |
May 25, 2022, 1:11 p.m. |
OK |
GNU C++14 |
TESTS |
209 |
15 |
0 |
|
1700 |
158370262 |
happycrazzy |
D |
May 25, 2022, 9:10 a.m. |
OK |
GNU C++14 |
TESTS |
209 |
15 |
0 |
|
1700 |
158526306 |
KaIZzZ |
D |
May 26, 2022, 12:28 p.m. |
OK |
GNU C++14 |
TESTS |
209 |
15 |
0 |
|
1700 |
158372125 |
Tynoo |
D |
May 25, 2022, 9:36 a.m. |
OK |
GNU C++17 |
TESTS |
209 |
15 |
0 |
|
1700 |
158342649 |
missuu |
D |
May 25, 2022, 1:18 a.m. |
OK |
GNU C++17 |
TESTS |
209 |
15 |
0 |
|
1700 |
158315959 |
WWWangYuze |
D |
May 24, 2022, 3:59 p.m. |
OK |
GNU C++17 |
TESTS |
209 |
15 |
0 |
|
1700 |
158314725 |
AhamNom |
D |
May 24, 2022, 3:45 p.m. |
OK |
GNU C++17 |
TESTS |
209 |
15 |
0 |
|
1700 |
158313228 |
Harold01 |
D |
May 24, 2022, 3:29 p.m. |
OK |
GNU C++17 |
TESTS |
209 |
15 |
0 |
|
1700 |
158301437 |
lcglcg |
D |
May 24, 2022, 1:19 p.m. |
OK |
GNU C++17 |
TESTS |
208 |
15 |
0 |
|
1700 |
158296378 |
_Al_Amin |
D |
May 24, 2022, 12:20 p.m. |
OK |
GNU C++17 |
TESTS |
208 |
15 |
0 |
|
1700 |
158295990 |
dianzikejidaxue |
D |
May 24, 2022, 12:16 p.m. |
OK |
GNU C++17 |
TESTS |
208 |
15 |
0 |
|
1700 |
158561654 |
wwawwaww |
D |
May 26, 2022, 7:21 p.m. |
OK |
GNU C++17 |
TESTS |
209 |
15 |
0 |
|
1700 |
158517421 |
bhargavKalaria |
D |
May 26, 2022, 10:51 a.m. |
OK |
GNU C++17 |
TESTS |
209 |
15 |
0 |
|
1700 |
158489314 |
jjjjssss6 |
D |
May 26, 2022, 4:37 a.m. |
OK |
GNU C++17 (64) |
TESTS |
209 |
15 |
0 |
|
1700 |
158400438 |
Makcum888 |
D |
May 25, 2022, 3 p.m. |
OK |
GNU C++17 (64) |
TESTS |
209 |
15 |
0 |
|
1700 |
158344941 |
litachloveyou |
D |
May 25, 2022, 2:35 a.m. |
OK |
GNU C++17 (64) |
TESTS |
209 |
15 |
0 |
|
1700 |
158296833 |
blx |
D |
May 24, 2022, 12:26 p.m. |
OK |
GNU C++17 (64) |
TESTS |
208 |
15 |
0 |
|
1700 |
158291436 |
OnMyZenith |
D |
May 24, 2022, 11:21 a.m. |
OK |
GNU C++17 (64) |
TESTS |
207 |
15 |
0 |
|
1700 |
158283000 |
b14ck_5m0k3 |
D |
May 24, 2022, 9:26 a.m. |
OK |
GNU C++17 (64) |
TESTS |
207 |
15 |
0 |
|
1700 |
158277224 |
iLLusio |
D |
May 24, 2022, 8:12 a.m. |
OK |
GNU C++17 (64) |
TESTS |
207 |
15 |
0 |
|
1700 |
158273635 |
litachloveyou |
D |
May 24, 2022, 7:20 a.m. |
OK |
GNU C++17 (64) |
TESTS |
207 |
15 |
0 |
|
1700 |
158273469 |
_Mus |
D |
May 24, 2022, 7:18 a.m. |
OK |
GNU C++17 (64) |
TESTS |
207 |
15 |
0 |
|
1700 |
158267090 |
wky_buct |
D |
May 24, 2022, 5:44 a.m. |
OK |
GNU C++17 (64) |
TESTS |
207 |
15 |
0 |
|
1700 |
158397916 |
zhensuan |
D |
May 25, 2022, 2:29 p.m. |
OK |
GNU C++20 (64) |
TESTS |
209 |
15 |
0 |
|
1700 |
158386807 |
SHEXINYI |
D |
May 25, 2022, 12:16 p.m. |
OK |
GNU C++20 (64) |
TESTS |
209 |
15 |
0 |
|
1700 |
158381053 |
fr200110217102 |
D |
May 25, 2022, 11:05 a.m. |
OK |
GNU C++20 (64) |
TESTS |
209 |
15 |
0 |
|
1700 |
158380710 |
lag_1 |
D |
May 25, 2022, 11 a.m. |
OK |
GNU C++20 (64) |
TESTS |
209 |
15 |
0 |
|
1700 |
158363713 |
VCR |
D |
May 25, 2022, 8:09 a.m. |
OK |
GNU C++20 (64) |
TESTS |
209 |
15 |
0 |
|
1700 |
158359419 |
GlenBzc |
D |
May 25, 2022, 7:08 a.m. |
OK |
GNU C++20 (64) |
TESTS |
209 |
15 |
0 |
|
1700 |
158359177 |
GlenBzc |
D |
May 25, 2022, 7:05 a.m. |
OK |
GNU C++20 (64) |
TESTS |
209 |
15 |
0 |
|
1700 |
158351610 |
RaisingMoon |
D |
May 25, 2022, 5:17 a.m. |
OK |
GNU C++20 (64) |
TESTS |
209 |
15 |
0 |
|
1700 |
158482249 |
ShadowLight |
D |
May 26, 2022, 2:10 a.m. |
OK |
GNU C++20 (64) |
TESTS |
209 |
15 |
0 |
|
1700 |
158512433 |
anonymous_777 |
D |
May 26, 2022, 9:48 a.m. |
OK |
GNU C++20 (64) |
TESTS |
209 |
15 |
0 |
|
1700 |
158300744 |
poopoop |
D |
May 24, 2022, 1:11 p.m. |
OK |
Java 11 |
TESTS |
208 |
171 |
0 |
|
1700 |
158540508 |
RockStar_14 |
D |
May 26, 2022, 2:52 p.m. |
OK |
Java 11 |
TESTS |
209 |
187 |
0 |
|
1700 |
158500112 |
_ryan18_ |
D |
May 26, 2022, 7:09 a.m. |
OK |
Java 11 |
TESTS |
209 |
202 |
0 |
|
1700 |
158331230 |
S-A-I-T-A-M-A |
D |
May 24, 2022, 7:08 p.m. |
OK |
Java 11 |
TESTS |
209 |
202 |
0 |
|
1700 |
158325505 |
weiweiwei_ |
D |
May 24, 2022, 5:49 p.m. |
OK |
Java 11 |
TESTS |
209 |
202 |
0 |
|
1700 |
158324760 |
weiweiwei_ |
D |
May 24, 2022, 5:40 p.m. |
OK |
Java 11 |
TESTS |
209 |
202 |
0 |
|
1700 |
158312163 |
yudi23 |
D |
May 24, 2022, 3:16 p.m. |
OK |
Java 11 |
TESTS |
209 |
202 |
0 |
|
1700 |
158296443 |
goyalronak3 |
D |
May 24, 2022, 12:21 p.m. |
OK |
Java 11 |
TESTS |
208 |
202 |
0 |
|
1700 |
158319785 |
yehara |
D |
May 24, 2022, 4:42 p.m. |
OK |
Java 11 |
TESTS |
209 |
202 |
102400 |
|
1700 |
158327121 |
AyushS_cg170 |
D |
May 24, 2022, 6:10 p.m. |
OK |
Java 11 |
TESTS |
209 |
218 |
0 |
|
1700 |
158298326 |
cc4414 |
D |
May 24, 2022, 12:44 p.m. |
OK |
Java 8 |
TESTS |
208 |
109 |
0 |
|
1700 |
158322967 |
pranayrana14 |
D |
May 24, 2022, 5:19 p.m. |
OK |
Java 8 |
TESTS |
209 |
124 |
0 |
|
1700 |
158340805 |
28leoleo28 |
D |
May 24, 2022, 11:52 p.m. |
OK |
Java 8 |
TESTS |
209 |
139 |
0 |
|
1700 |
158311751 |
tanishq044 |
D |
May 24, 2022, 3:12 p.m. |
OK |
Java 8 |
TESTS |
209 |
139 |
0 |
|
1700 |
158333678 |
naveenkant227 |
D |
May 24, 2022, 7:54 p.m. |
OK |
Java 8 |
TESTS |
209 |
140 |
0 |
|
1700 |
158307374 |
ttolkku |
D |
May 24, 2022, 2:25 p.m. |
OK |
Java 8 |
TESTS |
208 |
140 |
0 |
|
1700 |
158267256 |
CodingJatt |
D |
May 24, 2022, 5:47 a.m. |
OK |
Java 8 |
TESTS |
207 |
140 |
0 |
|
1700 |
158546170 |
crFlowerz |
D |
May 26, 2022, 3:55 p.m. |
OK |
Java 8 |
TESTS |
209 |
155 |
0 |
|
1700 |
158486426 |
coderama |
D |
May 26, 2022, 3:41 a.m. |
OK |
Java 8 |
TESTS |
209 |
155 |
0 |
|
1700 |
158483229 |
niks_vat |
D |
May 26, 2022, 2:33 a.m. |
OK |
Java 8 |
TESTS |
209 |
155 |
0 |
|
1700 |
158345305 |
linxiaotian |
D |
May 25, 2022, 2:45 a.m. |
OK |
Kotlin 1.4 |
TESTS |
209 |
155 |
2867200 |
|
1700 |
158294378 |
Golovanov399 |
D |
May 24, 2022, 11:56 a.m. |
OK |
Kotlin 1.6 |
TESTS |
208 |
342 |
1536000 |
|
1700 |
158393019 |
diajutcum |
D |
May 25, 2022, 1:29 p.m. |
OK |
MS C++ 2017 |
TESTS |
209 |
46 |
1740800 |
|
1700 |
158392887 |
diajutcum |
D |
May 25, 2022, 1:27 p.m. |
OK |
MS C++ 2017 |
TESTS |
209 |
46 |
1740800 |
|
1700 |
158392542 |
diajutcum |
D |
May 25, 2022, 1:23 p.m. |
OK |
MS C++ 2017 |
TESTS |
209 |
46 |
1740800 |
|
1700 |
158335550 |
DavitMarg |
D |
May 24, 2022, 8:37 p.m. |
OK |
MS C++ 2017 |
TESTS |
209 |
46 |
3072000 |
|
1700 |
158287559 |
xsc |
D |
May 24, 2022, 10:32 a.m. |
OK |
MS C++ 2017 |
TESTS |
207 |
62 |
1536000 |
|
1700 |
158405289 |
Still_Theory |
D |
May 25, 2022, 3:52 p.m. |
OK |
MS C++ 2017 |
TESTS |
209 |
78 |
1638400 |
|
1700 |
158291548 |
vishvjoshi |
D |
May 24, 2022, 11:22 a.m. |
OK |
MS C++ 2017 |
TESTS |
207 |
452 |
2150400 |
|
1700 |
158577804 |
chinesedfan |
D |
May 27, 2022, 3:53 a.m. |
OK |
Node.js |
TESTS |
209 |
265 |
8704000 |
|
1700 |
158317702 |
Inspired |
D |
May 24, 2022, 4:19 p.m. |
OK |
Node.js |
TESTS |
209 |
296 |
5836800 |
|
1700 |
158281152 |
XYShaoKang |
D |
May 24, 2022, 9:03 a.m. |
OK |
Node.js |
TESTS |
207 |
327 |
10649600 |
|
1700 |
158579650 |
zkoong |
D |
May 27, 2022, 4:41 a.m. |
OK |
Node.js |
TESTS |
209 |
483 |
6041600 |
|
1700 |
158381225 |
n.n.n.kz |
D |
May 25, 2022, 11:07 a.m. |
OK |
PHP |
TESTS |
209 |
1528 |
5632000 |
|
1700 |
158293250 |
Xruvix |
D |
May 24, 2022, 11:43 a.m. |
OK |
PyPy 3 |
TESTS |
207 |
171 |
9113600 |
|
1700 |
158359546 |
manohar2509 |
D |
May 25, 2022, 7:10 a.m. |
OK |
PyPy 3 |
TESTS |
209 |
186 |
9625600 |
|
1700 |
158349048 |
ferfong |
D |
May 25, 2022, 4:27 a.m. |
OK |
PyPy 3 |
TESTS |
209 |
249 |
9113600 |
|
1700 |
158489782 |
mkawa2 |
D |
May 26, 2022, 4:45 a.m. |
OK |
PyPy 3 |
TESTS |
209 |
265 |
9625600 |
|
1700 |
158571695 |
jscn |
D |
May 27, 2022, 12:31 a.m. |
OK |
PyPy 3 |
TESTS |
209 |
280 |
14028800 |
|
1700 |
158371699 |
xyxoro |
D |
May 25, 2022, 9:30 a.m. |
OK |
PyPy 3 |
TESTS |
209 |
296 |
10240000 |
|
1700 |
158371946 |
xyxoro |
D |
May 25, 2022, 9:34 a.m. |
OK |
PyPy 3 |
TESTS |
209 |
311 |
10956800 |
|
1700 |
158271533 |
ankan2526 |
D |
May 24, 2022, 6:53 a.m. |
OK |
PyPy 3 |
TESTS |
207 |
482 |
76288000 |
|
1700 |
158376370 |
mmooyyii |
D |
May 25, 2022, 10:03 a.m. |
OK |
PyPy 3 |
TESTS |
209 |
498 |
10240000 |
|
1700 |
158503366 |
Sufiyan18 |
D |
May 26, 2022, 7:51 a.m. |
OK |
PyPy 3 |
TESTS |
209 |
624 |
19558400 |
|
1700 |
158302770 |
_icy_ |
D |
May 24, 2022, 1:34 p.m. |
OK |
PyPy 3-64 |
TESTS |
208 |
93 |
7065600 |
|
1700 |
158310675 |
denny_sem |
D |
May 24, 2022, 3:01 p.m. |
OK |
PyPy 3-64 |
TESTS |
208 |
93 |
8601600 |
|
1700 |
158282741 |
kojihashimoto |
D |
May 24, 2022, 9:23 a.m. |
OK |
PyPy 3-64 |
TESTS |
207 |
93 |
8806400 |
|
1700 |
158294511 |
dryeab |
D |
May 24, 2022, 11:58 a.m. |
OK |
PyPy 3-64 |
TESTS |
208 |
93 |
9728000 |
|
1700 |
158565395 |
zii.hrs |
D |
May 26, 2022, 8:40 p.m. |
OK |
PyPy 3-64 |
TESTS |
209 |
93 |
9830400 |
|
1700 |
158304551 |
_N_0_0_B_ |
D |
May 24, 2022, 1:53 p.m. |
OK |
PyPy 3-64 |
TESTS |
208 |
93 |
10240000 |
|
1700 |
158408670 |
fhhuo |
D |
May 25, 2022, 4:31 p.m. |
OK |
PyPy 3-64 |
TESTS |
209 |
108 |
8499200 |
|
1700 |
158332922 |
RANK1ZEN |
D |
May 24, 2022, 7:40 p.m. |
OK |
PyPy 3-64 |
TESTS |
209 |
108 |
9420800 |
|
1700 |
158313722 |
Parag_AP |
D |
May 24, 2022, 3:34 p.m. |
OK |
PyPy 3-64 |
TESTS |
209 |
108 |
9625600 |
|
1700 |
158552158 |
abhishekk_7 |
D |
May 26, 2022, 5:09 p.m. |
OK |
PyPy 3-64 |
TESTS |
209 |
109 |
9318400 |
|
1700 |
158318354 |
skp_r |
D |
May 24, 2022, 4:26 p.m. |
OK |
Python 3 |
TESTS |
209 |
171 |
2150400 |
|
1700 |
158278244 |
pennymagic156 |
D |
May 24, 2022, 8:26 a.m. |
OK |
Python 3 |
TESTS |
207 |
186 |
2457600 |
|
1700 |
158521954 |
ashwinjain10 |
D |
May 26, 2022, 11:40 a.m. |
OK |
Python 3 |
TESTS |
209 |
187 |
2048000 |
|
1700 |
158456724 |
ninadc |
D |
May 25, 2022, 7:02 p.m. |
OK |
Python 3 |
TESTS |
209 |
234 |
2150400 |
|
1700 |
158303917 |
DUbick |
D |
May 24, 2022, 1:45 p.m. |
OK |
Python 3 |
TESTS |
208 |
234 |
2150400 |
|
1700 |
158356998 |
Flanture |
D |
May 25, 2022, 6:36 a.m. |
OK |
Python 3 |
TESTS |
209 |
249 |
0 |
|
1700 |
158296553 |
Hacker315 |
D |
May 24, 2022, 12:23 p.m. |
OK |
Python 3 |
TESTS |
208 |
249 |
2150400 |
|
1700 |
158357018 |
Flanture |
D |
May 25, 2022, 6:36 a.m. |
OK |
Python 3 |
TESTS |
209 |
265 |
0 |
|
1700 |
158292512 |
darshan124 |
D |
May 24, 2022, 11:34 a.m. |
OK |
Python 3 |
TESTS |
207 |
265 |
2355200 |
|
1700 |
158528704 |
srinu879033 |
D |
May 26, 2022, 12:54 p.m. |
OK |
Python 3 |
TESTS |
209 |
374 |
4096000 |
|
1700 |
158383832 |
Spheniscine |
D |
May 25, 2022, 11:40 a.m. |
OK |
Rust 2021 |
TESTS |
209 |
15 |
1740800 |
|
1700 |
158383596 |
Spheniscine |
D |
May 25, 2022, 11:37 a.m. |
OK |
Rust 2021 |
TESTS |
209 |
15 |
1740800 |
|
1700 |
158382383 |
Spheniscine |
D |
May 25, 2022, 11:21 a.m. |
OK |
Rust 2021 |
TESTS |
209 |
30 |
2764800 |
|
1700 |
158552495 |
O0oo0Oo0OO0O0 |
D |
May 26, 2022, 5:13 p.m. |
OK |
Rust 2021 |
TESTS |
209 |
31 |
819200 |
|
1700 |
158552270 |
O0oo0Oo0OO0O0 |
D |
May 26, 2022, 5:11 p.m. |
OK |
Rust 2021 |
TESTS |
209 |
31 |
819200 |
|
1700 |
158551976 |
O0oo0Oo0OO0O0 |
D |
May 26, 2022, 5:07 p.m. |
OK |
Rust 2021 |
TESTS |
209 |
46 |
819200 |
|
1700 |
158554159 |
Hyrulia |
D |
May 26, 2022, 5:34 p.m. |
OK |
Rust 2021 |
TESTS |
209 |
156 |
2662400 |
|
1700 |
remove filters
Back to search problems