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'Vasya decided to pass a very large integer n to Kate. First, he wrote that number as a string, then he appended to the right integer k -- the number of digits in n. Magically, all the numbers were shuffled in arbitrary order while this note was passed to Kate. The only thing that Vasya remembers, is a non-empty substring of n (a substring of n is a sequence of consecutive digits of the number n). Vasya knows that there may be more than one way to restore the number n. Your task is to find the smallest possible initial integer n. Note that decimal representation of number n contained no leading zeroes, except the case the integer n was equal to zero itself (in this case a single digit 0 was used). The first line of the input contains the string received by Kate. The number of digits in this string does not exceed 1 xe2 x80 x89000 xe2 x80 x89000. The second line contains the substring of n which Vasya remembers. This string can contain leading zeroes. It is guaranteed that the input data is correct, and the answer always exists. Print the smalles integer n which Vasya could pass to Kate. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
35721698 |
White_Devil |
F |
Feb. 26, 2018, 6:27 a.m. |
OK |
GNU C++ |
TESTS |
118 |
31 |
6963200 |
|
2200 |
19939039 |
Eat_KFC |
F |
Aug. 18, 2016, 3:45 a.m. |
OK |
GNU C++ |
TESTS |
118 |
31 |
10137600 |
|
2200 |
24088629 |
only_998 |
F |
Jan. 24, 2017, 9:31 a.m. |
OK |
GNU C++ |
TESTS |
118 |
46 |
6144000 |
|
2200 |
20045762 |
coolxxx |
F |
Aug. 22, 2016, 12:24 p.m. |
OK |
GNU C++ |
TESTS |
118 |
46 |
7065600 |
|
2200 |
19452776 |
ODT |
F |
July 28, 2016, 2:50 a.m. |
OK |
GNU C++ |
TESTS |
118 |
46 |
7884800 |
|
2200 |
36366795 |
skywalkert |
F |
March 17, 2018, 5:27 p.m. |
OK |
GNU C++ |
TESTS |
118 |
46 |
10547200 |
|
2200 |
24898551 |
farmerboy |
F |
Feb. 22, 2017, 5:08 p.m. |
OK |
GNU C++ |
TESTS |
118 |
46 |
11264000 |
|
2200 |
20946887 |
FatChier |
F |
Sept. 27, 2016, 1:20 p.m. |
OK |
GNU C++ |
TESTS |
118 |
62 |
6860800 |
|
2200 |
19562946 |
jyx |
F |
Aug. 1, 2016, 2:39 p.m. |
OK |
GNU C++ |
TESTS |
118 |
77 |
2969600 |
|
2200 |
22281892 |
_ShadowSong |
F |
Nov. 17, 2016, 6:43 a.m. |
OK |
GNU C++ |
TESTS |
118 |
78 |
4300800 |
|
2200 |
59580228 |
rainboy |
F |
Aug. 27, 2019, 3:43 p.m. |
OK |
GNU C11 |
TESTS |
118 |
93 |
3072000 |
|
2200 |
33601497 |
Dreamchaser101 |
F |
Dec. 24, 2017, 9:50 p.m. |
OK |
GNU C++11 |
TESTS |
118 |
31 |
7884800 |
|
2200 |
33601500 |
Krosh |
F |
Dec. 24, 2017, 9:51 p.m. |
OK |
GNU C++11 |
TESTS |
118 |
31 |
7884800 |
|
2200 |
19568199 |
lxk |
F |
Aug. 1, 2016, 8:50 p.m. |
OK |
GNU C++11 |
TESTS |
118 |
31 |
8499200 |
|
2200 |
32996026 |
N3SL |
F |
Dec. 7, 2017, 8:50 a.m. |
OK |
GNU C++11 |
TESTS |
118 |
31 |
9113600 |
|
2200 |
32996050 |
vjudge3 |
F |
Dec. 7, 2017, 8:51 a.m. |
OK |
GNU C++11 |
TESTS |
118 |
31 |
9113600 |
|
2200 |
65709241 |
Deathstalker_Rexxar |
F |
Nov. 25, 2019, 1:44 p.m. |
OK |
GNU C++11 |
TESTS |
118 |
46 |
2969600 |
|
2200 |
65708222 |
Deathstalker_Rexxar |
F |
Nov. 25, 2019, 1:22 p.m. |
OK |
GNU C++11 |
TESTS |
118 |
46 |
2969600 |
|
2200 |
31133591 |
Amayoneko |
F |
Oct. 8, 2017, 5:38 a.m. |
OK |
GNU C++11 |
TESTS |
118 |
46 |
2969600 |
|
2200 |
65710484 |
luogu_bot2 |
F |
Nov. 25, 2019, 2:11 p.m. |
OK |
GNU C++11 |
TESTS |
118 |
46 |
2969600 |
|
2200 |
22940781 |
fengsuiyan |
F |
Dec. 14, 2016, 2:56 a.m. |
OK |
GNU C++11 |
TESTS |
118 |
46 |
3993600 |
|
2200 |
34483178 |
ShadowLight |
F |
Jan. 23, 2018, 1:14 p.m. |
OK |
GNU C++14 |
TESTS |
118 |
31 |
7168000 |
|
2200 |
20670134 |
4840648 |
F |
Sept. 16, 2016, 11:33 p.m. |
OK |
GNU C++14 |
TESTS |
118 |
31 |
9318400 |
|
2200 |
30275196 |
Amr.Ayman |
F |
Sept. 11, 2017, 10:33 p.m. |
OK |
GNU C++14 |
TESTS |
118 |
46 |
8396800 |
|
2200 |
26775335 |
angelg |
F |
April 30, 2017, 9:30 p.m. |
OK |
GNU C++14 |
TESTS |
118 |
46 |
9216000 |
|
2200 |
32748255 |
danilserov |
F |
Nov. 28, 2017, 11:40 a.m. |
OK |
GNU C++14 |
TESTS |
118 |
46 |
14848000 |
|
2200 |
20830033 |
zufe_zzt |
F |
Sept. 23, 2016, 4:23 a.m. |
OK |
GNU C++14 |
TESTS |
118 |
61 |
23040000 |
|
2200 |
27402269 |
ConnorZhong |
F |
May 28, 2017, 6:54 a.m. |
OK |
GNU C++14 |
TESTS |
118 |
62 |
6348800 |
|
2200 |
27402281 |
vjudge4 |
F |
May 28, 2017, 6:55 a.m. |
OK |
GNU C++14 |
TESTS |
118 |
62 |
6348800 |
|
2200 |
23382960 |
Ali.Pi |
F |
Dec. 28, 2016, 5:20 p.m. |
OK |
GNU C++14 |
TESTS |
118 |
62 |
9011200 |
|
2200 |
32840101 |
danya.smelskiy |
F |
Dec. 1, 2017, 7:34 p.m. |
OK |
GNU C++14 |
TESTS |
118 |
62 |
9011200 |
|
2200 |
49124445 |
Juve45 |
F |
Jan. 28, 2019, 9:25 p.m. |
OK |
GNU C++17 |
TESTS |
118 |
46 |
6963200 |
|
2200 |
67057758 |
zscoder |
F |
Dec. 17, 2019, 7:41 a.m. |
OK |
GNU C++17 |
TESTS |
118 |
46 |
7168000 |
|
2200 |
66660576 |
user202729_ |
F |
Dec. 12, 2019, 4:12 a.m. |
OK |
GNU C++17 |
TESTS |
118 |
46 |
7168000 |
|
2200 |
43419603 |
AM. |
F |
Sept. 25, 2018, 5:02 p.m. |
OK |
GNU C++17 |
TESTS |
118 |
46 |
7270400 |
|
2200 |
39935120 |
rebecacalazans |
F |
July 3, 2018, 7:59 p.m. |
OK |
GNU C++17 |
TESTS |
118 |
46 |
10035200 |
|
2200 |
38467037 |
Ashishgup |
F |
May 20, 2018, 6:23 p.m. |
OK |
GNU C++17 |
TESTS |
118 |
46 |
11366400 |
|
2200 |
69396073 |
RUSH_D_CAT |
F |
Jan. 23, 2020, 6:22 a.m. |
OK |
GNU C++17 |
TESTS |
118 |
61 |
6963200 |
|
2200 |
48509402 |
BlueDiamond |
F |
Jan. 17, 2019, 7:41 p.m. |
OK |
GNU C++17 |
TESTS |
118 |
62 |
5836800 |
|
2200 |
69209268 |
YJU |
F |
Jan. 20, 2020, 7:13 p.m. |
OK |
GNU C++17 |
TESTS |
118 |
62 |
7168000 |
|
2200 |
51084515 |
hat |
F |
March 9, 2019, 12:41 p.m. |
OK |
GNU C++17 |
TESTS |
118 |
62 |
10137600 |
|
2200 |
33593967 |
shreyansh97 |
F |
Dec. 24, 2017, 1:13 p.m. |
OK |
Java 8 |
TESTS |
118 |
218 |
25702400 |
|
2200 |
19917290 |
kafy83 |
F |
Aug. 17, 2016, 12:28 a.m. |
OK |
Java 8 |
TESTS |
118 |
218 |
29388800 |
|
2200 |
19654462 |
hama-du |
F |
Aug. 5, 2016, 3:27 p.m. |
OK |
Java 8 |
TESTS |
118 |
233 |
30822400 |
|
2200 |
59580227 |
Dukkha |
F |
Aug. 27, 2019, 3:43 p.m. |
OK |
Java 8 |
TESTS |
118 |
249 |
0 |
|
2200 |
21979346 |
pitfall |
F |
Nov. 1, 2016, 10:54 p.m. |
OK |
Java 8 |
TESTS |
118 |
295 |
13926400 |
|
2200 |
20494980 |
Corvus |
F |
Sept. 10, 2016, 10:25 a.m. |
OK |
Java 8 |
TESTS |
118 |
296 |
9011200 |
|
2200 |
20797287 |
dancingQueen |
F |
Sept. 21, 2016, 2:14 p.m. |
OK |
Java 8 |
TESTS |
118 |
311 |
18944000 |
|
2200 |
21121250 |
boreddy |
F |
Oct. 2, 2016, 5:22 p.m. |
OK |
Java 8 |
TESTS |
118 |
467 |
8192000 |
|
2200 |
23544496 |
daniboybye |
F |
Jan. 4, 2017, 9:48 p.m. |
OK |
MS C++ |
TESTS |
118 |
31 |
5120000 |
|
2200 |
23515398 |
nikdenev |
F |
Jan. 3, 2017, 11:34 a.m. |
OK |
MS C++ |
TESTS |
118 |
31 |
5120000 |
|
2200 |
21665445 |
AWCXV |
F |
Oct. 22, 2016, 11:37 a.m. |
OK |
MS C++ |
TESTS |
118 |
46 |
6144000 |
|
2200 |
23649065 |
MZuev |
F |
Jan. 8, 2017, 3:59 p.m. |
OK |
MS C++ |
TESTS |
118 |
46 |
9420800 |
|
2200 |
20047024 |
asdfadfavzxc |
F |
Aug. 22, 2016, 1:34 p.m. |
OK |
MS C++ |
TESTS |
118 |
187 |
3072000 |
|
2200 |
35151377 |
Yash_ |
F |
Feb. 11, 2018, 11:31 a.m. |
OK |
PyPy 2 |
TESTS |
118 |
93 |
31948800 |
|
2200 |
35890004 |
______M______ |
F |
March 3, 2018, 2:48 p.m. |
OK |
PyPy 2 |
TESTS |
118 |
109 |
31948800 |
|
2200 |
60324226 |
pajenegod |
F |
Sept. 9, 2019, 11:12 p.m. |
OK |
PyPy 2 |
TESTS |
118 |
343 |
61952000 |
|
2200 |
20372817 |
I_love_Ucdit |
F |
Sept. 4, 2016, 1:16 a.m. |
OK |
PyPy 3 |
TESTS |
118 |
436 |
14028800 |
|
2200 |
54584515 |
Aidos |
F |
May 25, 2019, 6:20 a.m. |
OK |
PyPy 3 |
TESTS |
118 |
608 |
113664000 |
|
2200 |
20372824 |
I_love_Ucdit |
F |
Sept. 4, 2016, 1:17 a.m. |
OK |
Python 3 |
TESTS |
118 |
420 |
6451200 |
|
2200 |
remove filters
Back to search problems