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 strings s and t consisting of lowercase Latin letters. Also you have a string z which is initially empty. You want string z to be equal to string t . You can perform the following operation to achieve this: append any subsequence of s at the end of string z . A subsequence is a sequence that can be derived from the given sequence by deleting zero or more elements without changing the order of the remaining elements. For example, if z = ac , s = abcde , you may turn z into following strings in one operation: Note that after this operation string s doesn't change. Calculate the minimum number of such operations to turn string z into string t . The first line contains the integer T ( 1 <= T <= 100 ) -- the number of test cases. The first line of each testcase contains one string s ( 1 <= |s| <= 10^5 ) consisting of lowercase Latin letters. The second line of each testcase contains one string t ( 1 <= |t| <= 10^5 ) consisting of lowercase Latin letters. It is guaranteed that the total length of all strings s and t in the input does not exceed 2 cdot 10^5 . For each testcase, print one integer -- the minimum number of operations to turn string z into string t . If it's impossible print -1 . "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
69777390 |
daut-dlang |
C |
Jan. 29, 2020, 4:23 p.m. |
OK |
D |
TESTS |
31 |
46 |
4198400 |
|
1600 |
69777940 |
LaSWeeG |
C |
Jan. 29, 2020, 4:25 p.m. |
OK |
FPC |
TESTS |
31 |
46 |
105369600 |
|
1600 |
69826317 |
TARIQ |
C |
Jan. 30, 2020, 9:15 a.m. |
OK |
GNU C11 |
TESTS |
31 |
31 |
10956800 |
|
1600 |
70573182 |
SUNNY24 |
C |
Feb. 8, 2020, 2:55 p.m. |
OK |
GNU C11 |
TESTS |
31 |
31 |
22016000 |
|
1600 |
69770154 |
rainboy |
C |
Jan. 29, 2020, 4 p.m. |
OK |
GNU C11 |
TESTS |
31 |
46 |
10649600 |
|
1600 |
69974482 |
whatsmyname |
C |
Feb. 1, 2020, 2:38 p.m. |
OK |
GNU C11 |
TESTS |
31 |
46 |
12185600 |
|
1600 |
69806993 |
kaiboy |
C |
Jan. 30, 2020, 2:26 a.m. |
OK |
GNU C11 |
TESTS |
31 |
46 |
21196800 |
|
1600 |
69770330 |
zcb |
C |
Jan. 29, 2020, 4 p.m. |
OK |
GNU C11 |
TESTS |
31 |
46 |
22016000 |
|
1600 |
69798109 |
alpeevandrey |
C |
Jan. 29, 2020, 9 p.m. |
OK |
GNU C11 |
TESTS |
31 |
93 |
209203200 |
|
1600 |
69906335 |
mth1908 |
C |
Jan. 31, 2020, 2:14 p.m. |
OK |
GNU C11 |
TESTS |
31 |
139 |
12288000 |
|
1600 |
69818661 |
dzx123 |
C |
Jan. 30, 2020, 6:59 a.m. |
OK |
GNU C++11 |
TESTS |
31 |
30 |
1228800 |
|
1600 |
69833249 |
BogdanGh |
C |
Jan. 30, 2020, 11:08 a.m. |
OK |
GNU C++11 |
TESTS |
31 |
30 |
11366400 |
|
1600 |
70567245 |
rures |
C |
Feb. 8, 2020, 1:30 p.m. |
OK |
GNU C++11 |
TESTS |
31 |
31 |
1228800 |
|
1600 |
70410702 |
vjudge4 |
C |
Feb. 6, 2020, 5:04 a.m. |
OK |
GNU C++11 |
TESTS |
31 |
31 |
1228800 |
|
1600 |
70346771 |
Artoriax |
C |
Feb. 5, 2020, 9:48 a.m. |
OK |
GNU C++11 |
TESTS |
31 |
31 |
1228800 |
|
1600 |
70341365 |
blackcoffee |
C |
Feb. 5, 2020, 8:30 a.m. |
OK |
GNU C++11 |
TESTS |
31 |
31 |
1228800 |
|
1600 |
70033876 |
CaoRui2019 |
C |
Feb. 2, 2020, 1:39 p.m. |
OK |
GNU C++11 |
TESTS |
31 |
31 |
1228800 |
|
1600 |
69900837 |
jlz |
C |
Jan. 31, 2020, 12:59 p.m. |
OK |
GNU C++11 |
TESTS |
31 |
31 |
1228800 |
|
1600 |
70628752 |
moomhxy |
C |
Feb. 9, 2020, 2:04 p.m. |
OK |
GNU C++11 |
TESTS |
31 |
31 |
1228800 |
|
1600 |
70799260 |
skmonir |
C |
Feb. 11, 2020, 4:25 p.m. |
OK |
GNU C++11 |
TESTS |
31 |
31 |
1228800 |
|
1600 |
69807562 |
SSaken |
C |
Jan. 30, 2020, 2:45 a.m. |
OK |
GNU C++14 |
TESTS |
31 |
15 |
1536000 |
|
1600 |
69889254 |
Tiwarijee |
C |
Jan. 31, 2020, 9:23 a.m. |
OK |
GNU C++14 |
TESTS |
31 |
15 |
2560000 |
|
1600 |
70034504 |
rk_244 |
C |
Feb. 2, 2020, 1:50 p.m. |
OK |
GNU C++14 |
TESTS |
31 |
30 |
1536000 |
|
1600 |
69779296 |
8e7 |
C |
Jan. 29, 2020, 4:29 p.m. |
OK |
GNU C++14 |
TESTS |
31 |
30 |
1536000 |
|
1600 |
69920289 |
hecxoc7 |
C |
Jan. 31, 2020, 6:12 p.m. |
OK |
GNU C++14 |
TESTS |
31 |
30 |
1536000 |
|
1600 |
69974363 |
puneet_08 |
C |
Feb. 1, 2020, 2:36 p.m. |
OK |
GNU C++14 |
TESTS |
31 |
30 |
1536000 |
|
1600 |
69857354 |
mkagenius |
C |
Jan. 30, 2020, 5:23 p.m. |
OK |
GNU C++14 |
TESTS |
31 |
30 |
1638400 |
|
1600 |
69779107 |
Bug_Maker |
C |
Jan. 29, 2020, 4:28 p.m. |
OK |
GNU C++14 |
TESTS |
31 |
30 |
1945600 |
|
1600 |
70029403 |
jsparrow858 |
C |
Feb. 2, 2020, 12:22 p.m. |
OK |
GNU C++14 |
TESTS |
31 |
30 |
2150400 |
|
1600 |
69967604 |
vjudge5 |
C |
Feb. 1, 2020, 1:05 p.m. |
OK |
GNU C++14 |
TESTS |
31 |
30 |
2355200 |
|
1600 |
70416549 |
loading.. |
C |
Feb. 6, 2020, 7:16 a.m. |
OK |
GNU C++17 |
TESTS |
31 |
30 |
1331200 |
|
1600 |
70512391 |
karry44 |
C |
Feb. 7, 2020, 3:14 p.m. |
OK |
GNU C++17 |
TESTS |
31 |
30 |
1331200 |
|
1600 |
69827753 |
vjudge1 |
C |
Jan. 30, 2020, 9:37 a.m. |
OK |
GNU C++17 |
TESTS |
31 |
30 |
1331200 |
|
1600 |
69841726 |
spike1236 |
C |
Jan. 30, 2020, 1:20 p.m. |
OK |
GNU C++17 |
TESTS |
31 |
30 |
1536000 |
|
1600 |
69851952 |
abdulrahman_aj |
C |
Jan. 30, 2020, 3:54 p.m. |
OK |
GNU C++17 |
TESTS |
31 |
30 |
1536000 |
|
1600 |
69866461 |
DreamWeaver |
C |
Jan. 30, 2020, 8:40 p.m. |
OK |
GNU C++17 |
TESTS |
31 |
30 |
1536000 |
|
1600 |
69870330 |
juniorcompressor |
C |
Jan. 30, 2020, 11:19 p.m. |
OK |
GNU C++17 |
TESTS |
31 |
30 |
1536000 |
|
1600 |
69887008 |
xuylego_ |
C |
Jan. 31, 2020, 8:35 a.m. |
OK |
GNU C++17 |
TESTS |
31 |
30 |
1536000 |
|
1600 |
69916326 |
soumik9876 |
C |
Jan. 31, 2020, 4:58 p.m. |
OK |
GNU C++17 |
TESTS |
31 |
30 |
1536000 |
|
1600 |
70407753 |
ydfy |
C |
Feb. 6, 2020, 3:27 a.m. |
OK |
GNU C++17 |
TESTS |
31 |
30 |
1536000 |
|
1600 |
69883561 |
synapse |
C |
Jan. 31, 2020, 7:19 a.m. |
OK |
Go |
TESTS |
31 |
62 |
18739200 |
|
1600 |
70406033 |
sighduck |
C |
Feb. 6, 2020, 2:19 a.m. |
OK |
Go |
TESTS |
31 |
78 |
46080000 |
|
1600 |
70005097 |
vjudge5 |
C |
Feb. 2, 2020, 4:23 a.m. |
OK |
Go |
TESTS |
31 |
592 |
27648000 |
|
1600 |
69987347 |
Trishan |
C |
Feb. 1, 2020, 6:13 p.m. |
OK |
Go |
TESTS |
31 |
623 |
4505600 |
|
1600 |
70003047 |
vjudge2 |
C |
Feb. 2, 2020, 3:05 a.m. |
OK |
Go |
TESTS |
31 |
623 |
10444800 |
|
1600 |
70006032 |
vjudge2 |
C |
Feb. 2, 2020, 4:54 a.m. |
OK |
Go |
TESTS |
31 |
639 |
4505600 |
|
1600 |
70009086 |
vjudge5 |
C |
Feb. 2, 2020, 6:08 a.m. |
OK |
Go |
TESTS |
31 |
655 |
4505600 |
|
1600 |
69807950 |
j31d0 |
C |
Jan. 30, 2020, 2:57 a.m. |
OK |
Haskell |
TESTS |
31 |
124 |
26419200 |
|
1600 |
70029454 |
yizheng |
C |
Feb. 2, 2020, 12:23 p.m. |
OK |
Java 11 |
TESTS |
31 |
202 |
0 |
|
1600 |
69834242 |
elkadymohammed01 |
C |
Jan. 30, 2020, 11:22 a.m. |
OK |
Java 11 |
TESTS |
31 |
202 |
6144000 |
|
1600 |
70122169 |
s1052823 |
C |
Feb. 3, 2020, 9 a.m. |
OK |
Java 11 |
TESTS |
31 |
217 |
0 |
|
1600 |
69787242 |
avijit_agarwal |
C |
Jan. 29, 2020, 5:29 p.m. |
OK |
Java 11 |
TESTS |
31 |
217 |
0 |
|
1600 |
69771884 |
_apurv_ |
C |
Jan. 29, 2020, 4:05 p.m. |
OK |
Java 11 |
TESTS |
31 |
217 |
6348800 |
|
1600 |
69785885 |
shamdin |
C |
Jan. 29, 2020, 5:12 p.m. |
OK |
Java 11 |
TESTS |
31 |
218 |
0 |
|
1600 |
69774215 |
avijit_agarwal |
C |
Jan. 29, 2020, 4:13 p.m. |
OK |
Java 11 |
TESTS |
31 |
218 |
0 |
|
1600 |
69840480 |
jenish9599 |
C |
Jan. 30, 2020, 1:01 p.m. |
OK |
Java 11 |
TESTS |
31 |
218 |
18022400 |
|
1600 |
70186998 |
lifeiteng |
C |
Feb. 3, 2020, 10:44 p.m. |
OK |
Java 11 |
TESTS |
31 |
233 |
0 |
|
1600 |
70026473 |
yizheng |
C |
Feb. 2, 2020, 11:33 a.m. |
OK |
Java 11 |
TESTS |
31 |
233 |
0 |
|
1600 |
70186724 |
salmaelmahy |
C |
Feb. 3, 2020, 10:31 p.m. |
OK |
Java 8 |
TESTS |
31 |
139 |
0 |
|
1600 |
69828522 |
nidhigoel |
C |
Jan. 30, 2020, 9:48 a.m. |
OK |
Java 8 |
TESTS |
31 |
139 |
0 |
|
1600 |
69825604 |
bluesky111 |
C |
Jan. 30, 2020, 9:05 a.m. |
OK |
Java 8 |
TESTS |
31 |
139 |
0 |
|
1600 |
69870187 |
aearly |
C |
Jan. 30, 2020, 11:10 p.m. |
OK |
Java 8 |
TESTS |
31 |
139 |
15974400 |
|
1600 |
69937409 |
liuhanguang |
C |
Feb. 1, 2020, 4:36 a.m. |
OK |
Java 8 |
TESTS |
31 |
140 |
0 |
|
1600 |
69769468 |
Akshita_Maheshwari |
C |
Jan. 29, 2020, 3:58 p.m. |
OK |
Java 8 |
TESTS |
31 |
140 |
0 |
|
1600 |
69878695 |
Java |
C |
Jan. 31, 2020, 5:25 a.m. |
OK |
Java 8 |
TESTS |
31 |
140 |
5222400 |
|
1600 |
69842232 |
an09mous |
C |
Jan. 30, 2020, 1:28 p.m. |
OK |
Java 8 |
TESTS |
31 |
140 |
5427200 |
|
1600 |
70400912 |
unicorn20141 |
C |
Feb. 5, 2020, 9:58 p.m. |
OK |
Java 8 |
TESTS |
31 |
140 |
5734400 |
|
1600 |
70099652 |
SaurabhMaster |
C |
Feb. 2, 2020, 10:16 p.m. |
OK |
Java 8 |
TESTS |
31 |
140 |
14540800 |
|
1600 |
69978495 |
sanori |
C |
Feb. 1, 2020, 3:39 p.m. |
OK |
JavaScript |
TESTS |
31 |
982 |
97894400 |
|
1600 |
69807723 |
Spheniscine |
C |
Jan. 30, 2020, 2:49 a.m. |
OK |
Kotlin |
TESTS |
31 |
156 |
0 |
|
1600 |
69829371 |
SlavaG |
C |
Jan. 30, 2020, 10:01 a.m. |
OK |
Kotlin |
TESTS |
31 |
171 |
0 |
|
1600 |
69767300 |
sergmel |
C |
Jan. 29, 2020, 3:51 p.m. |
OK |
Mono C# |
TESTS |
31 |
77 |
2764800 |
|
1600 |
69855681 |
nastya1199 |
C |
Jan. 30, 2020, 4:53 p.m. |
OK |
Mono C# |
TESTS |
31 |
77 |
6451200 |
|
1600 |
69782416 |
ngtkana |
C |
Jan. 29, 2020, 4:39 p.m. |
OK |
Mono C# |
TESTS |
31 |
77 |
11878400 |
|
1600 |
69909824 |
artworks |
C |
Jan. 31, 2020, 3:04 p.m. |
OK |
Mono C# |
TESTS |
31 |
93 |
16896000 |
|
1600 |
70775095 |
sakapon |
C |
Feb. 11, 2020, 8:35 a.m. |
OK |
Mono C# |
TESTS |
31 |
108 |
9728000 |
|
1600 |
71055181 |
vjudge1 |
C |
Feb. 14, 2020, 11:27 a.m. |
OK |
MS C++ |
TESTS |
31 |
31 |
1843200 |
|
1600 |
69896648 |
vjudge4 |
C |
Jan. 31, 2020, 11:56 a.m. |
OK |
MS C++ |
TESTS |
31 |
31 |
1945600 |
|
1600 |
69897732 |
vjudge1 |
C |
Jan. 31, 2020, 12:12 p.m. |
OK |
MS C++ |
TESTS |
31 |
46 |
1843200 |
|
1600 |
69769143 |
songhaoran |
C |
Jan. 29, 2020, 3:57 p.m. |
OK |
MS C++ |
TESTS |
31 |
46 |
10649600 |
|
1600 |
69786391 |
dymicboy |
C |
Jan. 29, 2020, 5:18 p.m. |
OK |
MS C++ |
TESTS |
31 |
124 |
12288000 |
|
1600 |
69804219 |
Chitanda_ |
C |
Jan. 30, 2020, 12:37 a.m. |
OK |
MS C++ |
TESTS |
31 |
139 |
30720000 |
|
1600 |
69840117 |
lyzdxh |
C |
Jan. 30, 2020, 12:56 p.m. |
OK |
MS C++ 2017 |
TESTS |
31 |
31 |
1740800 |
|
1600 |
69831561 |
Conan73 |
C |
Jan. 30, 2020, 10:38 a.m. |
OK |
MS C++ 2017 |
TESTS |
31 |
31 |
1843200 |
|
1600 |
69842612 |
vjudge2 |
C |
Jan. 30, 2020, 1:33 p.m. |
OK |
MS C++ 2017 |
TESTS |
31 |
31 |
1843200 |
|
1600 |
70846408 |
vjudge5 |
C |
Feb. 12, 2020, 1:36 p.m. |
OK |
MS C++ 2017 |
TESTS |
31 |
31 |
1945600 |
|
1600 |
70581721 |
vjudge2 |
C |
Feb. 8, 2020, 5:24 p.m. |
OK |
MS C++ 2017 |
TESTS |
31 |
31 |
1945600 |
|
1600 |
69897450 |
Surpass_HBU |
C |
Jan. 31, 2020, 12:08 p.m. |
OK |
MS C++ 2017 |
TESTS |
31 |
31 |
1945600 |
|
1600 |
70346075 |
a.i.miroshnikov |
C |
Feb. 5, 2020, 9:39 a.m. |
OK |
MS C++ 2017 |
TESTS |
31 |
31 |
1945600 |
|
1600 |
69817624 |
sheshen |
C |
Jan. 30, 2020, 6:41 a.m. |
OK |
MS C++ 2017 |
TESTS |
31 |
31 |
2150400 |
|
1600 |
69917671 |
Ivan_Dunko |
C |
Jan. 31, 2020, 5:23 p.m. |
OK |
MS C++ 2017 |
TESTS |
31 |
31 |
2150400 |
|
1600 |
70582284 |
vjudge5 |
C |
Feb. 8, 2020, 5:34 p.m. |
OK |
MS C++ 2017 |
TESTS |
31 |
31 |
2150400 |
|
1600 |
69873954 |
Mmcs |
C |
Jan. 31, 2020, 2:42 a.m. |
OK |
PascalABC.NET |
TESTS |
31 |
327 |
13721600 |
|
1600 |
69873769 |
Mmcs |
C |
Jan. 31, 2020, 2:33 a.m. |
OK |
PascalABC.NET |
TESTS |
31 |
358 |
20992000 |
|
1600 |
69873565 |
Mmcs |
C |
Jan. 31, 2020, 2:24 a.m. |
OK |
PascalABC.NET |
TESTS |
31 |
373 |
20992000 |
|
1600 |
69883733 |
aaa_bbb_ccc |
C |
Jan. 31, 2020, 7:23 a.m. |
OK |
PyPy 2 |
TESTS |
31 |
155 |
4198400 |
|
1600 |
69885804 |
tinker_1337 |
C |
Jan. 31, 2020, 8:09 a.m. |
OK |
PyPy 3 |
TESTS |
31 |
171 |
5427200 |
|
1600 |
69864391 |
LionCheetah |
C |
Jan. 30, 2020, 7:45 p.m. |
OK |
PyPy 3 |
TESTS |
31 |
187 |
5734400 |
|
1600 |
69854327 |
chayapatlbs |
C |
Jan. 30, 2020, 4:32 p.m. |
OK |
PyPy 3 |
TESTS |
31 |
187 |
6144000 |
|
1600 |
70035314 |
Anuranjan_Pandey |
C |
Feb. 2, 2020, 2:01 p.m. |
OK |
PyPy 3 |
TESTS |
31 |
202 |
5632000 |
|
1600 |
69935599 |
XeroxAuto |
C |
Feb. 1, 2020, 3:31 a.m. |
OK |
PyPy 3 |
TESTS |
31 |
202 |
5836800 |
|
1600 |
69767905 |
newsatit97 |
C |
Jan. 29, 2020, 3:53 p.m. |
OK |
PyPy 3 |
TESTS |
31 |
202 |
5939200 |
|
1600 |
69860847 |
sjoshi13 |
C |
Jan. 30, 2020, 6:27 p.m. |
OK |
PyPy 3 |
TESTS |
31 |
202 |
6144000 |
|
1600 |
69987680 |
meetpr8 |
C |
Feb. 1, 2020, 6:19 p.m. |
OK |
PyPy 3 |
TESTS |
31 |
202 |
6246400 |
|
1600 |
70215149 |
saturdaygenfo |
C |
Feb. 4, 2020, 9:28 a.m. |
OK |
PyPy 3 |
TESTS |
31 |
202 |
6348800 |
|
1600 |
69778335 |
runnie |
C |
Jan. 29, 2020, 4:26 p.m. |
OK |
PyPy 3 |
TESTS |
31 |
202 |
6656000 |
|
1600 |
69977630 |
jbacher |
C |
Feb. 1, 2020, 3:25 p.m. |
OK |
Python 3 |
TESTS |
31 |
233 |
2969600 |
|
1600 |
69851210 |
guiferviz |
C |
Jan. 30, 2020, 3:41 p.m. |
OK |
Python 3 |
TESTS |
31 |
265 |
3481600 |
|
1600 |
69849842 |
guiferviz |
C |
Jan. 30, 2020, 3:18 p.m. |
OK |
Python 3 |
TESTS |
31 |
265 |
3481600 |
|
1600 |
70208233 |
Annvv |
C |
Feb. 4, 2020, 7:14 a.m. |
OK |
Python 3 |
TESTS |
31 |
280 |
3174400 |
|
1600 |
69853810 |
n0body9200 |
C |
Jan. 30, 2020, 4:24 p.m. |
OK |
Python 3 |
TESTS |
31 |
280 |
3276800 |
|
1600 |
70811772 |
jasonx3 |
C |
Feb. 11, 2020, 8:43 p.m. |
OK |
Python 3 |
TESTS |
31 |
280 |
4505600 |
|
1600 |
69789714 |
r57shell |
C |
Jan. 29, 2020, 6:09 p.m. |
OK |
Python 3 |
TESTS |
31 |
280 |
16588800 |
|
1600 |
69778086 |
hxnf |
C |
Jan. 29, 2020, 4:25 p.m. |
OK |
Python 3 |
TESTS |
31 |
295 |
3891200 |
|
1600 |
70108339 |
jasonx3 |
C |
Feb. 3, 2020, 4:23 a.m. |
OK |
Python 3 |
TESTS |
31 |
296 |
4403200 |
|
1600 |
69769822 |
nethish |
C |
Jan. 29, 2020, 3:59 p.m. |
OK |
Python 3 |
TESTS |
31 |
296 |
4505600 |
|
1600 |
70511857 |
terraformer |
C |
Feb. 7, 2020, 3:05 p.m. |
OK |
Rust |
TESTS |
31 |
31 |
1843200 |
|
1600 |
70738772 |
yc0304 |
C |
Feb. 10, 2020, 3:23 p.m. |
OK |
Rust |
TESTS |
31 |
46 |
1331200 |
|
1600 |
70738732 |
vjudge5 |
C |
Feb. 10, 2020, 3:22 p.m. |
OK |
Rust |
TESTS |
31 |
46 |
1331200 |
|
1600 |
69767440 |
akiradeveloper |
C |
Jan. 29, 2020, 3:51 p.m. |
OK |
Rust |
TESTS |
31 |
46 |
2252800 |
|
1600 |
69856322 |
Nogard_ |
C |
Jan. 30, 2020, 5:04 p.m. |
OK |
Rust |
TESTS |
31 |
77 |
23756800 |
|
1600 |
69792428 |
BadDuck |
C |
Jan. 29, 2020, 6:55 p.m. |
OK |
Scala |
TESTS |
31 |
546 |
5120000 |
|
1600 |
70715250 |
reldan |
C |
Feb. 10, 2020, 8:19 a.m. |
OK |
Scala |
TESTS |
31 |
904 |
32256000 |
|
1600 |
remove filters
Back to search problems