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 of n lowercase Latin letters. Some indices in this string are marked as forbidden. You want to find a string a such that the value of |a| xc2 xb7f(a) is maximum possible, where f(a) is the number of occurences of a in s such that these occurences end in non-forbidden indices. So, for example, if s is aaaa, a is aa and index 3 is forbidden, then f(a) xe2 x80 x89= xe2 x80 x892 because there are three occurences of a in s (starting in indices 1, 2 and 3), but one of them (starting in index 2) ends in a forbidden index. Calculate the maximum possible value of |a| xc2 xb7f(a) you can get. The first line contains an integer number n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89200000) -- the length of s. The second line contains a string s, consisting of n lowercase Latin letters. The third line contains a string t, consisting of n characters 0 and 1. If i-th character in t is 1, then i is a forbidden index (otherwise i is not forbidden). Print the maximum possible value of |a| xc2 xb7f(a). '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
31254754 |
TTN1998 |
F |
Oct. 12, 2017, 4:22 p.m. |
OK |
GNU C++ |
TESTS |
81 |
46 |
13209600 |
|
2300 |
31245985 |
_ShadowSong |
F |
Oct. 12, 2017, 2:28 p.m. |
OK |
GNU C++ |
TESTS |
81 |
46 |
13209600 |
|
2300 |
38976326 |
xsc |
F |
June 5, 2018, 6:15 p.m. |
OK |
GNU C++ |
TESTS |
81 |
61 |
16691200 |
|
2300 |
31514424 |
huangzhen |
F |
Oct. 19, 2017, 4:51 p.m. |
OK |
GNU C++ |
TESTS |
81 |
61 |
51712000 |
|
2300 |
35590276 |
131131yhx |
F |
Feb. 23, 2018, 7:15 a.m. |
OK |
GNU C++ |
TESTS |
81 |
61 |
54067200 |
|
2300 |
38976164 |
xsc |
F |
June 5, 2018, 6:08 p.m. |
OK |
GNU C++ |
TESTS |
81 |
62 |
16691200 |
|
2300 |
31255897 |
Cydiater |
F |
Oct. 12, 2017, 5 p.m. |
OK |
GNU C++ |
TESTS |
81 |
62 |
50483200 |
|
2300 |
31272604 |
xzkkjm |
F |
Oct. 13, 2017, 11:33 a.m. |
OK |
GNU C++ |
TESTS |
81 |
62 |
53760000 |
|
2300 |
34655373 |
GXZlegend |
F |
Jan. 29, 2018, 8:26 a.m. |
OK |
GNU C++ |
TESTS |
81 |
62 |
59904000 |
|
2300 |
34253199 |
Worldwide_D |
F |
Jan. 17, 2018, 1:41 p.m. |
OK |
GNU C++ |
TESTS |
81 |
62 |
60313600 |
|
2300 |
31435536 |
1049451037 |
F |
Oct. 17, 2017, 12:59 a.m. |
OK |
GNU C++11 |
TESTS |
81 |
46 |
23347200 |
|
2300 |
31365580 |
Efina |
F |
Oct. 15, 2017, 12:55 p.m. |
OK |
GNU C++11 |
TESTS |
81 |
46 |
52121600 |
|
2300 |
57324065 |
shenmadongdong |
F |
July 19, 2019, 11:19 a.m. |
OK |
GNU C++11 |
TESTS |
81 |
61 |
11980800 |
|
2300 |
52880629 |
jack_123456789 |
F |
April 16, 2019, 11:39 p.m. |
OK |
GNU C++11 |
TESTS |
81 |
62 |
6860800 |
|
2300 |
65561358 |
2016smy |
F |
Nov. 23, 2019, 3:06 a.m. |
OK |
GNU C++11 |
TESTS |
81 |
62 |
8192000 |
|
2300 |
31526826 |
LbyG |
F |
Oct. 20, 2017, 8:14 a.m. |
OK |
GNU C++11 |
TESTS |
81 |
62 |
10956800 |
|
2300 |
38976135 |
xsc |
F |
June 5, 2018, 6:06 p.m. |
OK |
GNU C++11 |
TESTS |
81 |
62 |
16691200 |
|
2300 |
31504732 |
hdus10 |
F |
Oct. 19, 2017, 10:43 a.m. |
OK |
GNU C++11 |
TESTS |
81 |
62 |
17305600 |
|
2300 |
67195855 |
Rubbish12345 |
F |
Dec. 19, 2019, 9 a.m. |
OK |
GNU C++11 |
TESTS |
81 |
62 |
49356800 |
|
2300 |
50062400 |
CaptainSlow |
F |
Feb. 17, 2019, 1:16 p.m. |
OK |
GNU C++11 |
TESTS |
81 |
62 |
49971200 |
|
2300 |
33664672 |
CQzhangyu |
F |
Dec. 27, 2017, 9:01 a.m. |
OK |
GNU C++14 |
TESTS |
81 |
46 |
52428800 |
|
2300 |
33202465 |
sarthaksoni251 |
F |
Dec. 13, 2017, 5:09 a.m. |
OK |
GNU C++14 |
TESTS |
81 |
61 |
52428800 |
|
2300 |
33026877 |
Georgia_001 |
F |
Dec. 8, 2017, 3:36 p.m. |
OK |
GNU C++14 |
TESTS |
81 |
61 |
52428800 |
|
2300 |
39007145 |
waynetuinfor |
F |
June 7, 2018, 2:23 a.m. |
OK |
GNU C++14 |
TESTS |
81 |
62 |
26624000 |
|
2300 |
32210862 |
Kelukin |
F |
Nov. 11, 2017, 5:18 a.m. |
OK |
GNU C++14 |
TESTS |
81 |
62 |
49356800 |
|
2300 |
31269050 |
I_Love_Umirzhanova_Amina |
F |
Oct. 13, 2017, 8:44 a.m. |
OK |
GNU C++14 |
TESTS |
81 |
62 |
50483200 |
|
2300 |
31246074 |
SPFA_THE_BEST_ALGORITHM |
F |
Oct. 12, 2017, 2:29 p.m. |
OK |
GNU C++14 |
TESTS |
81 |
62 |
50483200 |
|
2300 |
62928138 |
Jupitercal |
F |
Oct. 19, 2019, 11:55 a.m. |
OK |
GNU C++14 |
TESTS |
81 |
62 |
55091200 |
|
2300 |
55815554 |
vjudge3 |
F |
June 20, 2019, 6:17 a.m. |
OK |
GNU C++14 |
TESTS |
81 |
62 |
58163200 |
|
2300 |
31950460 |
ctlchild |
F |
Nov. 1, 2017, 12:56 p.m. |
OK |
GNU C++14 |
TESTS |
81 |
62 |
61747200 |
|
2300 |
58995658 |
BigBang_19 |
F |
Aug. 18, 2019, 11:14 a.m. |
OK |
GNU C++17 |
TESTS |
81 |
62 |
130252800 |
|
2300 |
58336541 |
Refloria |
F |
Aug. 5, 2019, 11:41 a.m. |
OK |
GNU C++17 |
TESTS |
81 |
77 |
51916800 |
|
2300 |
65291533 |
zhangrongxin |
F |
Nov. 18, 2019, 9:59 a.m. |
OK |
GNU C++17 |
TESTS |
81 |
77 |
52121600 |
|
2300 |
58409886 |
Vexoben |
F |
Aug. 7, 2019, 12:52 a.m. |
OK |
GNU C++17 |
TESTS |
81 |
77 |
126259200 |
|
2300 |
46856909 |
RUSH_D_CAT |
F |
Dec. 10, 2018, 3:25 p.m. |
OK |
GNU C++17 |
TESTS |
81 |
93 |
8396800 |
|
2300 |
68474581 |
WA_King |
F |
Jan. 10, 2020, 4:40 a.m. |
OK |
GNU C++17 |
TESTS |
81 |
93 |
27443200 |
|
2300 |
58983888 |
shahed_ahmed |
F |
Aug. 18, 2019, 6 a.m. |
OK |
GNU C++17 |
TESTS |
81 |
93 |
30822400 |
|
2300 |
62108014 |
shuerss |
F |
Oct. 8, 2019, 11:25 a.m. |
OK |
GNU C++17 |
TESTS |
81 |
93 |
49254400 |
|
2300 |
60469749 |
GabrielPessoa |
F |
Sept. 13, 2019, 4:40 a.m. |
OK |
GNU C++17 |
TESTS |
81 |
93 |
52019200 |
|
2300 |
62443657 |
pit4h |
F |
Oct. 12, 2019, 8:58 p.m. |
OK |
GNU C++17 |
TESTS |
81 |
109 |
6451200 |
|
2300 |
33991735 |
svilen |
F |
Jan. 7, 2018, 9:43 p.m. |
OK |
Java 8 |
TESTS |
81 |
311 |
55398400 |
|
2300 |
33990520 |
svilen |
F |
Jan. 7, 2018, 8:24 p.m. |
OK |
Java 8 |
TESTS |
81 |
312 |
55398400 |
|
2300 |
31260669 |
I_Need_Alex_R_Coleman |
F |
Oct. 12, 2017, 9:07 p.m. |
OK |
Java 8 |
TESTS |
81 |
358 |
5324800 |
|
2300 |
33990885 |
svilen |
F |
Jan. 7, 2018, 8:58 p.m. |
OK |
Java 8 |
TESTS |
81 |
358 |
94310400 |
|
2300 |
31382565 |
RP_9 |
F |
Oct. 16, 2017, 5:40 a.m. |
OK |
Java 8 |
TESTS |
81 |
374 |
28160000 |
|
2300 |
31432274 |
U_Square |
F |
Oct. 16, 2017, 8:09 p.m. |
OK |
Java 8 |
TESTS |
81 |
420 |
46387200 |
|
2300 |
31255658 |
pitfall |
F |
Oct. 12, 2017, 4:51 p.m. |
OK |
Java 8 |
TESTS |
81 |
436 |
5120000 |
|
2300 |
31256730 |
uwi |
F |
Oct. 12, 2017, 5:34 p.m. |
OK |
Java 8 |
TESTS |
81 |
576 |
36044800 |
|
2300 |
31248565 |
Ahmad_Elsagheer |
F |
Oct. 12, 2017, 2:53 p.m. |
OK |
Java 8 |
TESTS |
81 |
763 |
104038400 |
|
2300 |
34809244 |
mariem_kandil |
F |
Feb. 1, 2018, 4:16 p.m. |
OK |
Java 8 |
TESTS |
81 |
780 |
202649600 |
|
2300 |
33950803 |
Maffka |
F |
Jan. 5, 2018, 8:19 p.m. |
OK |
MS C++ |
TESTS |
81 |
234 |
46489600 |
|
2300 |
31259636 |
Perforator |
F |
Oct. 12, 2017, 7:50 p.m. |
OK |
MS C++ |
TESTS |
81 |
312 |
48025600 |
|
2300 |
remove filters
Back to search problems