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'The string t_1t_2 ... t_k is good if each letter of this string belongs to at least one palindrome of length greater than 1. A palindrome is a string that reads the same backward as forward. For example, the strings A, BAB, ABBA, BAABBBAAB are palindromes, but the strings AB, ABBBAA, BBBA are not. Here are some examples of good strings: You are given a string s of length n , consisting of only letters A and B. You have to calculate the number of good substrings of string s . The first line contains one integer n ( 1 <= n <= 3 cdot 10^5 ) -- the length of the string s . The second line contains the string s , consisting of letters A and B. Print one integer -- the number of good substrings of string s . In the first test case there are six good substrings: s_1 ... s_2 , s_1 ... s_4 , s_1 ... s_5 , s_3 ... s_4 , s_3 ... s_5 and s_4 ... s_5 . In the second test case there are three good substrings: s_1 ... s_2 , s_1 ... s_3 and s_2 ... s_3 . '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
62144208 |
Chipe1 |
D |
Oct. 8, 2019, 3:58 p.m. |
OK |
GNU C11 |
TESTS |
15 |
30 |
1536000 |
|
1800 |
62132915 |
AsrielDreamer |
D |
Oct. 8, 2019, 3:14 p.m. |
OK |
GNU C++11 |
TESTS |
15 |
15 |
307200 |
|
1800 |
62151698 |
newbin |
D |
Oct. 8, 2019, 4:33 p.m. |
OK |
GNU C++11 |
TESTS |
15 |
30 |
307200 |
|
1800 |
62132339 |
I_love_Nikaidou_Shinku |
D |
Oct. 8, 2019, 3:11 p.m. |
OK |
GNU C++11 |
TESTS |
15 |
30 |
307200 |
|
1800 |
62132820 |
KoalaMu |
D |
Oct. 8, 2019, 3:14 p.m. |
OK |
GNU C++11 |
TESTS |
15 |
30 |
1024000 |
|
1800 |
62144829 |
tran0826_1 |
D |
Oct. 8, 2019, 4:01 p.m. |
OK |
GNU C++11 |
TESTS |
15 |
30 |
1024000 |
|
1800 |
62134391 |
atacan |
D |
Oct. 8, 2019, 3:21 p.m. |
OK |
GNU C++11 |
TESTS |
15 |
30 |
1024000 |
|
1800 |
62155805 |
jinfeixibi |
D |
Oct. 8, 2019, 4:53 p.m. |
OK |
GNU C++11 |
TESTS |
15 |
30 |
1024000 |
|
1800 |
62141904 |
QiyangAKIOI |
D |
Oct. 8, 2019, 3:49 p.m. |
OK |
GNU C++11 |
TESTS |
15 |
30 |
1536000 |
|
1800 |
62152284 |
ljjjjjjq |
D |
Oct. 8, 2019, 4:36 p.m. |
OK |
GNU C++11 |
TESTS |
15 |
30 |
1536000 |
|
1800 |
62147397 |
LYYY |
D |
Oct. 8, 2019, 4:13 p.m. |
OK |
GNU C++11 |
TESTS |
15 |
30 |
1638400 |
|
1800 |
62150245 |
beginend |
D |
Oct. 8, 2019, 4:27 p.m. |
OK |
GNU C++14 |
TESTS |
15 |
15 |
307200 |
|
1800 |
62138050 |
dsingh24 |
D |
Oct. 8, 2019, 3:34 p.m. |
OK |
GNU C++14 |
TESTS |
15 |
15 |
1024000 |
|
1800 |
62156436 |
imranasuman |
D |
Oct. 8, 2019, 4:54 p.m. |
OK |
GNU C++14 |
TESTS |
15 |
15 |
1024000 |
|
1800 |
62151700 |
utkarshsinha97 |
D |
Oct. 8, 2019, 4:33 p.m. |
OK |
GNU C++14 |
TESTS |
15 |
15 |
1024000 |
|
1800 |
62151278 |
Dipjal |
D |
Oct. 8, 2019, 4:31 p.m. |
OK |
GNU C++14 |
TESTS |
15 |
15 |
1024000 |
|
1800 |
62145555 |
nguyenguyen753 |
D |
Oct. 8, 2019, 4:04 p.m. |
OK |
GNU C++14 |
TESTS |
15 |
15 |
1024000 |
|
1800 |
62138987 |
tanmay2625 |
D |
Oct. 8, 2019, 3:37 p.m. |
OK |
GNU C++14 |
TESTS |
15 |
15 |
1024000 |
|
1800 |
62151882 |
sewage |
D |
Oct. 8, 2019, 4:34 p.m. |
OK |
GNU C++14 |
TESTS |
15 |
15 |
1536000 |
|
1800 |
62138474 |
LittleFall |
D |
Oct. 8, 2019, 3:35 p.m. |
OK |
GNU C++14 |
TESTS |
15 |
15 |
2560000 |
|
1800 |
62149341 |
HARI1A |
D |
Oct. 8, 2019, 4:22 p.m. |
OK |
GNU C++14 |
TESTS |
15 |
15 |
2662400 |
|
1800 |
62149468 |
intruder_p |
D |
Oct. 8, 2019, 4:23 p.m. |
OK |
GNU C++17 |
TESTS |
15 |
15 |
1024000 |
|
1800 |
62149256 |
ravigupta2323 |
D |
Oct. 8, 2019, 4:22 p.m. |
OK |
GNU C++17 |
TESTS |
15 |
15 |
1024000 |
|
1800 |
62144393 |
HanaYukii |
D |
Oct. 8, 2019, 3:59 p.m. |
OK |
GNU C++17 |
TESTS |
15 |
15 |
1024000 |
|
1800 |
62140315 |
Arrias |
D |
Oct. 8, 2019, 3:43 p.m. |
OK |
GNU C++17 |
TESTS |
15 |
15 |
1024000 |
|
1800 |
62137367 |
mehrunesartem |
D |
Oct. 8, 2019, 3:31 p.m. |
OK |
GNU C++17 |
TESTS |
15 |
15 |
1024000 |
|
1800 |
62134963 |
kek1234 |
D |
Oct. 8, 2019, 3:23 p.m. |
OK |
GNU C++17 |
TESTS |
15 |
15 |
1024000 |
|
1800 |
62142623 |
emthrm |
D |
Oct. 8, 2019, 3:52 p.m. |
OK |
GNU C++17 |
TESTS |
15 |
15 |
1024000 |
|
1800 |
62151679 |
copperium |
D |
Oct. 8, 2019, 4:33 p.m. |
OK |
GNU C++17 |
TESTS |
15 |
15 |
1024000 |
|
1800 |
62151262 |
rohithill |
D |
Oct. 8, 2019, 4:31 p.m. |
OK |
GNU C++17 |
TESTS |
15 |
15 |
1024000 |
|
1800 |
62148301 |
Sparky123 |
D |
Oct. 8, 2019, 4:17 p.m. |
OK |
GNU C++17 |
TESTS |
15 |
15 |
2252800 |
|
1800 |
62148515 |
real.emerald |
D |
Oct. 8, 2019, 4:18 p.m. |
OK |
Java 8 |
TESTS |
15 |
108 |
0 |
|
1800 |
62151827 |
cn355 |
D |
Oct. 8, 2019, 4:34 p.m. |
OK |
Java 8 |
TESTS |
15 |
124 |
0 |
|
1800 |
62153776 |
chojh1222 |
D |
Oct. 8, 2019, 4:44 p.m. |
OK |
Java 8 |
TESTS |
15 |
124 |
0 |
|
1800 |
62152453 |
kostasanemozalis |
D |
Oct. 8, 2019, 4:37 p.m. |
OK |
Java 8 |
TESTS |
15 |
124 |
0 |
|
1800 |
62152184 |
Nutella3000 |
D |
Oct. 8, 2019, 4:36 p.m. |
OK |
Java 8 |
TESTS |
15 |
124 |
0 |
|
1800 |
62152106 |
jdurie |
D |
Oct. 8, 2019, 4:35 p.m. |
OK |
Java 8 |
TESTS |
15 |
124 |
0 |
|
1800 |
62147912 |
NinjaDoggy |
D |
Oct. 8, 2019, 4:15 p.m. |
OK |
Java 8 |
TESTS |
15 |
124 |
0 |
|
1800 |
62145655 |
armking |
D |
Oct. 8, 2019, 4:05 p.m. |
OK |
Java 8 |
TESTS |
15 |
124 |
0 |
|
1800 |
62145302 |
heff10 |
D |
Oct. 8, 2019, 4:03 p.m. |
OK |
Java 8 |
TESTS |
15 |
124 |
0 |
|
1800 |
62138753 |
HardikDobariya |
D |
Oct. 8, 2019, 3:37 p.m. |
OK |
Java 8 |
TESTS |
15 |
124 |
0 |
|
1800 |
62147373 |
Yupiteru |
D |
Oct. 8, 2019, 4:13 p.m. |
OK |
Mono C# |
TESTS |
15 |
77 |
146739200 |
|
1800 |
62155555 |
omikad |
D |
Oct. 8, 2019, 4:52 p.m. |
OK |
Mono C# |
TESTS |
15 |
405 |
12083200 |
|
1800 |
62140541 |
Ivan11 |
D |
Oct. 8, 2019, 3:44 p.m. |
OK |
MS C++ 2017 |
TESTS |
15 |
31 |
921600 |
|
1800 |
62143252 |
MrLolthe1st |
D |
Oct. 8, 2019, 3:55 p.m. |
OK |
MS C++ 2017 |
TESTS |
15 |
31 |
921600 |
|
1800 |
62135870 |
IT_MACHINE |
D |
Oct. 8, 2019, 3:26 p.m. |
OK |
MS C++ 2017 |
TESTS |
15 |
31 |
921600 |
|
1800 |
62140280 |
omerb.zeybek |
D |
Oct. 8, 2019, 3:43 p.m. |
OK |
MS C++ 2017 |
TESTS |
15 |
31 |
921600 |
|
1800 |
62144111 |
AleksanderBalobanov |
D |
Oct. 8, 2019, 3:58 p.m. |
OK |
MS C++ 2017 |
TESTS |
15 |
31 |
2150400 |
|
1800 |
62147099 |
lonely_moon |
D |
Oct. 8, 2019, 4:12 p.m. |
OK |
MS C++ 2017 |
TESTS |
15 |
31 |
2150400 |
|
1800 |
62140726 |
Pricolno |
D |
Oct. 8, 2019, 3:45 p.m. |
OK |
MS C++ 2017 |
TESTS |
15 |
31 |
3072000 |
|
1800 |
62152101 |
pinder |
D |
Oct. 8, 2019, 4:35 p.m. |
OK |
MS C++ 2017 |
TESTS |
15 |
31 |
4812800 |
|
1800 |
62148421 |
youx |
D |
Oct. 8, 2019, 4:18 p.m. |
OK |
MS C++ 2017 |
TESTS |
15 |
31 |
5529600 |
|
1800 |
62139073 |
EgorShibaev |
D |
Oct. 8, 2019, 3:38 p.m. |
OK |
MS C++ 2017 |
TESTS |
15 |
46 |
921600 |
|
1800 |
62133433 |
astrom.lars |
D |
Oct. 8, 2019, 3:17 p.m. |
OK |
PyPy 2 |
TESTS |
15 |
140 |
1228800 |
|
1800 |
62132873 |
bcollet |
D |
Oct. 8, 2019, 3:14 p.m. |
OK |
PyPy 2 |
TESTS |
15 |
156 |
6553600 |
|
1800 |
62129984 |
Jobless22 |
D |
Oct. 8, 2019, 2:59 p.m. |
OK |
PyPy 2 |
TESTS |
15 |
171 |
5120000 |
|
1800 |
62140572 |
pajenegod |
D |
Oct. 8, 2019, 3:44 p.m. |
OK |
PyPy 2 |
TESTS |
15 |
545 |
101273600 |
|
1800 |
62137708 |
komolakanto |
D |
Oct. 8, 2019, 3:33 p.m. |
OK |
PyPy 3 |
TESTS |
15 |
155 |
7987200 |
|
1800 |
62148903 |
neterukun |
D |
Oct. 8, 2019, 4:20 p.m. |
OK |
PyPy 3 |
TESTS |
15 |
171 |
3788800 |
|
1800 |
62138977 |
Sevlll |
D |
Oct. 8, 2019, 3:37 p.m. |
OK |
PyPy 3 |
TESTS |
15 |
171 |
8294400 |
|
1800 |
62134717 |
malylesio |
D |
Oct. 8, 2019, 3:22 p.m. |
OK |
PyPy 3 |
TESTS |
15 |
171 |
8908800 |
|
1800 |
62149196 |
nagitaosu |
D |
Oct. 8, 2019, 4:22 p.m. |
OK |
PyPy 3 |
TESTS |
15 |
171 |
9523200 |
|
1800 |
62145063 |
vinuthegr8 |
D |
Oct. 8, 2019, 4:02 p.m. |
OK |
PyPy 3 |
TESTS |
15 |
187 |
16384000 |
|
1800 |
62139785 |
pineriver |
D |
Oct. 8, 2019, 3:41 p.m. |
OK |
PyPy 3 |
TESTS |
15 |
202 |
10240000 |
|
1800 |
62145652 |
beemax |
D |
Oct. 8, 2019, 4:05 p.m. |
OK |
PyPy 3 |
TESTS |
15 |
202 |
13004800 |
|
1800 |
62139832 |
PhilTheFish |
D |
Oct. 8, 2019, 3:41 p.m. |
OK |
PyPy 3 |
TESTS |
15 |
202 |
14028800 |
|
1800 |
62143853 |
O_Ramanujan |
D |
Oct. 8, 2019, 3:57 p.m. |
OK |
PyPy 3 |
TESTS |
15 |
218 |
4915200 |
|
1800 |
62142372 |
NamanTyagi |
D |
Oct. 8, 2019, 3:51 p.m. |
OK |
Python 3 |
TESTS |
15 |
295 |
8806400 |
|
1800 |
62141992 |
old_boo |
D |
Oct. 8, 2019, 3:50 p.m. |
OK |
Python 3 |
TESTS |
15 |
311 |
1126400 |
|
1800 |
62150854 |
Coki628 |
D |
Oct. 8, 2019, 4:29 p.m. |
OK |
Python 3 |
TESTS |
15 |
343 |
5939200 |
|
1800 |
62143861 |
MaximusTG |
D |
Oct. 8, 2019, 3:57 p.m. |
OK |
Python 3 |
TESTS |
15 |
452 |
19046400 |
|
1800 |
62133568 |
sansen |
D |
Oct. 8, 2019, 3:18 p.m. |
OK |
Rust |
TESTS |
15 |
31 |
2969600 |
|
1800 |
remove filters
Back to search problems