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 a string s consisting only of first 20 lowercase Latin letters ( 'a ', 'b ', ..., 't '). Recall that the substring s[l; r] of the string s is the string s_l s_{l + 1} ... s_r . For example, the substrings of "codeforces" are "code", "force", "f", "for", but not "coder" and "top". You can perform the following operation no more than once: choose some substring s[l; r] and reverse it (i.e. the string s_l s_{l + 1} ... s_r becomes s_r s_{r - 1} ... s_l ). Your goal is to maximize the length of the maximum substring of s consisting of distinct (i.e. unique) characters. The string consists of distinct characters if no character in this string appears more than once. For example, strings "abcde", "arctg" and "minecraft" consist of distinct characters but strings "codeforces", "abacaba" do not consist of distinct characters. The only line of the input contains one string s consisting of no more than 10^6 characters 'a ', 'b ', ..., 't ' (first 20 lowercase Latin letters). Print one integer -- the maximum possible length of the maximum substring of s consisting of distinct characters after reversing no more than one its substring. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
61826248 |
ReaLNero1 |
F |
Oct. 4, 2019, 4:53 a.m. |
OK |
GNU C11 |
TESTS |
58 |
78 |
5222400 |
|
2400 |
62397999 |
RealFreddy |
F |
Oct. 12, 2019, 6:17 a.m. |
OK |
GNU C11 |
TESTS |
58 |
78 |
5222400 |
|
2400 |
61751892 |
fAKire |
F |
Oct. 3, 2019, 3:48 a.m. |
OK |
GNU C++11 |
TESTS |
58 |
62 |
5017600 |
|
2400 |
61849408 |
Yzm007 |
F |
Oct. 4, 2019, 12:17 p.m. |
OK |
GNU C++11 |
TESTS |
58 |
62 |
5222400 |
|
2400 |
62614161 |
Adelard |
F |
Oct. 15, 2019, 10:54 a.m. |
OK |
GNU C++11 |
TESTS |
58 |
62 |
5222400 |
|
2400 |
61950847 |
AuqaKyz |
F |
Oct. 6, 2019, 3:19 a.m. |
OK |
GNU C++11 |
TESTS |
58 |
62 |
5222400 |
|
2400 |
69564661 |
wyy2004 |
F |
Jan. 26, 2020, 11:57 a.m. |
OK |
GNU C++11 |
TESTS |
58 |
62 |
6348800 |
|
2400 |
61881443 |
Dup4 |
F |
Oct. 5, 2019, 12:09 a.m. |
OK |
GNU C++11 |
TESTS |
58 |
62 |
10035200 |
|
2400 |
61841469 |
vjudge4 |
F |
Oct. 4, 2019, 9:48 a.m. |
OK |
GNU C++11 |
TESTS |
58 |
62 |
17612800 |
|
2400 |
62099477 |
luogu_bot4 |
F |
Oct. 8, 2019, 8:39 a.m. |
OK |
GNU C++11 |
TESTS |
58 |
77 |
5222400 |
|
2400 |
62626865 |
saitoasuka |
F |
Oct. 15, 2019, 2:18 p.m. |
OK |
GNU C++11 |
TESTS |
58 |
77 |
5222400 |
|
2400 |
64130010 |
shuyingte |
F |
Nov. 3, 2019, 6:31 a.m. |
OK |
GNU C++11 |
TESTS |
58 |
77 |
5222400 |
|
2400 |
61827906 |
zzugzx |
F |
Oct. 4, 2019, 5:33 a.m. |
OK |
GNU C++14 |
TESTS |
58 |
62 |
5222400 |
|
2400 |
61765973 |
underkarma |
F |
Oct. 3, 2019, 8:38 a.m. |
OK |
GNU C++14 |
TESTS |
58 |
62 |
5222400 |
|
2400 |
61750803 |
DeepJay |
F |
Oct. 3, 2019, 3:11 a.m. |
OK |
GNU C++14 |
TESTS |
58 |
62 |
5222400 |
|
2400 |
61747988 |
P.O.F |
F |
Oct. 3, 2019, 1:40 a.m. |
OK |
GNU C++14 |
TESTS |
58 |
62 |
5222400 |
|
2400 |
62338464 |
dlgumpupupday |
F |
Oct. 11, 2019, 3:22 a.m. |
OK |
GNU C++14 |
TESTS |
58 |
62 |
5222400 |
|
2400 |
61927482 |
VahitGuetta |
F |
Oct. 5, 2019, 3:07 p.m. |
OK |
GNU C++14 |
TESTS |
58 |
62 |
5222400 |
|
2400 |
61949838 |
vjudge5 |
F |
Oct. 6, 2019, 2:44 a.m. |
OK |
GNU C++14 |
TESTS |
58 |
62 |
9011200 |
|
2400 |
61879767 |
prince_of_crows |
F |
Oct. 4, 2019, 10:21 p.m. |
OK |
GNU C++14 |
TESTS |
58 |
62 |
14745600 |
|
2400 |
62338486 |
dlgumpupupday |
F |
Oct. 11, 2019, 3:22 a.m. |
OK |
GNU C++14 |
TESTS |
58 |
77 |
5222400 |
|
2400 |
62587831 |
amr962 |
F |
Oct. 14, 2019, 7:35 p.m. |
OK |
GNU C++14 |
TESTS |
58 |
77 |
6246400 |
|
2400 |
61767748 |
HuangShengjie |
F |
Oct. 3, 2019, 9:09 a.m. |
OK |
GNU C++17 |
TESTS |
58 |
62 |
5222400 |
|
2400 |
69224880 |
vjudge5 |
F |
Jan. 21, 2020, 6:42 a.m. |
OK |
GNU C++17 |
TESTS |
58 |
62 |
5222400 |
|
2400 |
66136384 |
vjudge4 |
F |
Dec. 1, 2019, 12:24 p.m. |
OK |
GNU C++17 |
TESTS |
58 |
62 |
5222400 |
|
2400 |
62412028 |
pipipipipi43 |
F |
Oct. 12, 2019, 10:39 a.m. |
OK |
GNU C++17 |
TESTS |
58 |
62 |
5222400 |
|
2400 |
61762735 |
Ketchum |
F |
Oct. 3, 2019, 7:38 a.m. |
OK |
GNU C++17 |
TESTS |
58 |
62 |
5222400 |
|
2400 |
61757280 |
Ketchum |
F |
Oct. 3, 2019, 5:58 a.m. |
OK |
GNU C++17 |
TESTS |
58 |
62 |
5222400 |
|
2400 |
61896474 |
cjnwq |
F |
Oct. 5, 2019, 7:23 a.m. |
OK |
GNU C++17 |
TESTS |
58 |
62 |
5836800 |
|
2400 |
61720944 |
3agwa |
F |
Oct. 2, 2019, 1:46 p.m. |
OK |
GNU C++17 |
TESTS |
58 |
62 |
6348800 |
|
2400 |
62526444 |
motilj |
F |
Oct. 13, 2019, 5:32 p.m. |
OK |
GNU C++17 |
TESTS |
58 |
62 |
6348800 |
|
2400 |
62577511 |
ivan100sic |
F |
Oct. 14, 2019, 4:19 p.m. |
OK |
GNU C++17 |
TESTS |
58 |
62 |
10547200 |
|
2400 |
62421601 |
z20124528 |
F |
Oct. 12, 2019, 1:07 p.m. |
OK |
Go |
TESTS |
58 |
139 |
8396800 |
|
2400 |
63257816 |
stefan.sakalik |
F |
Oct. 23, 2019, 6:54 p.m. |
OK |
Go |
TESTS |
58 |
218 |
8499200 |
|
2400 |
61730832 |
aman28rwt |
F |
Oct. 2, 2019, 4:43 p.m. |
OK |
Java 8 |
TESTS |
58 |
280 |
0 |
|
2400 |
61716928 |
TheSawan |
F |
Oct. 2, 2019, 12:49 p.m. |
OK |
Java 8 |
TESTS |
58 |
280 |
0 |
|
2400 |
61947630 |
satya26 |
F |
Oct. 6, 2019, 1:19 a.m. |
OK |
Java 8 |
TESTS |
58 |
296 |
0 |
|
2400 |
61716563 |
its_aks_ulure |
F |
Oct. 2, 2019, 12:43 p.m. |
OK |
Java 8 |
TESTS |
58 |
296 |
0 |
|
2400 |
61735717 |
Agnimandur |
F |
Oct. 2, 2019, 6:08 p.m. |
OK |
Java 8 |
TESTS |
58 |
296 |
2867200 |
|
2400 |
62342509 |
whu.dknight |
F |
Oct. 11, 2019, 5:55 a.m. |
OK |
Java 8 |
TESTS |
58 |
296 |
3379200 |
|
2400 |
61987925 |
HardikDobariya |
F |
Oct. 6, 2019, 2:09 p.m. |
OK |
Java 8 |
TESTS |
58 |
311 |
0 |
|
2400 |
61876111 |
Jarik |
F |
Oct. 4, 2019, 8:15 p.m. |
OK |
Java 8 |
TESTS |
58 |
311 |
3788800 |
|
2400 |
61878717 |
beginner1010 |
F |
Oct. 4, 2019, 9:37 p.m. |
OK |
Java 8 |
TESTS |
58 |
311 |
11673600 |
|
2400 |
61712772 |
sarthakmanna |
F |
Oct. 2, 2019, 11:49 a.m. |
OK |
Java 8 |
TESTS |
58 |
326 |
0 |
|
2400 |
61696882 |
Spheniscine |
F |
Oct. 2, 2019, 7:14 a.m. |
OK |
Kotlin |
TESTS |
58 |
295 |
0 |
|
2400 |
61696080 |
Spheniscine |
F |
Oct. 2, 2019, 7:01 a.m. |
OK |
Kotlin |
TESTS |
58 |
295 |
0 |
|
2400 |
61695507 |
Spheniscine |
F |
Oct. 2, 2019, 6:53 a.m. |
OK |
Kotlin |
TESTS |
58 |
1965 |
93388800 |
|
2400 |
64137501 |
og.kostya |
F |
Nov. 3, 2019, 7:33 a.m. |
OK |
Mono C# |
TESTS |
58 |
155 |
8192000 |
|
2400 |
64137687 |
vjudge3 |
F |
Nov. 3, 2019, 7:37 a.m. |
OK |
MS C++ |
TESTS |
58 |
109 |
5222400 |
|
2400 |
62089010 |
vjudge1 |
F |
Oct. 8, 2019, 4:30 a.m. |
OK |
MS C++ |
TESTS |
58 |
124 |
5222400 |
|
2400 |
61773300 |
vjudge2 |
F |
Oct. 3, 2019, 10:56 a.m. |
OK |
MS C++ |
TESTS |
58 |
124 |
9011200 |
|
2400 |
66468368 |
vjudge3 |
F |
Dec. 7, 2019, 5:23 p.m. |
OK |
MS C++ |
TESTS |
58 |
155 |
5222400 |
|
2400 |
66436495 |
vjudge4 |
F |
Dec. 7, 2019, 6:24 a.m. |
OK |
MS C++ |
TESTS |
58 |
155 |
18944000 |
|
2400 |
62054668 |
yoko2001_1 |
F |
Oct. 7, 2019, 11:38 a.m. |
OK |
MS C++ 2017 |
TESTS |
58 |
171 |
10342400 |
|
2400 |
63429824 |
mrrid |
F |
Oct. 26, 2019, 8:49 a.m. |
OK |
MS C++ 2017 |
TESTS |
58 |
483 |
6041600 |
|
2400 |
66389408 |
vjudge4 |
F |
Dec. 6, 2019, 8:36 a.m. |
OK |
MS C++ 2017 |
TESTS |
58 |
623 |
11059200 |
|
2400 |
61800533 |
YESMAths |
F |
Oct. 3, 2019, 6:48 p.m. |
OK |
PyPy 2 |
TESTS |
58 |
623 |
11264000 |
|
2400 |
62070522 |
zaceleiseliakai |
F |
Oct. 7, 2019, 4:36 p.m. |
OK |
PyPy 2 |
TESTS |
58 |
888 |
31232000 |
|
2400 |
62168266 |
tjs1297 |
F |
Oct. 8, 2019, 9:59 p.m. |
OK |
PyPy 3 |
TESTS |
58 |
1933 |
10240000 |
|
2400 |
61860778 |
ikazuya0201 |
F |
Oct. 4, 2019, 3:17 p.m. |
OK |
Rust |
TESTS |
58 |
420 |
210739200 |
|
2400 |
remove filters
Back to search problems