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 (each character of this string is either 0 or 1). Let's denote the cost of string t as the number of occurences of s in t. For example, if s is 11 and t is 111011, then the cost of t is 3. Let's also denote the Fibonacci strings sequence as follows: Your task is to calculate the sum of costs of all subsequences of the string F(x). Since answer may be large, calculate it modulo 109 xe2 x80 x89+ xe2 x80 x897. The first line contains two integers n and x (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89100, 0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89x xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89100) -- the length of s and the index of a Fibonacci string you are interested in, respectively. The second line contains s -- a string consisting of n characters. Each of these characters is either 0 or 1. Print the only integer -- the sum of costs of all subsequences of the string F(x), taken modulo 109 xe2 x80 x89+ xe2 x80 x897. "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
38202930 |
__ShaW |
F |
May 14, 2018, 12:40 a.m. |
OK |
FPC |
TESTS |
58 |
405 |
11264000 |
|
2500 |
36428446 |
scauweng |
F |
March 20, 2018, 9:02 a.m. |
OK |
GNU C++ |
TESTS |
58 |
156 |
14438400 |
|
2500 |
36020426 |
zjo_2001 |
F |
March 6, 2018, 4:55 p.m. |
OK |
GNU C++ |
TESTS |
58 |
187 |
6758400 |
|
2500 |
38453113 |
vjudge4 |
F |
May 20, 2018, 8:50 a.m. |
OK |
GNU C++ |
TESTS |
58 |
187 |
12800000 |
|
2500 |
36296173 |
luogu_bot3 |
F |
March 15, 2018, 10:48 a.m. |
OK |
GNU C++ |
TESTS |
58 |
202 |
6758400 |
|
2500 |
36296063 |
luogu_bot1 |
F |
March 15, 2018, 10:44 a.m. |
OK |
GNU C++ |
TESTS |
58 |
202 |
6758400 |
|
2500 |
36522500 |
yasugongshang |
F |
March 23, 2018, 6:46 a.m. |
OK |
GNU C++ |
TESTS |
58 |
217 |
8499200 |
|
2500 |
36467884 |
qiqi20021026 |
F |
March 22, 2018, 2:50 a.m. |
OK |
GNU C++ |
TESTS |
58 |
217 |
17408000 |
|
2500 |
36074279 |
zjo_2001 |
F |
March 8, 2018, 2:34 p.m. |
OK |
GNU C++ |
TESTS |
58 |
218 |
7270400 |
|
2500 |
36570980 |
vjudge5 |
F |
March 24, 2018, 10:30 a.m. |
OK |
GNU C++ |
TESTS |
58 |
249 |
9113600 |
|
2500 |
37566526 |
vjudge4 |
F |
April 24, 2018, 8:04 a.m. |
OK |
GNU C++ |
TESTS |
58 |
280 |
4096000 |
|
2500 |
68013165 |
rainboy |
F |
Dec. 31, 2019, 4:55 p.m. |
OK |
GNU C11 |
TESTS |
58 |
202 |
4198400 |
|
2500 |
44524177 |
yukuai26 |
F |
Oct. 19, 2018, midnight |
OK |
GNU C++11 |
TESTS |
58 |
124 |
5120000 |
|
2500 |
45090546 |
liumh8 |
F |
Oct. 30, 2018, 9:21 a.m. |
OK |
GNU C++11 |
TESTS |
58 |
156 |
4710400 |
|
2500 |
36019626 |
lzr_010506 |
F |
March 6, 2018, 4:49 p.m. |
OK |
GNU C++11 |
TESTS |
58 |
156 |
7372800 |
|
2500 |
36053875 |
zdw1999 |
F |
March 7, 2018, 6:37 p.m. |
OK |
GNU C++11 |
TESTS |
58 |
171 |
11366400 |
|
2500 |
36681249 |
Exbilar |
F |
March 28, 2018, 12:48 a.m. |
OK |
GNU C++11 |
TESTS |
58 |
171 |
112025600 |
|
2500 |
42193637 |
fks20011206 |
F |
Aug. 28, 2018, 5:02 a.m. |
OK |
GNU C++11 |
TESTS |
58 |
187 |
4608000 |
|
2500 |
42193643 |
luogu_bot5 |
F |
Aug. 28, 2018, 5:03 a.m. |
OK |
GNU C++11 |
TESTS |
58 |
187 |
4608000 |
|
2500 |
50706756 |
vjudge4 |
F |
March 3, 2019, 4:39 a.m. |
OK |
GNU C++11 |
TESTS |
58 |
187 |
4710400 |
|
2500 |
38529068 |
jslijin |
F |
May 22, 2018, 8:48 a.m. |
OK |
GNU C++11 |
TESTS |
58 |
187 |
9625600 |
|
2500 |
38009198 |
emoairx |
F |
May 8, 2018, 1:21 a.m. |
OK |
GNU C++11 |
TESTS |
58 |
187 |
12800000 |
|
2500 |
55995601 |
Wechselhau |
F |
June 24, 2019, 10:13 a.m. |
OK |
GNU C++14 |
TESTS |
58 |
124 |
10137600 |
|
2500 |
37103516 |
NewSession |
F |
April 8, 2018, 3:38 p.m. |
OK |
GNU C++14 |
TESTS |
58 |
140 |
8806400 |
|
2500 |
36124295 |
Georgia_001 |
F |
March 9, 2018, 4:51 p.m. |
OK |
GNU C++14 |
TESTS |
58 |
155 |
6553600 |
|
2500 |
36028684 |
trollinullp |
F |
March 6, 2018, 9:53 p.m. |
OK |
GNU C++14 |
TESTS |
58 |
156 |
6553600 |
|
2500 |
36028761 |
trollinullp |
F |
March 6, 2018, 9:58 p.m. |
OK |
GNU C++14 |
TESTS |
58 |
156 |
7270400 |
|
2500 |
38105653 |
Zxyelf |
F |
May 11, 2018, 5:06 a.m. |
OK |
GNU C++14 |
TESTS |
58 |
156 |
8294400 |
|
2500 |
36036134 |
ThePontiacBandit |
F |
March 7, 2018, 7:48 a.m. |
OK |
GNU C++14 |
TESTS |
58 |
156 |
11161600 |
|
2500 |
36017713 |
halyavin |
F |
March 6, 2018, 4:35 p.m. |
OK |
GNU C++14 |
TESTS |
58 |
171 |
6553600 |
|
2500 |
36028229 |
trollinullp |
F |
March 6, 2018, 9:21 p.m. |
OK |
GNU C++14 |
TESTS |
58 |
171 |
6553600 |
|
2500 |
36017603 |
Edgration. |
F |
March 6, 2018, 4:34 p.m. |
OK |
GNU C++14 |
TESTS |
58 |
171 |
8089600 |
|
2500 |
40968275 |
ReaLNero1 |
F |
July 30, 2018, 12:15 p.m. |
OK |
GNU C++17 |
TESTS |
58 |
78 |
4608000 |
|
2500 |
36023565 |
greencis |
F |
March 6, 2018, 5:40 p.m. |
OK |
GNU C++17 |
TESTS |
58 |
78 |
6553600 |
|
2500 |
39182936 |
hicodeworld |
F |
June 12, 2018, 7:02 a.m. |
OK |
GNU C++17 |
TESTS |
58 |
187 |
8499200 |
|
2500 |
41322379 |
LeBlanc |
F |
Aug. 8, 2018, 2:18 a.m. |
OK |
GNU C++17 |
TESTS |
58 |
187 |
9830400 |
|
2500 |
66220075 |
SlowDecay |
F |
Dec. 3, 2019, 10:30 a.m. |
OK |
GNU C++17 |
TESTS |
58 |
218 |
9318400 |
|
2500 |
36667500 |
Rose_max |
F |
March 27, 2018, 12:28 p.m. |
OK |
GNU C++17 |
TESTS |
58 |
218 |
14233600 |
|
2500 |
65121730 |
kataki |
F |
Nov. 16, 2019, 1:58 a.m. |
OK |
GNU C++17 |
TESTS |
58 |
264 |
9318400 |
|
2500 |
59673514 |
chuducanhchy |
F |
Aug. 29, 2019, 5:07 p.m. |
OK |
GNU C++17 |
TESTS |
58 |
265 |
10649600 |
|
2500 |
37729863 |
yswdra |
F |
April 29, 2018, 5:28 p.m. |
OK |
GNU C++17 |
TESTS |
58 |
280 |
3686400 |
|
2500 |
40211769 |
xsc |
F |
July 11, 2018, 8:46 p.m. |
OK |
GNU C++17 |
TESTS |
58 |
280 |
4608000 |
|
2500 |
68013164 |
Dukkha |
F |
Dec. 31, 2019, 4:55 p.m. |
OK |
Java 11 |
TESTS |
58 |
514 |
0 |
|
2500 |
36048321 |
Dreamchaser101 |
F |
March 7, 2018, 2:47 p.m. |
OK |
Java 8 |
TESTS |
58 |
452 |
27443200 |
|
2500 |
36035166 |
Mosquito_ |
F |
March 7, 2018, 7:04 a.m. |
OK |
Java 8 |
TESTS |
58 |
482 |
27443200 |
|
2500 |
38084691 |
Ahmad |
F |
May 10, 2018, 4:28 a.m. |
OK |
Java 8 |
TESTS |
58 |
779 |
21401600 |
|
2500 |
37080395 |
iamavalon |
F |
April 7, 2018, 7:54 p.m. |
OK |
Java 8 |
TESTS |
58 |
889 |
27648000 |
|
2500 |
36237053 |
dalt |
F |
March 13, 2018, 1:16 a.m. |
OK |
Java 8 |
TESTS |
58 |
1279 |
99020800 |
|
2500 |
36026119 |
AkshajK |
F |
March 6, 2018, 7:10 p.m. |
OK |
Java 8 |
TESTS |
58 |
2449 |
40345600 |
|
2500 |
36021516 |
wawawa1998 |
F |
March 6, 2018, 5:02 p.m. |
OK |
MS C++ |
TESTS |
58 |
1092 |
6451200 |
|
2500 |
63764166 |
EDawn |
F |
Oct. 30, 2019, 5:29 a.m. |
OK |
MS C++ 2017 |
TESTS |
58 |
312 |
10649600 |
|
2500 |
remove filters
Back to search problems