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 binary string s . Find the number of distinct cyclical binary strings of length n which contain s as a substring. The cyclical string t contains s as a substring if there is some cyclical shift of string t , such that s is a substring of this cyclical shift of t . For example, the cyclical string "000111" contains substrings "001", "01110" and "10", but doesn 't contain "0110" and "10110". Two cyclical strings are called different if they differ from each other as strings. For example, two different strings, which differ from each other by a cyclical shift, are still considered different cyclical strings. The first line contains a single integer n ( 1 <= n <= 40 ) -- the length of the target string t . The next line contains the string s ( 1 <= |s| <= n ) -- the string which must be a substring of cyclical string t . String s contains only characters '0 ' and '1 '. Print the only integer -- the number of distinct cyclical binary strings t , which contain s as a substring. In the first example, there are three cyclical strings, which contain "0" -- "00", "01" and "10". In the second example, there are only two such strings -- "1010", "0101". '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
55584815 |
_twilight |
F |
June 15, 2019, 8:53 a.m. |
OK |
GNU C++11 |
TESTS |
131 |
31 |
0 |
|
2900 |
45591884 |
liumh8 |
F |
Nov. 12, 2018, 1:01 p.m. |
OK |
GNU C++11 |
TESTS |
131 |
31 |
0 |
|
2900 |
43277883 |
YenSean |
F |
Sept. 23, 2018, 2:02 a.m. |
OK |
GNU C++11 |
TESTS |
131 |
31 |
0 |
|
2900 |
42816282 |
00zj |
F |
Sept. 13, 2018, 1:54 a.m. |
OK |
GNU C++11 |
TESTS |
131 |
31 |
0 |
|
2900 |
42723333 |
zyf0726 |
F |
Sept. 10, 2018, 4:48 a.m. |
OK |
GNU C++11 |
TESTS |
131 |
31 |
0 |
|
2900 |
42602244 |
emoairx |
F |
Sept. 7, 2018, 5:34 a.m. |
OK |
GNU C++11 |
TESTS |
131 |
31 |
0 |
|
2900 |
42601700 |
_rockdu |
F |
Sept. 7, 2018, 5:12 a.m. |
OK |
GNU C++11 |
TESTS |
131 |
31 |
0 |
|
2900 |
42597303 |
scott_wu |
F |
Sept. 7, 2018, 1:31 a.m. |
OK |
GNU C++11 |
TESTS |
131 |
31 |
0 |
|
2900 |
42594715 |
pranjal.ssh |
F |
Sept. 6, 2018, 10:20 p.m. |
OK |
GNU C++11 |
TESTS |
131 |
31 |
0 |
|
2900 |
42594176 |
ec24 |
F |
Sept. 6, 2018, 9:45 p.m. |
OK |
GNU C++11 |
TESTS |
131 |
31 |
0 |
|
2900 |
42680594 |
Minnakhmetov |
F |
Sept. 8, 2018, 4:11 p.m. |
OK |
GNU C++14 |
TESTS |
131 |
31 |
0 |
|
2900 |
42657913 |
dwt |
F |
Sept. 8, 2018, 12:57 a.m. |
OK |
GNU C++14 |
TESTS |
131 |
31 |
0 |
|
2900 |
42656679 |
RUSH_D_CAT |
F |
Sept. 7, 2018, 11:12 p.m. |
OK |
GNU C++14 |
TESTS |
131 |
31 |
0 |
|
2900 |
42613940 |
NiroBC |
F |
Sept. 7, 2018, 12:41 p.m. |
OK |
GNU C++14 |
TESTS |
131 |
31 |
0 |
|
2900 |
42611911 |
abhikalpu_123 |
F |
Sept. 7, 2018, 11:33 a.m. |
OK |
GNU C++14 |
TESTS |
131 |
31 |
0 |
|
2900 |
42601534 |
Marckess |
F |
Sept. 7, 2018, 5:05 a.m. |
OK |
GNU C++14 |
TESTS |
131 |
31 |
0 |
|
2900 |
42596116 |
shdut |
F |
Sept. 7, 2018, 12:12 a.m. |
OK |
GNU C++14 |
TESTS |
131 |
31 |
0 |
|
2900 |
42595597 |
DeshiBasara |
F |
Sept. 6, 2018, 11:24 p.m. |
OK |
GNU C++14 |
TESTS |
131 |
31 |
0 |
|
2900 |
42594599 |
abeker |
F |
Sept. 6, 2018, 10:11 p.m. |
OK |
GNU C++14 |
TESTS |
131 |
31 |
0 |
|
2900 |
43591039 |
bert30702 |
F |
Sept. 30, 2018, 1:48 a.m. |
OK |
GNU C++14 |
TESTS |
131 |
31 |
102400 |
|
2900 |
55186104 |
HirasawaaYui |
F |
June 6, 2019, 3:31 a.m. |
OK |
GNU C++17 |
TESTS |
131 |
31 |
102400 |
|
2900 |
51123685 |
Shayan.P |
F |
March 10, 2019, 10:35 a.m. |
OK |
GNU C++17 |
TESTS |
131 |
31 |
204800 |
|
2900 |
42615092 |
teapotd |
F |
Sept. 7, 2018, 1:17 p.m. |
OK |
GNU C++17 |
TESTS |
131 |
31 |
204800 |
|
2900 |
42611358 |
teapotd |
F |
Sept. 7, 2018, 11:15 a.m. |
OK |
GNU C++17 |
TESTS |
131 |
31 |
204800 |
|
2900 |
42786279 |
860579 |
F |
Sept. 12, 2018, 4:36 a.m. |
OK |
GNU C++17 |
TESTS |
131 |
31 |
307200 |
|
2900 |
44493585 |
Splashing |
F |
Oct. 18, 2018, 3:42 p.m. |
OK |
GNU C++17 |
TESTS |
131 |
31 |
409600 |
|
2900 |
42580391 |
ei133333 |
F |
Sept. 6, 2018, 4:48 p.m. |
OK |
GNU C++17 |
TESTS |
131 |
31 |
409600 |
|
2900 |
51032837 |
Smaug |
F |
March 8, 2019, 1:49 p.m. |
OK |
GNU C++17 |
TESTS |
131 |
31 |
614400 |
|
2900 |
59367237 |
bnurgeldiyev514 |
F |
Aug. 23, 2019, 5:39 p.m. |
OK |
GNU C++17 |
TESTS |
131 |
31 |
1126400 |
|
2900 |
60391763 |
Tneluccus |
F |
Sept. 11, 2019, 1:32 p.m. |
OK |
GNU C++17 |
TESTS |
131 |
31 |
1331200 |
|
2900 |
43070605 |
SolitaryWayfarer |
F |
Sept. 19, 2018, 8:57 a.m. |
OK |
Go |
TESTS |
131 |
46 |
0 |
|
2900 |
45985548 |
donli |
F |
Nov. 20, 2018, 6:14 a.m. |
OK |
Java 8 |
TESTS |
131 |
124 |
0 |
|
2900 |
68963086 |
dalt |
F |
Jan. 17, 2020, 2:50 a.m. |
OK |
Java 8 |
TESTS |
131 |
124 |
19148800 |
|
2900 |
45982431 |
donli |
F |
Nov. 20, 2018, 2:19 a.m. |
OK |
Java 8 |
TESTS |
131 |
139 |
0 |
|
2900 |
42906942 |
szawinis |
F |
Sept. 16, 2018, 3 a.m. |
OK |
Java 8 |
TESTS |
131 |
140 |
0 |
|
2900 |
45587050 |
donli |
F |
Nov. 12, 2018, 9:34 a.m. |
OK |
Java 8 |
TESTS |
131 |
280 |
77619200 |
|
2900 |
42584862 |
ecnerwala |
F |
Sept. 6, 2018, 5:13 p.m. |
OK |
PyPy 3 |
TESTS |
131 |
187 |
1433600 |
|
2900 |
remove filters
Back to search problems