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"Hurricane came to Berland and to suburbs Stringsvill. You are going to it to check if it's all right with you favorite string. Hurrinace broke it a bit by reversing some of its non-intersecting substrings. You have a photo of this string before hurricane and you want to restore it to original state using reversing minimum possible number of its substrings and find out which substrings you should reverse. You are given a string s -- original state of your string and string t -- state of the string after hurricane. You should select k non-intersecting substrings of t in such a way that after reverse of these substrings string will be equal s and k is minimum possible. First line of input contains string s and second line contains string t. Both strings have same length and consist of lowercase English letters. 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89|s| xe2 x80 x89= xe2 x80 x89|t| xe2 x80 x89 xe2 x89 xa4 xe2 x80 x895 xc2 xb7105 In first line print k -- minimum number of substrings you should reverse. Next output k lines. Each line should contain two integers li, ri meaning that you should reverse substring from symbol number li to symbol ri (strings are 1-indexed). These substrings shouldn't intersect. If there are multiple answers print any. If it's impossible to restore string output -1. "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
34249827 |
vjudge5 |
E |
Jan. 17, 2018, 11:11 a.m. |
OK |
GNU C++ |
TESTS |
94 |
61 |
138240000 |
|
3200 |
41119819 |
alan_cty |
E |
Aug. 2, 2018, 11:20 a.m. |
OK |
GNU C++ |
TESTS |
94 |
62 |
135372800 |
|
3200 |
36202943 |
Thefinal |
E |
March 11, 2018, 2:31 p.m. |
OK |
GNU C++ |
TESTS |
94 |
62 |
137318400 |
|
3200 |
34219300 |
kingsnow |
E |
Jan. 16, 2018, 10:59 a.m. |
OK |
GNU C++ |
TESTS |
94 |
62 |
138240000 |
|
3200 |
35573763 |
XingGeRuCi |
E |
Feb. 22, 2018, 1:10 p.m. |
OK |
GNU C++ |
TESTS |
94 |
62 |
149196800 |
|
3200 |
34735132 |
luogu_bot5 |
E |
Jan. 31, 2018, 11:22 a.m. |
OK |
GNU C++ |
TESTS |
94 |
62 |
152371200 |
|
3200 |
34651358 |
vjudge3 |
E |
Jan. 29, 2018, 6:01 a.m. |
OK |
GNU C++ |
TESTS |
94 |
62 |
152371200 |
|
3200 |
35578879 |
skywalkert |
E |
Feb. 22, 2018, 4:56 p.m. |
OK |
GNU C++ |
TESTS |
94 |
78 |
20070400 |
|
3200 |
34650519 |
vjudge4 |
E |
Jan. 29, 2018, 5:26 a.m. |
OK |
GNU C++ |
TESTS |
94 |
140 |
65433600 |
|
3200 |
34236966 |
Panole233 |
E |
Jan. 16, 2018, 11:44 p.m. |
OK |
GNU C++ |
TESTS |
94 |
373 |
110694400 |
|
3200 |
49307593 |
frodakcin |
E |
Feb. 1, 2019, 6:23 a.m. |
OK |
GNU C++11 |
TESTS |
94 |
46 |
10035200 |
|
3200 |
46061603 |
shadowice1984 |
E |
Nov. 22, 2018, 1:37 p.m. |
OK |
GNU C++11 |
TESTS |
94 |
46 |
25907200 |
|
3200 |
52160020 |
luogu_bot4 |
E |
April 1, 2019, 2:51 p.m. |
OK |
GNU C++11 |
TESTS |
94 |
46 |
135065600 |
|
3200 |
33645938 |
FoolMike |
E |
Dec. 26, 2017, noon |
OK |
GNU C++11 |
TESTS |
94 |
46 |
137318400 |
|
3200 |
52274371 |
FlashHu |
E |
April 3, 2019, 2:13 p.m. |
OK |
GNU C++11 |
TESTS |
94 |
61 |
134246400 |
|
3200 |
47260333 |
Dedicatus545 |
E |
Dec. 19, 2018, 12:07 p.m. |
OK |
GNU C++11 |
TESTS |
94 |
61 |
134246400 |
|
3200 |
46780381 |
2016gdgzoi471 |
E |
Dec. 9, 2018, 1:46 a.m. |
OK |
GNU C++11 |
TESTS |
94 |
61 |
138137600 |
|
3200 |
46442809 |
tqyaaaaaaaang |
E |
Dec. 1, 2018, 12:50 p.m. |
OK |
GNU C++11 |
TESTS |
94 |
61 |
139264000 |
|
3200 |
57872137 |
lopare |
E |
July 28, 2019, 2:37 a.m. |
OK |
GNU C++11 |
TESTS |
94 |
61 |
150323200 |
|
3200 |
35575190 |
tqyaaaaaaaang |
E |
Feb. 22, 2018, 2:12 p.m. |
OK |
GNU C++11 |
TESTS |
94 |
62 |
21094400 |
|
3200 |
33882966 |
tun |
E |
Jan. 3, 2018, 10:54 a.m. |
OK |
GNU C++14 |
TESTS |
94 |
46 |
11878400 |
|
3200 |
34974519 |
whzzt |
E |
Feb. 6, 2018, 2:59 p.m. |
OK |
GNU C++14 |
TESTS |
94 |
46 |
139161600 |
|
3200 |
34961022 |
AmberFrame |
E |
Feb. 6, 2018, 4:51 a.m. |
OK |
GNU C++14 |
TESTS |
94 |
61 |
137113600 |
|
3200 |
42678760 |
consecutivelimit |
E |
Sept. 8, 2018, 3:07 p.m. |
OK |
GNU C++14 |
TESTS |
94 |
62 |
15769600 |
|
3200 |
65561445 |
OrangePlus |
E |
Nov. 23, 2019, 3:09 a.m. |
OK |
GNU C++14 |
TESTS |
94 |
62 |
19148800 |
|
3200 |
47239328 |
jazengm |
E |
Dec. 18, 2018, 11:33 p.m. |
OK |
GNU C++14 |
TESTS |
94 |
62 |
19968000 |
|
3200 |
47037487 |
CSXiang |
E |
Dec. 15, 2018, 1:01 p.m. |
OK |
GNU C++14 |
TESTS |
94 |
62 |
19968000 |
|
3200 |
38110621 |
kut_kjb1994 |
E |
May 11, 2018, 10:03 a.m. |
OK |
GNU C++14 |
TESTS |
94 |
62 |
26726400 |
|
3200 |
52160012 |
yybyyb |
E |
April 1, 2019, 2:51 p.m. |
OK |
GNU C++14 |
TESTS |
94 |
62 |
135270400 |
|
3200 |
35462730 |
dreamoon_love_AA |
E |
Feb. 19, 2018, 5:50 a.m. |
OK |
GNU C++14 |
TESTS |
94 |
62 |
137216000 |
|
3200 |
58910126 |
HIT_Attacker |
E |
Aug. 16, 2019, 12:45 p.m. |
OK |
GNU C++17 |
TESTS |
94 |
62 |
138240000 |
|
3200 |
50711321 |
fcwww |
E |
March 3, 2019, 6:59 a.m. |
OK |
GNU C++17 |
TESTS |
94 |
62 |
140390400 |
|
3200 |
68016930 |
Shayan.P |
E |
Dec. 31, 2019, 7:17 p.m. |
OK |
GNU C++17 |
TESTS |
94 |
62 |
144588800 |
|
3200 |
59778004 |
llllxxx666888 |
E |
Aug. 31, 2019, 1:07 a.m. |
OK |
GNU C++17 |
TESTS |
94 |
77 |
139366400 |
|
3200 |
59577958 |
llllxxx666888 |
E |
Aug. 27, 2019, 2:51 p.m. |
OK |
GNU C++17 |
TESTS |
94 |
77 |
139366400 |
|
3200 |
51774603 |
Radewoosh |
E |
March 23, 2019, 8:37 p.m. |
OK |
GNU C++17 |
TESTS |
94 |
77 |
140288000 |
|
3200 |
57252155 |
Benq |
E |
July 18, 2019, 12:12 a.m. |
OK |
GNU C++17 |
TESTS |
94 |
77 |
141619200 |
|
3200 |
68772320 |
XLor |
E |
Jan. 14, 2020, 12:19 p.m. |
OK |
GNU C++17 |
TESTS |
94 |
77 |
143257600 |
|
3200 |
46364884 |
cxt |
E |
Nov. 29, 2018, 12:48 p.m. |
OK |
GNU C++17 |
TESTS |
94 |
77 |
147353600 |
|
3200 |
59351958 |
biaoge |
E |
Aug. 23, 2019, 12:09 p.m. |
OK |
GNU C++17 |
TESTS |
94 |
77 |
148275200 |
|
3200 |
33970482 |
uwi |
E |
Jan. 6, 2018, 6:46 p.m. |
OK |
Java 8 |
TESTS |
94 |
264 |
97484800 |
|
3200 |
33858603 |
JialinOuyang |
E |
Jan. 2, 2018, 6:17 a.m. |
OK |
Java 8 |
TESTS |
94 |
265 |
249958400 |
|
3200 |
59351578 |
vjudge3 |
E |
Aug. 23, 2019, noon |
OK |
MS C++ |
TESTS |
94 |
78 |
147251200 |
|
3200 |
58202517 |
nuchenghao |
E |
Aug. 3, 2019, 5:16 a.m. |
OK |
MS C++ 2017 |
TESTS |
94 |
77 |
139264000 |
|
3200 |
58210936 |
nuchenghao |
E |
Aug. 3, 2019, 8:47 a.m. |
OK |
MS C++ 2017 |
TESTS |
94 |
78 |
139264000 |
|
3200 |
58209806 |
nuchenghao |
E |
Aug. 3, 2019, 8:26 a.m. |
OK |
MS C++ 2017 |
TESTS |
94 |
78 |
139264000 |
|
3200 |
59351750 |
biaoge |
E |
Aug. 23, 2019, 12:04 p.m. |
OK |
MS C++ 2017 |
TESTS |
94 |
93 |
147251200 |
|
3200 |
remove filters
Back to search problems