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'Koa the Koala has a binary string s of length n . Koa can perform no more than n-1 (possibly zero) operations of the following form: In one operation Koa selects positions i and i+1 for some i with 1 <= i < |s| and sets s_i to max(s_i, s_{i+1}) . Then Koa deletes position i+1 from s (after the removal, the remaining parts are concatenated). Note that after every operation the length of s decreases by 1 . How many different binary strings can Koa obtain by doing no more than n-1 (possibly zero) operations modulo 10^9+7 ( 1000000007 )? The only line of input contains binary string s ( 1 <= |s| <= 10^6 ). For all i ( 1 <= i <= |s| ) s_i = 0 or s_i = 1 . On a single line print the answer to the problem modulo 10^9+7 ( 1000000007 ). In the first sample Koa can obtain binary strings: 0 , 00 and 000 . In the second sample Koa can obtain binary strings: 1 , 01 , 11 , 011 , 101 and 0101 . For example: Parentheses denote the two positions Koa selected in each operation. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
87913618 |
hos.lyric |
E |
July 24, 2020, 4:07 p.m. |
OK |
D |
TESTS |
84 |
93 |
42393600 |
|
|
87936587 |
rainboy |
E |
July 24, 2020, 7:05 p.m. |
OK |
GNU C11 |
TESTS |
84 |
78 |
24985600 |
|
|
91010527 |
mwlc |
E |
Aug. 26, 2020, 2:14 a.m. |
OK |
GNU C++11 |
TESTS |
85 |
46 |
8806400 |
|
|
89853821 |
duyanh1704 |
E |
Aug. 14, 2020, 8:22 a.m. |
OK |
GNU C++11 |
TESTS |
85 |
46 |
9625600 |
|
|
87950396 |
LMOliver |
E |
July 25, 2020, 2:04 a.m. |
OK |
GNU C++11 |
TESTS |
84 |
46 |
12902400 |
|
|
91564647 |
ws_zzyer |
E |
Sept. 1, 2020, 12:27 p.m. |
OK |
GNU C++11 |
TESTS |
85 |
46 |
13004800 |
|
|
87920236 |
RNS_KSB |
E |
July 24, 2020, 4:25 p.m. |
OK |
GNU C++11 |
TESTS |
84 |
46 |
15257600 |
|
|
88269024 |
littlelittlehorse |
E |
July 29, 2020, 9:01 a.m. |
OK |
GNU C++11 |
TESTS |
85 |
46 |
16896000 |
|
|
88090392 |
emoairx |
E |
July 27, 2020, 12:39 a.m. |
OK |
GNU C++11 |
TESTS |
85 |
46 |
16896000 |
|
|
88718684 |
wwt15 |
E |
Aug. 2, 2020, 9:26 a.m. |
OK |
GNU C++11 |
TESTS |
85 |
46 |
16896000 |
|
|
88764015 |
frodakcin |
E |
Aug. 2, 2020, 11:58 p.m. |
OK |
GNU C++11 |
TESTS |
85 |
46 |
20787200 |
|
|
89529172 |
luogu_bot2 |
E |
Aug. 10, 2020, 6:11 p.m. |
OK |
GNU C++11 |
TESTS |
85 |
46 |
20889600 |
|
|
88023696 |
SoiMae |
E |
July 26, 2020, 2:41 a.m. |
OK |
GNU C++14 |
TESTS |
84 |
46 |
8704000 |
|
|
90844588 |
lavenderwithbluish |
E |
Aug. 24, 2020, 4:31 p.m. |
OK |
GNU C++14 |
TESTS |
85 |
46 |
9011200 |
|
|
87912176 |
ccf_n0i |
E |
July 24, 2020, 4:03 p.m. |
OK |
GNU C++14 |
TESTS |
84 |
46 |
10035200 |
|
|
88857049 |
schtomi97 |
E |
Aug. 4, 2020, 9:09 a.m. |
OK |
GNU C++14 |
TESTS |
85 |
46 |
10342400 |
|
|
88106256 |
Rubblsh12345 |
E |
July 27, 2020, 7:36 a.m. |
OK |
GNU C++14 |
TESTS |
85 |
46 |
12800000 |
|
|
91567161 |
yhx-12243 |
E |
Sept. 1, 2020, 1:02 p.m. |
OK |
GNU C++14 |
TESTS |
85 |
46 |
13004800 |
|
|
88531913 |
ashish_vaghani |
E |
July 30, 2020, 6:17 p.m. |
OK |
GNU C++14 |
TESTS |
85 |
46 |
13619200 |
|
|
88271145 |
tyakennikku |
E |
July 29, 2020, 9:28 a.m. |
OK |
GNU C++14 |
TESTS |
85 |
46 |
14643200 |
|
|
89208726 |
nealchen |
E |
Aug. 7, 2020, 1:45 p.m. |
OK |
GNU C++14 |
TESTS |
85 |
46 |
15052800 |
|
|
89567545 |
Blue233333Weak |
E |
Aug. 11, 2020, 10:08 a.m. |
OK |
GNU C++14 |
TESTS |
85 |
46 |
16793600 |
|
|
88302994 |
Ra16bit |
E |
July 29, 2020, 2:42 p.m. |
OK |
GNU C++17 |
TESTS |
85 |
46 |
8806400 |
|
|
90760889 |
two_sides |
E |
Aug. 23, 2020, 1:54 p.m. |
OK |
GNU C++17 |
TESTS |
85 |
46 |
9318400 |
|
|
87992766 |
fedoseev.timofey |
E |
July 25, 2020, 2:11 p.m. |
OK |
GNU C++17 |
TESTS |
84 |
46 |
9318400 |
|
|
88066605 |
gjy5885 |
E |
July 26, 2020, 3:05 p.m. |
OK |
GNU C++17 |
TESTS |
85 |
46 |
9523200 |
|
|
87883167 |
tourist |
E |
July 24, 2020, 2:59 p.m. |
OK |
GNU C++17 |
TESTS |
84 |
46 |
13619200 |
|
|
90214289 |
Mr_Mafia |
E |
Aug. 17, 2020, 9:37 a.m. |
OK |
GNU C++17 |
TESTS |
85 |
46 |
13619200 |
|
|
87937763 |
Tom_N_Jerry |
E |
July 24, 2020, 7:26 p.m. |
OK |
GNU C++17 |
TESTS |
84 |
46 |
13619200 |
|
|
87926260 |
Shayan.P |
E |
July 24, 2020, 5:05 p.m. |
OK |
GNU C++17 |
TESTS |
84 |
46 |
14336000 |
|
|
87924527 |
Farhod_Farmon |
E |
July 24, 2020, 4:34 p.m. |
OK |
GNU C++17 |
TESTS |
84 |
46 |
15667200 |
|
|
88652067 |
Andreasyan |
E |
Aug. 1, 2020, 9:40 a.m. |
OK |
GNU C++17 |
TESTS |
85 |
46 |
16793600 |
|
|
88205095 |
Kuroni |
E |
July 28, 2020, 12:55 p.m. |
OK |
GNU C++17 (64) |
TESTS |
85 |
46 |
6451200 |
|
|
87913530 |
natsugiri |
E |
July 24, 2020, 4:07 p.m. |
OK |
GNU C++17 (64) |
TESTS |
84 |
46 |
9318400 |
|
|
89486834 |
hitonanode |
E |
Aug. 10, 2020, 6:49 a.m. |
OK |
GNU C++17 (64) |
TESTS |
85 |
46 |
9932800 |
|
|
88159560 |
hello_codeforces |
E |
July 27, 2020, 9:31 p.m. |
OK |
GNU C++17 (64) |
TESTS |
85 |
46 |
10444800 |
|
|
88173018 |
Marckess |
E |
July 28, 2020, 5:21 a.m. |
OK |
GNU C++17 (64) |
TESTS |
85 |
46 |
10444800 |
|
|
87909445 |
teapotd |
E |
July 24, 2020, 3:56 p.m. |
OK |
GNU C++17 (64) |
TESTS |
84 |
46 |
10444800 |
|
|
87899729 |
majk |
E |
July 24, 2020, 3:32 p.m. |
OK |
GNU C++17 (64) |
TESTS |
84 |
46 |
11468800 |
|
|
88014810 |
keko37 |
E |
July 25, 2020, 8:34 p.m. |
OK |
GNU C++17 (64) |
TESTS |
84 |
46 |
11468800 |
|
|
87966430 |
dario2994 |
E |
July 25, 2020, 7:15 a.m. |
OK |
GNU C++17 (64) |
TESTS |
84 |
46 |
13516800 |
|
|
88702527 |
user202729_ |
E |
Aug. 2, 2020, 4:15 a.m. |
OK |
GNU C++17 (64) |
TESTS |
85 |
46 |
13721600 |
|
|
87953524 |
mphillotry |
E |
July 25, 2020, 3:15 a.m. |
OK |
Java 11 |
TESTS |
84 |
233 |
37376000 |
|
|
88111624 |
PizzaLovers007 |
E |
July 27, 2020, 8:56 a.m. |
OK |
Java 11 |
TESTS |
85 |
264 |
48537600 |
|
|
87923486 |
uwi |
E |
July 24, 2020, 4:32 p.m. |
OK |
Java 11 |
TESTS |
84 |
420 |
57446400 |
|
|
87958675 |
O__________O |
E |
July 25, 2020, 5:01 a.m. |
OK |
PyPy 2 |
TESTS |
84 |
140 |
37376000 |
|
|
87932561 |
pajenegod |
E |
July 24, 2020, 6:07 p.m. |
OK |
PyPy 2 |
TESTS |
84 |
156 |
34201600 |
|
|
88895831 |
mat_v |
E |
Aug. 4, 2020, 6:12 p.m. |
OK |
PyPy 3 |
TESTS |
85 |
280 |
36864000 |
|
|
87935188 |
sh1194 |
E |
July 24, 2020, 6:43 p.m. |
OK |
PyPy 3 |
TESTS |
84 |
436 |
66150400 |
|
|
87926467 |
pineriver |
E |
July 24, 2020, 5:06 p.m. |
OK |
PyPy 3 |
TESTS |
84 |
436 |
66150400 |
|
|
87935292 |
sh1194 |
E |
July 24, 2020, 6:45 p.m. |
OK |
PyPy 3 |
TESTS |
84 |
483 |
66150400 |
|
|
88154272 |
r57shell |
E |
July 27, 2020, 7:09 p.m. |
OK |
PyPy 3 |
TESTS |
85 |
624 |
85504000 |
|
|
87937034 |
chinerist |
E |
July 24, 2020, 7:12 p.m. |
OK |
PyPy 3 |
TESTS |
84 |
685 |
124928000 |
|
|
87932693 |
chinerist |
E |
July 24, 2020, 6:09 p.m. |
OK |
PyPy 3 |
TESTS |
84 |
998 |
113664000 |
|
|
87921560 |
ngtkana |
E |
July 24, 2020, 4:28 p.m. |
OK |
Rust |
TESTS |
84 |
155 |
36659200 |
|
|
remove filters
Back to search problems