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'Ashish has two strings a and b , each of length n , and an integer k . The strings only contain lowercase English letters. He wants to convert string a into string b by performing some (possibly zero) operations on a . In one move, he can either Note that he can perform any number of operations, and the operations can only be performed on string a . Help Ashish determine if it is possible to convert string a into b after performing some (possibly zero) operations on it. The first line contains a single integer t ( 1 <= q t <= q 10^5 ) -- the number of test cases. The description of each test case is as follows. The first line of each test case contains two integers n ( 2 <= q n <= q 10^6 ) and k ( 1 <= q k <= q n ). The second line of each test case contains the string a of length n consisting of lowercase English letters. The third line of each test case contains the string b of length n consisting of lowercase English letters. It is guaranteed that the sum of values n among all test cases does not exceed 10^6 . For each test case, print "Yes" if Ashish can convert a into b after some moves, else print "No". You may print the letters of the answer in any case (upper or lower). In the first test case it can be shown that it is impossible to convert a into b . In the second test case, "abba" xrightarrow{ text{inc}} "acca" xrightarrow{ text{inc}} ldots xrightarrow{ text{inc}} "azza". Here "swap" denotes an operation of the first type, and "inc" denotes an operation of the second type. In the fourth test case, "aaabba" xrightarrow{ text{swap}} "aaabab" xrightarrow{ text{swap}} "aaaabb" xrightarrow{ text{inc}} ldots xrightarrow{ text{inc}} "ddaabb" xrightarrow{ text{inc}} ldots xrightarrow{ text{inc}} "ddddbb" xrightarrow{ text{i'... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
99211829 |
quangngg |
C |
Nov. 22, 2020, 3:33 a.m. |
OK |
FPC |
TESTS |
59 |
467 |
21913600 |
|
|
99220382 |
biltharesatyendra |
C |
Nov. 22, 2020, 5:57 a.m. |
OK |
GNU C11 |
TESTS |
59 |
405 |
2048000 |
|
|
99213918 |
Mithu.ict |
C |
Nov. 22, 2020, 4:17 a.m. |
OK |
GNU C11 |
TESTS |
59 |
421 |
2048000 |
|
|
99195831 |
babaiserror |
C |
Nov. 21, 2020, 7:37 p.m. |
OK |
GNU C11 |
TESTS |
59 |
483 |
2048000 |
|
|
99184513 |
NashChen |
C |
Nov. 21, 2020, 4:39 p.m. |
OK |
GNU C++11 |
TESTS |
59 |
77 |
2048000 |
|
|
99178675 |
wxy2005 |
C |
Nov. 21, 2020, 4:22 p.m. |
OK |
GNU C++11 |
TESTS |
59 |
77 |
2048000 |
|
|
99206707 |
275307894a |
C |
Nov. 22, 2020, 1:10 a.m. |
OK |
GNU C++11 |
TESTS |
59 |
78 |
0 |
|
|
99182677 |
ztxtjz |
C |
Nov. 21, 2020, 4:33 p.m. |
OK |
GNU C++11 |
TESTS |
59 |
78 |
0 |
|
|
99202832 |
2uoidub |
C |
Nov. 21, 2020, 10:09 p.m. |
OK |
GNU C++11 |
TESTS |
59 |
78 |
0 |
|
|
99208152 |
1437658015 |
C |
Nov. 22, 2020, 1:56 a.m. |
OK |
GNU C++11 |
TESTS |
59 |
78 |
2048000 |
|
|
99216479 |
wandisty |
C |
Nov. 22, 2020, 5 a.m. |
OK |
GNU C++11 |
TESTS |
59 |
78 |
2048000 |
|
|
99209923 |
leapfrog |
C |
Nov. 22, 2020, 2:45 a.m. |
OK |
GNU C++11 |
TESTS |
59 |
78 |
2048000 |
|
|
99209281 |
LiNY2 |
C |
Nov. 22, 2020, 2:29 a.m. |
OK |
GNU C++11 |
TESTS |
59 |
78 |
2048000 |
|
|
99205641 |
Hongzy |
C |
Nov. 22, 2020, 12:21 a.m. |
OK |
GNU C++11 |
TESTS |
59 |
78 |
10035200 |
|
|
99213268 |
mynamemosta |
C |
Nov. 22, 2020, 4:06 a.m. |
OK |
GNU C++14 |
TESTS |
59 |
93 |
4198400 |
|
|
99178476 |
shellspicker |
C |
Nov. 21, 2020, 4:21 p.m. |
OK |
GNU C++14 |
TESTS |
59 |
93 |
5222400 |
|
|
99206828 |
conxincacu |
C |
Nov. 22, 2020, 1:16 a.m. |
OK |
GNU C++14 |
TESTS |
59 |
108 |
2662400 |
|
|
99217262 |
Samomi |
C |
Nov. 22, 2020, 5:12 a.m. |
OK |
GNU C++14 |
TESTS |
59 |
108 |
2662400 |
|
|
99205558 |
antguz |
C |
Nov. 22, 2020, 12:18 a.m. |
OK |
GNU C++14 |
TESTS |
59 |
109 |
2048000 |
|
|
99199941 |
Evang |
C |
Nov. 21, 2020, 8:48 p.m. |
OK |
GNU C++14 |
TESTS |
59 |
109 |
2048000 |
|
|
99212304 |
codeTheworld3101 |
C |
Nov. 22, 2020, 3:44 a.m. |
OK |
GNU C++14 |
TESTS |
59 |
109 |
2662400 |
|
|
99219767 |
Lecseruz |
C |
Nov. 22, 2020, 5:49 a.m. |
OK |
GNU C++14 |
TESTS |
59 |
109 |
2662400 |
|
|
99213234 |
sainiashish459 |
C |
Nov. 22, 2020, 4:05 a.m. |
OK |
GNU C++14 |
TESTS |
59 |
109 |
2662400 |
|
|
99206493 |
Mj9244 |
C |
Nov. 22, 2020, 1:01 a.m. |
OK |
GNU C++14 |
TESTS |
59 |
109 |
2662400 |
|
|
99202702 |
agrawal117 |
C |
Nov. 21, 2020, 10:05 p.m. |
OK |
GNU C++17 |
TESTS |
59 |
108 |
2662400 |
|
|
99202023 |
recognizeArtsakh |
C |
Nov. 21, 2020, 9:41 p.m. |
OK |
GNU C++17 |
TESTS |
59 |
108 |
2662400 |
|
|
99199146 |
penguinhacker |
C |
Nov. 21, 2020, 8:30 p.m. |
OK |
GNU C++17 |
TESTS |
59 |
108 |
2662400 |
|
|
99210868 |
nsuPiece |
C |
Nov. 22, 2020, 3:09 a.m. |
OK |
GNU C++17 |
TESTS |
59 |
109 |
0 |
|
|
99206290 |
vm7 |
C |
Nov. 22, 2020, 12:52 a.m. |
OK |
GNU C++17 |
TESTS |
59 |
109 |
0 |
|
|
99211529 |
silverxz |
C |
Nov. 22, 2020, 3:26 a.m. |
OK |
GNU C++17 |
TESTS |
59 |
109 |
1945600 |
|
|
99213029 |
virtuoso_king |
C |
Nov. 22, 2020, 4:01 a.m. |
OK |
GNU C++17 |
TESTS |
59 |
109 |
2048000 |
|
|
99214277 |
vjudge3 |
C |
Nov. 22, 2020, 4:23 a.m. |
OK |
GNU C++17 |
TESTS |
59 |
109 |
2048000 |
|
|
99210190 |
SomehowArk |
C |
Nov. 22, 2020, 2:51 a.m. |
OK |
GNU C++17 |
TESTS |
59 |
109 |
2048000 |
|
|
99208882 |
Hex1234567 |
C |
Nov. 22, 2020, 2:18 a.m. |
OK |
GNU C++17 |
TESTS |
59 |
109 |
2048000 |
|
|
99215999 |
alif_cse_ju |
C |
Nov. 22, 2020, 4:52 a.m. |
OK |
GNU C++17 (64) |
TESTS |
59 |
78 |
3686400 |
|
|
99206764 |
Arrebol |
C |
Nov. 22, 2020, 1:13 a.m. |
OK |
GNU C++17 (64) |
TESTS |
59 |
93 |
2048000 |
|
|
99197454 |
ritik_patel05 |
C |
Nov. 21, 2020, 7:59 p.m. |
OK |
GNU C++17 (64) |
TESTS |
59 |
93 |
3686400 |
|
|
99210637 |
Sakhiya07 |
C |
Nov. 22, 2020, 3:03 a.m. |
OK |
GNU C++17 (64) |
TESTS |
59 |
93 |
3686400 |
|
|
99214242 |
over_flow |
C |
Nov. 22, 2020, 4:23 a.m. |
OK |
GNU C++17 (64) |
TESTS |
59 |
93 |
3686400 |
|
|
99208735 |
QFYNH |
C |
Nov. 22, 2020, 2:14 a.m. |
OK |
GNU C++17 (64) |
TESTS |
59 |
93 |
3686400 |
|
|
99208301 |
LethalPuppy |
C |
Nov. 22, 2020, 2 a.m. |
OK |
GNU C++17 (64) |
TESTS |
59 |
93 |
3686400 |
|
|
99204136 |
madlogic |
C |
Nov. 21, 2020, 11:04 p.m. |
OK |
GNU C++17 (64) |
TESTS |
59 |
93 |
3686400 |
|
|
99206093 |
nullmn |
C |
Nov. 22, 2020, 12:43 a.m. |
OK |
GNU C++17 (64) |
TESTS |
59 |
93 |
3686400 |
|
|
99199760 |
G0ingInsqne |
C |
Nov. 21, 2020, 8:44 p.m. |
OK |
GNU C++17 (64) |
TESTS |
59 |
93 |
3686400 |
|
|
99218470 |
manojthakur123450 |
C |
Nov. 22, 2020, 5:30 a.m. |
OK |
Java 11 |
TESTS |
59 |
249 |
0 |
|
|
99204745 |
Debojit219 |
C |
Nov. 21, 2020, 11:33 p.m. |
OK |
Java 11 |
TESTS |
59 |
249 |
0 |
|
|
99218334 |
RuthlessAggression |
C |
Nov. 22, 2020, 5:28 a.m. |
OK |
Java 11 |
TESTS |
59 |
264 |
0 |
|
|
99212872 |
sanju2504 |
C |
Nov. 22, 2020, 3:58 a.m. |
OK |
Java 11 |
TESTS |
59 |
265 |
614400 |
|
|
99211528 |
mphillotry |
C |
Nov. 22, 2020, 3:26 a.m. |
OK |
Java 11 |
TESTS |
59 |
295 |
0 |
|
|
99181581 |
KhanhNguyenn |
C |
Nov. 21, 2020, 4:30 p.m. |
OK |
Java 11 |
TESTS |
59 |
358 |
0 |
|
|
99184104 |
Relief |
C |
Nov. 21, 2020, 4:38 p.m. |
OK |
Java 11 |
TESTS |
59 |
373 |
204800 |
|
|
99183627 |
shankha123 |
C |
Nov. 21, 2020, 4:36 p.m. |
OK |
Java 11 |
TESTS |
59 |
373 |
614400 |
|
|
99199578 |
nishantdhingrabtlknps |
C |
Nov. 21, 2020, 8:40 p.m. |
OK |
Java 11 |
TESTS |
59 |
389 |
0 |
|
|
99180714 |
gsahil216 |
C |
Nov. 21, 2020, 4:28 p.m. |
OK |
Java 11 |
TESTS |
59 |
405 |
204800 |
|
|
99212231 |
cf_cf |
C |
Nov. 22, 2020, 3:42 a.m. |
OK |
Java 8 |
TESTS |
59 |
155 |
0 |
|
|
99206748 |
kirubankamaraj |
C |
Nov. 22, 2020, 1:12 a.m. |
OK |
Java 8 |
TESTS |
59 |
156 |
0 |
|
|
99216326 |
sumitnitesh123 |
C |
Nov. 22, 2020, 4:58 a.m. |
OK |
Java 8 |
TESTS |
59 |
187 |
0 |
|
|
99204102 |
qlf9 |
C |
Nov. 21, 2020, 11:02 p.m. |
OK |
Java 8 |
TESTS |
59 |
187 |
0 |
|
|
99200531 |
rushilpaul |
C |
Nov. 21, 2020, 9:03 p.m. |
OK |
Java 8 |
TESTS |
59 |
187 |
0 |
|
|
99201262 |
rushilpaul |
C |
Nov. 21, 2020, 9:22 p.m. |
OK |
Java 8 |
TESTS |
59 |
202 |
0 |
|
|
99209275 |
RichardBot7000 |
C |
Nov. 22, 2020, 2:29 a.m. |
OK |
Java 8 |
TESTS |
59 |
202 |
0 |
|
|
99200512 |
2020akadaver |
C |
Nov. 21, 2020, 9:03 p.m. |
OK |
Java 8 |
TESTS |
59 |
217 |
0 |
|
|
99212279 |
cf_cf |
C |
Nov. 22, 2020, 3:43 a.m. |
OK |
Java 8 |
TESTS |
59 |
218 |
0 |
|
|
99194350 |
MartyByrde |
C |
Nov. 21, 2020, 7:24 p.m. |
OK |
Java 8 |
TESTS |
59 |
233 |
0 |
|
|
99202921 |
Tlatoani |
C |
Nov. 21, 2020, 10:13 p.m. |
OK |
Kotlin |
TESTS |
59 |
202 |
716800 |
|
|
99186823 |
dkozak94 |
C |
Nov. 21, 2020, 4:45 p.m. |
OK |
Kotlin |
TESTS |
59 |
1122 |
0 |
|
|
99195906 |
amelentev |
C |
Nov. 21, 2020, 7:38 p.m. |
OK |
Kotlin |
TESTS |
59 |
1809 |
1536000 |
|
|
99196293 |
amelentev |
C |
Nov. 21, 2020, 7:43 p.m. |
OK |
Kotlin |
TESTS |
59 |
1918 |
1331200 |
|
|
99188315 |
vjgarcia |
C |
Nov. 21, 2020, 4:48 p.m. |
OK |
Kotlin |
TESTS |
59 |
1996 |
4710400 |
|
|
99215477 |
vjudge4 |
C |
Nov. 22, 2020, 4:44 a.m. |
OK |
MS C++ |
TESTS |
59 |
109 |
3993600 |
|
|
99179800 |
air_2 |
C |
Nov. 21, 2020, 4:25 p.m. |
OK |
MS C++ |
TESTS |
59 |
342 |
0 |
|
|
99208937 |
dingzhao777 |
C |
Nov. 22, 2020, 2:20 a.m. |
OK |
MS C++ 2017 |
TESTS |
59 |
140 |
1024000 |
|
|
99197212 |
IronArt |
C |
Nov. 21, 2020, 7:55 p.m. |
OK |
MS C++ 2017 |
TESTS |
59 |
187 |
3174400 |
|
|
99179322 |
rafle |
C |
Nov. 21, 2020, 4:24 p.m. |
OK |
MS C++ 2017 |
TESTS |
59 |
202 |
2048000 |
|
|
99189037 |
minigimbob |
C |
Nov. 21, 2020, 4:49 p.m. |
OK |
MS C++ 2017 |
TESTS |
59 |
420 |
3174400 |
|
|
99202442 |
Triss_Merigold |
C |
Nov. 21, 2020, 9:55 p.m. |
OK |
MS C++ 2017 |
TESTS |
59 |
530 |
3174400 |
|
|
99213903 |
zstu18luoxianyu |
C |
Nov. 22, 2020, 4:17 a.m. |
OK |
MS C++ 2017 |
TESTS |
59 |
561 |
2048000 |
|
|
99178504 |
dingzhao777 |
C |
Nov. 21, 2020, 4:21 p.m. |
OK |
MS C++ 2017 |
TESTS |
59 |
701 |
3174400 |
|
|
99184648 |
Targas |
C |
Nov. 21, 2020, 4:39 p.m. |
OK |
MS C++ 2017 |
TESTS |
59 |
795 |
3584000 |
|
|
99179727 |
sy20190441030 |
C |
Nov. 21, 2020, 4:25 p.m. |
OK |
MS C++ 2017 |
TESTS |
59 |
920 |
2048000 |
|
|
99185955 |
gandalftix |
C |
Nov. 21, 2020, 4:43 p.m. |
OK |
MS C++ 2017 |
TESTS |
59 |
982 |
3174400 |
|
|
99197361 |
eisichenko |
C |
Nov. 21, 2020, 7:58 p.m. |
OK |
.NET Core C# |
TESTS |
59 |
140 |
6963200 |
|
|
99198429 |
eisichenko |
C |
Nov. 21, 2020, 8:16 p.m. |
OK |
.NET Core C# |
TESTS |
59 |
155 |
6963200 |
|
|
99197626 |
eisichenko |
C |
Nov. 21, 2020, 8:02 p.m. |
OK |
.NET Core C# |
TESTS |
59 |
155 |
7270400 |
|
|
99198473 |
eisichenko |
C |
Nov. 21, 2020, 8:16 p.m. |
OK |
.NET Core C# |
TESTS |
59 |
156 |
6963200 |
|
|
99197172 |
eisichenko |
C |
Nov. 21, 2020, 7:55 p.m. |
OK |
.NET Core C# |
TESTS |
59 |
171 |
6963200 |
|
|
99198391 |
eisichenko |
C |
Nov. 21, 2020, 8:15 p.m. |
OK |
.NET Core C# |
TESTS |
59 |
187 |
6963200 |
|
|
99197087 |
eisichenko |
C |
Nov. 21, 2020, 7:54 p.m. |
OK |
.NET Core C# |
TESTS |
59 |
187 |
6963200 |
|
|
99196364 |
eisichenko |
C |
Nov. 21, 2020, 7:44 p.m. |
OK |
.NET Core C# |
TESTS |
59 |
202 |
6963200 |
|
|
99198414 |
eisichenko |
C |
Nov. 21, 2020, 8:16 p.m. |
OK |
.NET Core C# |
TESTS |
59 |
218 |
6963200 |
|
|
99196164 |
eisichenko |
C |
Nov. 21, 2020, 7:41 p.m. |
OK |
.NET Core C# |
TESTS |
59 |
638 |
6860800 |
|
|
99199726 |
mrinal2233 |
C |
Nov. 21, 2020, 8:43 p.m. |
OK |
PyPy 2 |
TESTS |
59 |
499 |
52838400 |
|
|
99212121 |
2019ucp1350 |
C |
Nov. 22, 2020, 3:40 a.m. |
OK |
PyPy 3 |
TESTS |
59 |
358 |
16691200 |
|
|
99202835 |
BOUGA |
C |
Nov. 21, 2020, 10:09 p.m. |
OK |
PyPy 3 |
TESTS |
59 |
421 |
21504000 |
|
|
99203209 |
BOUGA |
C |
Nov. 21, 2020, 10:23 p.m. |
OK |
PyPy 3 |
TESTS |
59 |
514 |
13004800 |
|
|
99199033 |
amr_anwr |
C |
Nov. 21, 2020, 8:28 p.m. |
OK |
PyPy 3 |
TESTS |
59 |
561 |
11571200 |
|
|
99213827 |
srijan.sarkar |
C |
Nov. 22, 2020, 4:16 a.m. |
OK |
PyPy 3 |
TESTS |
59 |
576 |
11776000 |
|
|
99180146 |
Zhao-Linke |
C |
Nov. 21, 2020, 4:26 p.m. |
OK |
PyPy 3 |
TESTS |
59 |
576 |
16896000 |
|
|
99200684 |
gamitejpratapsingh998 |
C |
Nov. 21, 2020, 9:07 p.m. |
OK |
PyPy 3 |
TESTS |
59 |
592 |
11264000 |
|
|
99215275 |
n1tz53 |
C |
Nov. 22, 2020, 4:40 a.m. |
OK |
PyPy 3 |
TESTS |
59 |
592 |
11366400 |
|
|
99199150 |
silvertint |
C |
Nov. 21, 2020, 8:31 p.m. |
OK |
PyPy 3 |
TESTS |
59 |
592 |
11468800 |
|
|
99211056 |
Nishant_Rao |
C |
Nov. 22, 2020, 3:14 a.m. |
OK |
PyPy 3 |
TESTS |
59 |
607 |
53862400 |
|
|
99199549 |
rummansadik |
C |
Nov. 21, 2020, 8:39 p.m. |
OK |
Python 3 |
TESTS |
59 |
1512 |
4198400 |
|
|
99214586 |
sh1194 |
C |
Nov. 22, 2020, 4:29 a.m. |
OK |
Python 3 |
TESTS |
59 |
1513 |
3481600 |
|
|
99199497 |
rummansadik |
C |
Nov. 21, 2020, 8:38 p.m. |
OK |
Python 3 |
TESTS |
59 |
1513 |
4198400 |
|
|
99220369 |
gokufan1769 |
C |
Nov. 22, 2020, 5:57 a.m. |
OK |
Python 3 |
TESTS |
59 |
1793 |
14745600 |
|
|
99197955 |
sushanthsamala |
C |
Nov. 21, 2020, 8:07 p.m. |
OK |
Python 3 |
TESTS |
59 |
1964 |
4198400 |
|
|
99179860 |
quickn_babo |
C |
Nov. 21, 2020, 4:25 p.m. |
OK |
Rust |
TESTS |
59 |
155 |
14438400 |
|
|
99213409 |
bqn |
C |
Nov. 22, 2020, 4:08 a.m. |
OK |
Rust |
TESTS |
59 |
1169 |
11776000 |
|
|
remove filters
Back to search problems