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 both of length n and both consisting of lowercase Latin letters. In one move, you can choose any length len from 1 to n and perform the following operation: Note that during one move you reverse exactly one substring of the string s and exactly one substring of the string t . Also note that borders of substrings you reverse in s and in t can be different, the only restriction is that you reverse the substrings of equal length. For example, if len=3 and n=5 , you can reverse s[1 ... 3] and t[3 ... 5] , s[2 ... 4] and t[2 ... 4] , but not s[1 ... 3] and t[1 ... 2] . Your task is to say if it is possible to make strings s and t equal after some (possibly, empty) sequence of moves. You have to answer q independent test cases. The first line of the input contains one integer q ( 1 <= q <= 10^4 ) -- the number of test cases. Then q test cases follow. The first line of the test case contains one integer n ( 1 <= n <= 2 cdot 10^5 ) -- the length of s and t . The second line of the test case contains one string s consisting of n lowercase Latin letters. The third line of the test case contains one string t consisting of n lowercase Latin letters. It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 ( sum n <= 2 cdot 10^5 ). For each test case, print the answer on it -- "YES" (without quotes) if it is possible to make strings s and t equal after some (possibly, empty) sequence of moves and "NO" otherwise. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
64857306 |
tiger0132 |
F |
Nov. 14, 2019, 12:21 a.m. |
OK |
Clang++17 Diagnostics |
TESTS |
6 |
77 |
0 |
|
2200 |
64630323 |
dyzsr |
F |
Nov. 10, 2019, 9:57 a.m. |
OK |
Clang++17 Diagnostics |
TESTS |
6 |
171 |
15462400 |
|
2200 |
64630143 |
dyzsr |
F |
Nov. 10, 2019, 9:52 a.m. |
OK |
Clang++17 Diagnostics |
TESTS |
6 |
218 |
15462400 |
|
2200 |
67934256 |
fluffyowl |
F |
Dec. 29, 2019, 7:22 p.m. |
OK |
D |
TESTS |
6 |
77 |
11571200 |
|
2200 |
64640079 |
AFAF_C |
F |
Nov. 10, 2019, 12:50 p.m. |
OK |
GNU C11 |
TESTS |
6 |
46 |
409600 |
|
2200 |
65156307 |
yuyu112 |
F |
Nov. 16, 2019, 9:28 a.m. |
OK |
GNU C++11 |
TESTS |
6 |
15 |
204800 |
|
2200 |
64473867 |
M_sea |
F |
Nov. 7, 2019, 1:49 p.m. |
OK |
GNU C++11 |
TESTS |
6 |
15 |
409600 |
|
2200 |
65526415 |
LY520233 |
F |
Nov. 22, 2019, 10:34 a.m. |
OK |
GNU C++11 |
TESTS |
6 |
15 |
409600 |
|
2200 |
66160222 |
alunl |
F |
Dec. 2, 2019, 3:44 a.m. |
OK |
GNU C++11 |
TESTS |
6 |
15 |
1638400 |
|
2200 |
64450283 |
luogu_bot4 |
F |
Nov. 7, 2019, 6:48 a.m. |
OK |
GNU C++11 |
TESTS |
6 |
15 |
6041600 |
|
2200 |
64338541 |
Eganrak |
F |
Nov. 6, 2019, 12:16 a.m. |
OK |
GNU C++11 |
TESTS |
6 |
30 |
0 |
|
2200 |
68930018 |
vjudge1 |
F |
Jan. 16, 2020, 11:06 a.m. |
OK |
GNU C++11 |
TESTS |
6 |
30 |
204800 |
|
2200 |
65285564 |
Don_Quijote |
F |
Nov. 18, 2019, 7:56 a.m. |
OK |
GNU C++11 |
TESTS |
6 |
30 |
409600 |
|
2200 |
65150430 |
uniea |
F |
Nov. 16, 2019, 7:16 a.m. |
OK |
GNU C++11 |
TESTS |
6 |
30 |
409600 |
|
2200 |
65423202 |
Tak3n |
F |
Nov. 20, 2019, 9:44 a.m. |
OK |
GNU C++11 |
TESTS |
6 |
30 |
409600 |
|
2200 |
64796020 |
aya_uchida |
F |
Nov. 13, 2019, 12:55 p.m. |
OK |
GNU C++14 |
TESTS |
6 |
15 |
409600 |
|
2200 |
64346780 |
ahshafi |
F |
Nov. 6, 2019, 6:41 a.m. |
OK |
GNU C++14 |
TESTS |
6 |
15 |
409600 |
|
2200 |
64341552 |
Keane1998 |
F |
Nov. 6, 2019, 3:08 a.m. |
OK |
GNU C++14 |
TESTS |
6 |
15 |
409600 |
|
2200 |
64328687 |
cs71107 |
F |
Nov. 5, 2019, 6:22 p.m. |
OK |
GNU C++14 |
TESTS |
6 |
15 |
409600 |
|
2200 |
68161024 |
21August |
F |
Jan. 4, 2020, 10:51 a.m. |
OK |
GNU C++14 |
TESTS |
6 |
15 |
409600 |
|
2200 |
66659264 |
x20 |
F |
Dec. 12, 2019, 3:08 a.m. |
OK |
GNU C++14 |
TESTS |
6 |
15 |
512000 |
|
2200 |
65695259 |
ashishgr1102 |
F |
Nov. 25, 2019, 7:41 a.m. |
OK |
GNU C++14 |
TESTS |
6 |
15 |
716800 |
|
2200 |
67658519 |
Ag12 |
F |
Dec. 26, 2019, 2:49 p.m. |
OK |
GNU C++14 |
TESTS |
6 |
15 |
716800 |
|
2200 |
66484900 |
Elysia |
F |
Dec. 8, 2019, 5:48 a.m. |
OK |
GNU C++14 |
TESTS |
6 |
15 |
716800 |
|
2200 |
65734212 |
gkftndlTek |
F |
Nov. 26, 2019, 6:54 a.m. |
OK |
GNU C++14 |
TESTS |
6 |
15 |
716800 |
|
2200 |
65126188 |
mohamedeltair |
F |
Nov. 16, 2019, 2:28 a.m. |
OK |
GNU C++17 |
TESTS |
6 |
15 |
409600 |
|
2200 |
64652808 |
lesf0 |
F |
Nov. 10, 2019, 6 p.m. |
OK |
GNU C++17 |
TESTS |
6 |
15 |
409600 |
|
2200 |
64438987 |
yizhibaiwuya |
F |
Nov. 7, 2019, 3:08 a.m. |
OK |
GNU C++17 |
TESTS |
6 |
15 |
409600 |
|
2200 |
64373130 |
guagua123 |
F |
Nov. 6, 2019, 2:59 p.m. |
OK |
GNU C++17 |
TESTS |
6 |
15 |
409600 |
|
2200 |
64359723 |
ACCCCCC |
F |
Nov. 6, 2019, 11:22 a.m. |
OK |
GNU C++17 |
TESTS |
6 |
15 |
409600 |
|
2200 |
64351095 |
Hartley |
F |
Nov. 6, 2019, 8:23 a.m. |
OK |
GNU C++17 |
TESTS |
6 |
15 |
409600 |
|
2200 |
64339726 |
Kiana_Go |
F |
Nov. 6, 2019, 1:32 a.m. |
OK |
GNU C++17 |
TESTS |
6 |
15 |
409600 |
|
2200 |
64329201 |
hltk |
F |
Nov. 5, 2019, 6:33 p.m. |
OK |
GNU C++17 |
TESTS |
6 |
15 |
409600 |
|
2200 |
64317120 |
PerpEternal |
F |
Nov. 5, 2019, 2:26 p.m. |
OK |
GNU C++17 |
TESTS |
6 |
15 |
409600 |
|
2200 |
65325130 |
krijgertje |
F |
Nov. 18, 2019, 11:56 p.m. |
OK |
GNU C++17 |
TESTS |
6 |
15 |
409600 |
|
2200 |
65507741 |
stefan.sakalik |
F |
Nov. 22, 2019, 12:44 a.m. |
OK |
Go |
TESTS |
6 |
62 |
0 |
|
2200 |
64486282 |
potatmen |
F |
Nov. 7, 2019, 5:55 p.m. |
OK |
Java 11 |
TESTS |
6 |
248 |
0 |
|
2200 |
66656910 |
TheSawan |
F |
Dec. 12, 2019, 12:11 a.m. |
OK |
Java 11 |
TESTS |
6 |
327 |
16384000 |
|
2200 |
64372444 |
swap1204nil |
F |
Nov. 6, 2019, 2:46 p.m. |
OK |
Java 11 |
TESTS |
6 |
342 |
0 |
|
2200 |
66162668 |
sspu_zcy |
F |
Dec. 2, 2019, 5:37 a.m. |
OK |
Java 11 |
TESTS |
6 |
405 |
2764800 |
|
2200 |
66539989 |
mennafadali |
F |
Dec. 9, 2019, 11:08 a.m. |
OK |
Java 8 |
TESTS |
6 |
124 |
0 |
|
2200 |
64348404 |
sonusingh.nitaa |
F |
Nov. 6, 2019, 7:21 a.m. |
OK |
Java 8 |
TESTS |
6 |
124 |
0 |
|
2200 |
64328811 |
Oopsimbad |
F |
Nov. 5, 2019, 6:25 p.m. |
OK |
Java 8 |
TESTS |
6 |
124 |
0 |
|
2200 |
64324982 |
tusharjape007 |
F |
Nov. 5, 2019, 4:58 p.m. |
OK |
Java 8 |
TESTS |
6 |
124 |
0 |
|
2200 |
64320121 |
beginner1010 |
F |
Nov. 5, 2019, 3:22 p.m. |
OK |
Java 8 |
TESTS |
6 |
124 |
0 |
|
2200 |
64317320 |
yaoct |
F |
Nov. 5, 2019, 2:30 p.m. |
OK |
Java 8 |
TESTS |
6 |
124 |
0 |
|
2200 |
64311580 |
luchy0120 |
F |
Nov. 5, 2019, 12:54 p.m. |
OK |
Java 8 |
TESTS |
6 |
124 |
0 |
|
2200 |
64503454 |
AnandOza |
F |
Nov. 8, 2019, 5:39 a.m. |
OK |
Java 8 |
TESTS |
6 |
139 |
0 |
|
2200 |
64712428 |
xodiac |
F |
Nov. 11, 2019, 7:28 p.m. |
OK |
Java 8 |
TESTS |
6 |
139 |
0 |
|
2200 |
64316744 |
sarthakmanna |
F |
Nov. 5, 2019, 2:20 p.m. |
OK |
Java 8 |
TESTS |
6 |
139 |
0 |
|
2200 |
65502641 |
tycyd |
F |
Nov. 21, 2019, 7:52 p.m. |
OK |
Mono C# |
TESTS |
6 |
77 |
2969600 |
|
2200 |
64609338 |
tomomo2b2 |
F |
Nov. 9, 2019, 11:37 p.m. |
OK |
Mono C# |
TESTS |
6 |
170 |
12083200 |
|
2200 |
69283165 |
vjudge2 |
F |
Jan. 22, 2020, 6:55 a.m. |
OK |
MS C++ |
TESTS |
6 |
15 |
409600 |
|
2200 |
64679082 |
vjudge5 |
F |
Nov. 11, 2019, 9:15 a.m. |
OK |
MS C++ |
TESTS |
6 |
15 |
409600 |
|
2200 |
69170721 |
vjudge3 |
F |
Jan. 20, 2020, 6:04 a.m. |
OK |
MS C++ |
TESTS |
6 |
15 |
409600 |
|
2200 |
69282820 |
vjudge2 |
F |
Jan. 22, 2020, 6:46 a.m. |
OK |
MS C++ |
TESTS |
6 |
15 |
819200 |
|
2200 |
69283095 |
vjudge5 |
F |
Jan. 22, 2020, 6:53 a.m. |
OK |
MS C++ |
TESTS |
6 |
31 |
409600 |
|
2200 |
69885185 |
vjudge2 |
F |
Jan. 31, 2020, 7:56 a.m. |
OK |
MS C++ |
TESTS |
6 |
31 |
716800 |
|
2200 |
69885188 |
vjudge1 |
F |
Jan. 31, 2020, 7:56 a.m. |
OK |
MS C++ |
TESTS |
6 |
31 |
716800 |
|
2200 |
65023313 |
vjudge2 |
F |
Nov. 15, 2019, 6:24 a.m. |
OK |
MS C++ |
TESTS |
6 |
46 |
409600 |
|
2200 |
69479588 |
tarattata1 |
F |
Jan. 24, 2020, 5:18 p.m. |
OK |
MS C++ |
TESTS |
6 |
46 |
409600 |
|
2200 |
69033696 |
vjudge5 |
F |
Jan. 18, 2020, 8:38 a.m. |
OK |
MS C++ |
TESTS |
6 |
93 |
819200 |
|
2200 |
64509778 |
vjudge2 |
F |
Nov. 8, 2019, 8:24 a.m. |
OK |
MS C++ 2017 |
TESTS |
6 |
31 |
409600 |
|
2200 |
64554359 |
return-zan |
F |
Nov. 9, 2019, 2:28 a.m. |
OK |
MS C++ 2017 |
TESTS |
6 |
31 |
409600 |
|
2200 |
69855172 |
vjudge2 |
F |
Jan. 30, 2020, 4:45 p.m. |
OK |
MS C++ 2017 |
TESTS |
6 |
31 |
1228800 |
|
2200 |
68971830 |
vjudge2 |
F |
Jan. 17, 2020, 7:18 a.m. |
OK |
MS C++ 2017 |
TESTS |
6 |
31 |
10035200 |
|
2200 |
64328494 |
c.u |
F |
Nov. 5, 2019, 6:17 p.m. |
OK |
MS C++ 2017 |
TESTS |
6 |
46 |
1024000 |
|
2200 |
64775450 |
shebao |
F |
Nov. 13, 2019, 3:52 a.m. |
OK |
MS C++ 2017 |
TESTS |
6 |
46 |
1126400 |
|
2200 |
69884412 |
vjudge4 |
F |
Jan. 31, 2020, 7:39 a.m. |
OK |
MS C++ 2017 |
TESTS |
6 |
46 |
200396800 |
|
2200 |
64701594 |
H4ppyRa1n |
F |
Nov. 11, 2019, 3 p.m. |
OK |
MS C++ 2017 |
TESTS |
6 |
61 |
1126400 |
|
2200 |
66234530 |
tik-tok |
F |
Dec. 3, 2019, 3:38 p.m. |
OK |
MS C++ 2017 |
TESTS |
6 |
62 |
819200 |
|
2200 |
65151046 |
viz09 |
F |
Nov. 16, 2019, 7:30 a.m. |
OK |
MS C++ 2017 |
TESTS |
6 |
62 |
819200 |
|
2200 |
65298683 |
yumtam |
F |
Nov. 18, 2019, 12:27 p.m. |
OK |
PyPy 2 |
TESTS |
6 |
280 |
7884800 |
|
2200 |
66054683 |
shehebe |
F |
Nov. 30, 2019, 7:06 p.m. |
OK |
PyPy 2 |
TESTS |
6 |
592 |
8294400 |
|
2200 |
65111606 |
Leendertz |
F |
Nov. 15, 2019, 11:10 p.m. |
OK |
PyPy 3 |
TESTS |
6 |
265 |
21708800 |
|
2200 |
69291617 |
mitribunskiy |
F |
Jan. 22, 2020, 10:28 a.m. |
OK |
PyPy 3 |
TESTS |
6 |
295 |
9318400 |
|
2200 |
64352150 |
r57shell |
F |
Nov. 6, 2019, 8:49 a.m. |
OK |
PyPy 3 |
TESTS |
6 |
326 |
13107200 |
|
2200 |
64894544 |
tjs1297 |
F |
Nov. 14, 2019, 4:02 p.m. |
OK |
PyPy 3 |
TESTS |
6 |
467 |
8908800 |
|
2200 |
64659184 |
Riolku |
F |
Nov. 10, 2019, 8:16 p.m. |
OK |
PyPy 3 |
TESTS |
6 |
498 |
13414400 |
|
2200 |
64431923 |
ruslanedu |
F |
Nov. 6, 2019, 9:50 p.m. |
OK |
PyPy 3 |
TESTS |
6 |
514 |
11366400 |
|
2200 |
64654610 |
yfo |
F |
Nov. 10, 2019, 6:49 p.m. |
OK |
PyPy 3 |
TESTS |
6 |
623 |
9523200 |
|
2200 |
64568347 |
NewNenil |
F |
Nov. 9, 2019, 8:19 a.m. |
OK |
PyPy 3 |
TESTS |
6 |
655 |
10035200 |
|
2200 |
64366911 |
ch_egor |
F |
Nov. 6, 2019, 1:16 p.m. |
OK |
PyPy 3 |
TESTS |
6 |
670 |
10137600 |
|
2200 |
64656368 |
yfo |
F |
Nov. 10, 2019, 7:23 p.m. |
OK |
PyPy 3 |
TESTS |
6 |
685 |
9728000 |
|
2200 |
64534840 |
auouo |
F |
Nov. 8, 2019, 4:38 p.m. |
OK |
Python 3 |
TESTS |
6 |
343 |
1126400 |
|
2200 |
64404473 |
vishnutheerthep |
F |
Nov. 6, 2019, 4:22 p.m. |
OK |
Python 3 |
TESTS |
6 |
389 |
4710400 |
|
2200 |
64332369 |
al_Fares |
F |
Nov. 5, 2019, 7:56 p.m. |
OK |
Python 3 |
TESTS |
6 |
389 |
4710400 |
|
2200 |
64327226 |
heurezjusz |
F |
Nov. 5, 2019, 5:48 p.m. |
OK |
Python 3 |
TESTS |
6 |
451 |
3993600 |
|
2200 |
64455844 |
aligh |
F |
Nov. 7, 2019, 8:41 a.m. |
OK |
Python 3 |
TESTS |
6 |
483 |
3072000 |
|
2200 |
66462755 |
bnaninaidu9949 |
F |
Dec. 7, 2019, 3:24 p.m. |
OK |
Python 3 |
TESTS |
6 |
514 |
1331200 |
|
2200 |
66729649 |
bnaninaidu9949 |
F |
Dec. 12, 2019, 5:05 p.m. |
OK |
Python 3 |
TESTS |
6 |
514 |
1433600 |
|
2200 |
66539835 |
Aita_Venkata_Rishmitha |
F |
Dec. 9, 2019, 11:05 a.m. |
OK |
Python 3 |
TESTS |
6 |
530 |
1433600 |
|
2200 |
68082827 |
Nazrin |
F |
Jan. 2, 2020, 3:02 p.m. |
OK |
Python 3 |
TESTS |
6 |
577 |
1331200 |
|
2200 |
64599149 |
kobae964 |
F |
Nov. 9, 2019, 5:58 p.m. |
OK |
Rust |
TESTS |
6 |
31 |
3686400 |
|
2200 |
64475831 |
terraformer |
F |
Nov. 7, 2019, 2:21 p.m. |
OK |
Rust |
TESTS |
6 |
155 |
2560000 |
|
2200 |
66109262 |
yuya178 |
F |
Dec. 1, 2019, 9:09 a.m. |
OK |
Rust |
TESTS |
6 |
171 |
2867200 |
|
2200 |
remove filters
Back to search problems