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'Today is an important day for chef Tonio -- an auditor has arrived in his hometown of Morioh. He has also arrived at Tonio 's restaurant and ordered dessert. Tonio has not been prepared for this turn of events. As you know, dessert is a string of lowercase English letters. Tonio remembered the rule of desserts -- a string s of length n . Any dessert t is delicious if the number of occurrences of t in s as a substring is divisible by the length of t . Now Tonio wants to know the number of delicious substrings of s . If the substring occurs several times in the string s , then all occurrences must be taken into account. The first line contains an integer n ( 1 <= q n <= q 10^6 ) -- the length of the rule s . The second line contains the string s of length n -- the rule. The rule consists only of lowercase English letters. In a single line print the number of delicious substrings of s . In the first sample, there are many delicious substrings. 7 of them are substrings of length 1 (because any number is divisible by 1 ). Consider other delicious substrings: Therefore, the answer is 7 + 2 + 2 = 11 . Note that the answer includes both occurrences of "ab" and "ba". '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
190582432 |
rainboy |
G |
Jan. 25, 2023, 6:41 p.m. |
OK |
GNU C11 |
TESTS |
58 |
2308 |
229478400 |
|
|
190588244 |
rainboy |
G |
Jan. 25, 2023, 7:43 p.m. |
OK |
GNU C11 |
TESTS |
58 |
2620 |
229478400 |
|
|
190581117 |
rainboy |
G |
Jan. 25, 2023, 6:29 p.m. |
OK |
GNU C11 |
TESTS |
58 |
2745 |
221388800 |
|
|
190583840 |
rainboy |
G |
Jan. 25, 2023, 6:54 p.m. |
OK |
GNU C11 |
TESTS |
58 |
2761 |
229376000 |
|
|
190588169 |
rainboy |
G |
Jan. 25, 2023, 7:42 p.m. |
OK |
GNU C11 |
TESTS |
58 |
2807 |
229478400 |
|
|
190581654 |
rainboy |
G |
Jan. 25, 2023, 6:34 p.m. |
OK |
GNU C11 |
TESTS |
58 |
2885 |
221388800 |
|
|
190573120 |
rainboy |
G |
Jan. 25, 2023, 5:33 p.m. |
OK |
GNU C11 |
TESTS |
58 |
2885 |
221388800 |
|
|
190564792 |
The__First__Light |
G |
Jan. 25, 2023, 4:31 p.m. |
OK |
GNU C++14 |
TESTS |
58 |
389 |
322457600 |
|
|
190568978 |
1213James |
G |
Jan. 25, 2023, 5:09 p.m. |
OK |
GNU C++14 |
TESTS |
58 |
997 |
369868800 |
|
|
190607396 |
samnever |
G |
Jan. 26, 2023, 3:26 a.m. |
OK |
GNU C++14 |
TESTS |
58 |
1044 |
394854400 |
|
|
190611718 |
Leasier |
G |
Jan. 26, 2023, 4:51 a.m. |
OK |
GNU C++14 |
TESTS |
58 |
1372 |
404172800 |
|
|
190570958 |
myheartwaing |
G |
Jan. 25, 2023, 5:20 p.m. |
OK |
GNU C++14 |
TESTS |
58 |
1450 |
364134400 |
|
|
190608997 |
MIKEFENG |
G |
Jan. 26, 2023, 4:02 a.m. |
OK |
GNU C++14 |
TESTS |
58 |
1466 |
380211200 |
|
|
190565756 |
cqbz163003gzm |
G |
Jan. 25, 2023, 4:34 p.m. |
OK |
GNU C++14 |
TESTS |
58 |
1482 |
396083200 |
|
|
190603398 |
rui_er |
G |
Jan. 26, 2023, 1:41 a.m. |
OK |
GNU C++14 |
TESTS |
58 |
1575 |
431001600 |
|
|
190611607 |
Leasier |
G |
Jan. 26, 2023, 4:49 a.m. |
OK |
GNU C++14 |
TESTS |
58 |
1622 |
404172800 |
|
|
190605946 |
xuziyuan |
G |
Jan. 26, 2023, 2:50 a.m. |
OK |
GNU C++14 |
TESTS |
58 |
1730 |
407961600 |
|
|
190610488 |
0x4c |
G |
Jan. 26, 2023, 4:30 a.m. |
OK |
GNU C++17 |
TESTS |
58 |
264 |
265523200 |
|
|
190563908 |
HaPpY1213 |
G |
Jan. 25, 2023, 4:28 p.m. |
OK |
GNU C++17 |
TESTS |
58 |
670 |
361779200 |
|
|
190575011 |
Suzukazee |
G |
Jan. 25, 2023, 5:45 p.m. |
OK |
GNU C++17 |
TESTS |
58 |
686 |
296038400 |
|
|
190559981 |
Um_nik |
G |
Jan. 25, 2023, 4:15 p.m. |
OK |
GNU C++17 |
TESTS |
58 |
701 |
285900800 |
|
|
190581162 |
chen_zexing |
G |
Jan. 25, 2023, 6:29 p.m. |
OK |
GNU C++17 |
TESTS |
58 |
842 |
77312000 |
|
|
190607533 |
s_y_l |
G |
Jan. 26, 2023, 3:29 a.m. |
OK |
GNU C++17 |
TESTS |
58 |
904 |
385843200 |
|
|
190604954 |
Timi66 |
G |
Jan. 26, 2023, 2:25 a.m. |
OK |
GNU C++17 |
TESTS |
58 |
967 |
331673600 |
|
|
190586739 |
ash_98 |
G |
Jan. 25, 2023, 7:25 p.m. |
OK |
GNU C++17 |
TESTS |
58 |
1153 |
163532800 |
|
|
190552122 |
NoMentalPowerLeft |
G |
Jan. 25, 2023, 3:54 p.m. |
OK |
GNU C++17 |
TESTS |
58 |
1231 |
129536000 |
|
|
190586882 |
ash_98 |
G |
Jan. 25, 2023, 7:26 p.m. |
OK |
GNU C++17 |
TESTS |
58 |
1325 |
163532800 |
|
|
190559518 |
rniya |
G |
Jan. 25, 2023, 4:14 p.m. |
OK |
GNU C++17 (64) |
TESTS |
58 |
483 |
57344000 |
|
|
190606122 |
zhangboju |
G |
Jan. 26, 2023, 2:54 a.m. |
OK |
GNU C++17 (64) |
TESTS |
58 |
733 |
474828800 |
|
|
190561765 |
SSRS_ |
G |
Jan. 25, 2023, 4:21 p.m. |
OK |
GNU C++17 (64) |
TESTS |
58 |
982 |
274534400 |
|
|
190548552 |
Geothermal |
G |
Jan. 25, 2023, 3:45 p.m. |
OK |
GNU C++17 (64) |
TESTS |
58 |
1201 |
43008000 |
|
|
190571520 |
paopaooux |
G |
Jan. 25, 2023, 5:23 p.m. |
OK |
GNU C++17 (64) |
TESTS |
58 |
1419 |
376320000 |
|
|
190560913 |
potato167 |
G |
Jan. 25, 2023, 4:18 p.m. |
OK |
GNU C++17 (64) |
TESTS |
58 |
1591 |
152780800 |
|
|
190602208 |
YaoLingF |
G |
Jan. 26, 2023, 1:01 a.m. |
OK |
GNU C++17 (64) |
TESTS |
58 |
1606 |
417484800 |
|
|
190548590 |
Whereismybrain |
G |
Jan. 25, 2023, 3:45 p.m. |
OK |
GNU C++17 (64) |
TESTS |
58 |
1684 |
480460800 |
|
|
190591521 |
greencis |
G |
Jan. 25, 2023, 8:28 p.m. |
OK |
GNU C++17 (64) |
TESTS |
58 |
1699 |
472473600 |
|
|
190560974 |
YamadaRyo |
G |
Jan. 25, 2023, 4:18 p.m. |
OK |
GNU C++17 (64) |
TESTS |
58 |
1731 |
197120000 |
|
|
190565943 |
HEltim7 |
G |
Jan. 25, 2023, 4:34 p.m. |
OK |
GNU C++20 (64) |
TESTS |
58 |
467 |
470630400 |
|
|
190557196 |
oversolver |
G |
Jan. 25, 2023, 4:07 p.m. |
OK |
GNU C++20 (64) |
TESTS |
58 |
498 |
245248000 |
|
|
190612550 |
triveni |
G |
Jan. 26, 2023, 5:05 a.m. |
OK |
GNU C++20 (64) |
TESTS |
58 |
529 |
74342400 |
|
|
190610663 |
yingluosanqian |
G |
Jan. 26, 2023, 4:33 a.m. |
OK |
GNU C++20 (64) |
TESTS |
58 |
577 |
381440000 |
|
|
190550180 |
m_99 |
G |
Jan. 25, 2023, 3:49 p.m. |
OK |
GNU C++20 (64) |
TESTS |
58 |
592 |
62259200 |
|
|
190554723 |
Ormlis |
G |
Jan. 25, 2023, 4 p.m. |
OK |
GNU C++20 (64) |
TESTS |
58 |
592 |
93593600 |
|
|
190611445 |
triveni |
G |
Jan. 26, 2023, 4:46 a.m. |
OK |
GNU C++20 (64) |
TESTS |
58 |
655 |
74342400 |
|
|
190559215 |
Mika_Mune |
G |
Jan. 25, 2023, 4:13 p.m. |
OK |
GNU C++20 (64) |
TESTS |
58 |
670 |
474726400 |
|
|
190553258 |
Rubikun |
G |
Jan. 25, 2023, 3:56 p.m. |
OK |
GNU C++20 (64) |
TESTS |
58 |
764 |
69427200 |
|
|
190549251 |
Golovanov399 |
G |
Jan. 25, 2023, 3:47 p.m. |
OK |
GNU C++20 (64) |
TESTS |
58 |
811 |
403763200 |
|
|
190563433 |
shotoyoo |
G |
Jan. 25, 2023, 4:26 p.m. |
OK |
PyPy 3-64 |
TESTS |
58 |
1918 |
115609600 |
|
|
remove filters
Back to search problems