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 (i. xe2 x80 x89e. a string consisting of characters 0 and/or 1) s of length n . You can perform the following operation with the string s at most once: choose a substring (a contiguous subsequence) of s having exactly k characters 1 in it, and shuffle it (reorder the characters in the substring as you wish). Calculate the number of different strings which can be obtained from s by performing this operation at most once. The first line contains two integers n and k ( 2 <= n <= 5000 ; 0 <= k <= n ). The second line contains the string s of length n , consisting of characters 0 and/or 1. Print one integer -- the number of different strings which can be obtained from s by performing the described operation at most once. Since the answer can be large, output it modulo 998244353 . Some strings you can obtain in the first example: In the second example, k = 0 so you can only choose the substrings consisting only of 0 characters. Reordering them doesn't change the string at all, so the only string you can obtain is 10010. "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
140834806 |
dean.menezes |
D |
Dec. 27, 2021, 6:45 p.m. |
OK |
GNU C11 |
TESTS |
16 |
124 |
200806400 |
|
|
140830798 |
pseudonymous |
D |
Dec. 27, 2021, 5:54 p.m. |
OK |
GNU C++14 |
TESTS |
16 |
0 |
102400 |
|
|
140855572 |
adhirajbist |
D |
Dec. 28, 2021, 4:29 a.m. |
OK |
GNU C++14 |
TESTS |
16 |
15 |
102400 |
|
|
140854906 |
Nigu-King |
D |
Dec. 28, 2021, 4:15 a.m. |
OK |
GNU C++14 |
TESTS |
16 |
15 |
102400 |
|
|
140854236 |
XZC__Bobby |
D |
Dec. 28, 2021, 4 a.m. |
OK |
GNU C++14 |
TESTS |
16 |
15 |
102400 |
|
|
140853638 |
liuxiangbin |
D |
Dec. 28, 2021, 3:47 a.m. |
OK |
GNU C++14 |
TESTS |
16 |
15 |
102400 |
|
|
140852372 |
hieu_2004 |
D |
Dec. 28, 2021, 3:17 a.m. |
OK |
GNU C++14 |
TESTS |
16 |
15 |
102400 |
|
|
140850241 |
A_normal_OIer |
D |
Dec. 28, 2021, 2:20 a.m. |
OK |
GNU C++14 |
TESTS |
16 |
15 |
102400 |
|
|
140847773 |
slenbol |
D |
Dec. 28, 2021, 12:45 a.m. |
OK |
GNU C++14 |
TESTS |
16 |
15 |
102400 |
|
|
140858983 |
walk_alone |
D |
Dec. 28, 2021, 5:27 a.m. |
OK |
GNU C++14 |
TESTS |
16 |
15 |
102400 |
|
|
140855854 |
adhirajbist |
D |
Dec. 28, 2021, 4:35 a.m. |
OK |
GNU C++14 |
TESTS |
16 |
15 |
102400 |
|
|
140822226 |
T500 |
D |
Dec. 27, 2021, 4:40 p.m. |
OK |
GNU C++17 |
TESTS |
16 |
0 |
204800 |
|
|
140860487 |
kamalsharmaa9 |
D |
Dec. 28, 2021, 5:48 a.m. |
OK |
GNU C++17 |
TESTS |
16 |
0 |
3379200 |
|
|
140827668 |
CandyOre |
D |
Dec. 27, 2021, 5:20 p.m. |
OK |
GNU C++17 |
TESTS |
16 |
15 |
0 |
|
|
140823724 |
mouse_wireless |
D |
Dec. 27, 2021, 4:50 p.m. |
OK |
GNU C++17 |
TESTS |
16 |
15 |
0 |
|
|
140822913 |
rzy_99 |
D |
Dec. 27, 2021, 4:44 p.m. |
OK |
GNU C++17 |
TESTS |
16 |
15 |
0 |
|
|
140828494 |
CandyOre |
D |
Dec. 27, 2021, 5:29 p.m. |
OK |
GNU C++17 |
TESTS |
16 |
15 |
0 |
|
|
140859421 |
Rajneesh |
D |
Dec. 28, 2021, 5:33 a.m. |
OK |
GNU C++17 |
TESTS |
16 |
15 |
102400 |
|
|
140857398 |
null_awe |
D |
Dec. 28, 2021, 5:02 a.m. |
OK |
GNU C++17 |
TESTS |
16 |
15 |
102400 |
|
|
140855325 |
anil_1 |
D |
Dec. 28, 2021, 4:24 a.m. |
OK |
GNU C++17 |
TESTS |
16 |
15 |
102400 |
|
|
140859684 |
Rajneesh |
D |
Dec. 28, 2021, 5:37 a.m. |
OK |
GNU C++17 |
TESTS |
16 |
15 |
102400 |
|
|
140834710 |
IaMsOmEoNesOmEtHiNg |
D |
Dec. 27, 2021, 6:44 p.m. |
OK |
GNU C++17 (64) |
TESTS |
16 |
0 |
102400 |
|
|
140829086 |
fork |
D |
Dec. 27, 2021, 5:35 p.m. |
OK |
GNU C++17 (64) |
TESTS |
16 |
0 |
409600 |
|
|
140849248 |
Coki628 |
D |
Dec. 28, 2021, 1:47 a.m. |
OK |
GNU C++17 (64) |
TESTS |
16 |
15 |
102400 |
|
|
140847980 |
AlephZero01 |
D |
Dec. 28, 2021, 12:52 a.m. |
OK |
GNU C++17 (64) |
TESTS |
16 |
15 |
102400 |
|
|
140847478 |
He_Ren |
D |
Dec. 28, 2021, 12:30 a.m. |
OK |
GNU C++17 (64) |
TESTS |
16 |
15 |
102400 |
|
|
140843723 |
haengsyo |
D |
Dec. 27, 2021, 9:42 p.m. |
OK |
GNU C++17 (64) |
TESTS |
16 |
15 |
102400 |
|
|
140839604 |
Thallium54 |
D |
Dec. 27, 2021, 8 p.m. |
OK |
GNU C++17 (64) |
TESTS |
16 |
15 |
102400 |
|
|
140836511 |
tom2003 |
D |
Dec. 27, 2021, 7:08 p.m. |
OK |
GNU C++17 (64) |
TESTS |
16 |
15 |
102400 |
|
|
140832560 |
vladislav11 |
D |
Dec. 27, 2021, 6:15 p.m. |
OK |
GNU C++17 (64) |
TESTS |
16 |
15 |
102400 |
|
|
140850316 |
Mofashaoye |
D |
Dec. 28, 2021, 2:22 a.m. |
OK |
GNU C++17 (64) |
TESTS |
16 |
15 |
102400 |
|
|
140828665 |
shjohw12 |
D |
Dec. 27, 2021, 5:30 p.m. |
OK |
GNU C++20 (64) |
TESTS |
16 |
0 |
204800 |
|
|
140823054 |
dansakaiizumi |
D |
Dec. 27, 2021, 4:45 p.m. |
OK |
GNU C++20 (64) |
TESTS |
16 |
0 |
307200 |
|
|
140815332 |
qwaszxwillwinioi2022 |
D |
Dec. 27, 2021, 4:25 p.m. |
OK |
GNU C++20 (64) |
TESTS |
16 |
0 |
37068800 |
|
|
140851710 |
ArrogHie |
D |
Dec. 28, 2021, 3 a.m. |
OK |
GNU C++20 (64) |
TESTS |
16 |
15 |
0 |
|
|
140853591 |
Saarthak_10 |
D |
Dec. 28, 2021, 3:46 a.m. |
OK |
GNU C++20 (64) |
TESTS |
16 |
15 |
102400 |
|
|
140850192 |
n3k0fi5t |
D |
Dec. 28, 2021, 2:19 a.m. |
OK |
GNU C++20 (64) |
TESTS |
16 |
15 |
102400 |
|
|
140849253 |
sujoy_ghosh |
D |
Dec. 28, 2021, 1:47 a.m. |
OK |
GNU C++20 (64) |
TESTS |
16 |
15 |
102400 |
|
|
140842620 |
nebula |
D |
Dec. 27, 2021, 9:10 p.m. |
OK |
GNU C++20 (64) |
TESTS |
16 |
15 |
102400 |
|
|
140833377 |
y0g38h_kum4r |
D |
Dec. 27, 2021, 6:26 p.m. |
OK |
GNU C++20 (64) |
TESTS |
16 |
15 |
102400 |
|
|
140853868 |
Nero |
D |
Dec. 28, 2021, 3:52 a.m. |
OK |
GNU C++20 (64) |
TESTS |
16 |
15 |
102400 |
|
|
140860517 |
pqhuy98 |
D |
Dec. 28, 2021, 5:48 a.m. |
OK |
Go |
TESTS |
16 |
405 |
218726400 |
|
|
140860772 |
dofecorces |
D |
Dec. 28, 2021, 5:52 a.m. |
OK |
Haskell |
TESTS |
16 |
608 |
0 |
|
|
140839624 |
Ste |
D |
Dec. 27, 2021, 8:01 p.m. |
OK |
Java 11 |
TESTS |
16 |
171 |
0 |
|
|
140844976 |
mphillotry |
D |
Dec. 27, 2021, 10:25 p.m. |
OK |
Java 11 |
TESTS |
16 |
171 |
0 |
|
|
140841823 |
MrOtter |
D |
Dec. 27, 2021, 8:48 p.m. |
OK |
Java 11 |
TESTS |
16 |
171 |
0 |
|
|
140839382 |
Ste |
D |
Dec. 27, 2021, 7:56 p.m. |
OK |
Java 11 |
TESTS |
16 |
171 |
0 |
|
|
140850052 |
LucunJi |
D |
Dec. 28, 2021, 2:14 a.m. |
OK |
Java 11 |
TESTS |
16 |
186 |
0 |
|
|
140841194 |
NatInTheHat |
D |
Dec. 27, 2021, 8:34 p.m. |
OK |
Java 11 |
TESTS |
16 |
187 |
0 |
|
|
140834665 |
RainLiOfficial |
D |
Dec. 27, 2021, 6:43 p.m. |
OK |
Java 11 |
TESTS |
16 |
187 |
0 |
|
|
140848765 |
LucunJi |
D |
Dec. 28, 2021, 1:26 a.m. |
OK |
Java 11 |
TESTS |
16 |
202 |
0 |
|
|
140826153 |
Nicolas125841 |
D |
Dec. 27, 2021, 5:07 p.m. |
OK |
Java 11 |
TESTS |
16 |
202 |
0 |
|
|
140827288 |
Yuki_B |
D |
Dec. 27, 2021, 5:17 p.m. |
OK |
Java 11 |
TESTS |
16 |
218 |
0 |
|
|
140845764 |
smahajan54842 |
D |
Dec. 27, 2021, 10:59 p.m. |
OK |
Java 8 |
TESTS |
16 |
109 |
0 |
|
|
140823155 |
kamranm |
D |
Dec. 27, 2021, 4:46 p.m. |
OK |
Java 8 |
TESTS |
16 |
124 |
0 |
|
|
140838136 |
MagentaCobra |
D |
Dec. 27, 2021, 7:34 p.m. |
OK |
Java 8 |
TESTS |
16 |
420 |
0 |
|
|
140845524 |
ss1237 |
D |
Dec. 27, 2021, 10:49 p.m. |
OK |
Java 8 |
TESTS |
16 |
436 |
261120000 |
|
|
140823910 |
Adi_7861 |
D |
Dec. 27, 2021, 4:51 p.m. |
OK |
Java 8 |
TESTS |
16 |
623 |
2457600 |
|
|
140818698 |
AllDirections |
D |
Dec. 27, 2021, 4:31 p.m. |
OK |
MS C++ 2017 |
TESTS |
16 |
187 |
8192000 |
|
|
140847524 |
Alexey |
D |
Dec. 28, 2021, 12:32 a.m. |
OK |
Node.js |
TESTS |
16 |
280 |
68608000 |
|
|
140823023 |
1_2_3_4_5_9 |
D |
Dec. 27, 2021, 4:45 p.m. |
OK |
PyPy 2 |
TESTS |
16 |
93 |
2867200 |
|
|
140822626 |
14_15_16 |
D |
Dec. 27, 2021, 4:42 p.m. |
OK |
PyPy 2 |
TESTS |
16 |
93 |
2867200 |
|
|
140832011 |
OLOGY |
D |
Dec. 27, 2021, 6:08 p.m. |
OK |
PyPy 2 |
TESTS |
16 |
280 |
2355200 |
|
|
140833512 |
OLOGY |
D |
Dec. 27, 2021, 6:28 p.m. |
OK |
PyPy 2 |
TESTS |
16 |
296 |
3072000 |
|
|
140858119 |
Marshmello |
D |
Dec. 28, 2021, 5:14 a.m. |
OK |
PyPy 2 |
TESTS |
16 |
1310 |
55500800 |
|
|
140819444 |
mkawa2 |
D |
Dec. 27, 2021, 4:32 p.m. |
OK |
PyPy 3 |
TESTS |
16 |
93 |
2969600 |
|
|
140843364 |
unknownSolver |
D |
Dec. 27, 2021, 9:29 p.m. |
OK |
PyPy 3 |
TESTS |
16 |
108 |
2662400 |
|
|
140848090 |
whatshisbucket |
D |
Dec. 28, 2021, 12:57 a.m. |
OK |
PyPy 3 |
TESTS |
16 |
108 |
2969600 |
|
|
140829718 |
Liberator187 |
D |
Dec. 27, 2021, 5:41 p.m. |
OK |
PyPy 3 |
TESTS |
16 |
108 |
3276800 |
|
|
140829150 |
Liberator187 |
D |
Dec. 27, 2021, 5:35 p.m. |
OK |
PyPy 3 |
TESTS |
16 |
108 |
3276800 |
|
|
140826521 |
hxu10 |
D |
Dec. 27, 2021, 5:10 p.m. |
OK |
PyPy 3 |
TESTS |
16 |
108 |
9932800 |
|
|
140854377 |
hxu10 |
D |
Dec. 28, 2021, 4:03 a.m. |
OK |
PyPy 3 |
TESTS |
16 |
109 |
9932800 |
|
|
140846734 |
hxu10 |
D |
Dec. 27, 2021, 11:49 p.m. |
OK |
PyPy 3 |
TESTS |
16 |
109 |
9932800 |
|
|
140822706 |
legend.ary_as |
D |
Dec. 27, 2021, 4:43 p.m. |
OK |
PyPy 3 |
TESTS |
16 |
124 |
3891200 |
|
|
140841458 |
tan_delhi |
D |
Dec. 27, 2021, 8:40 p.m. |
OK |
PyPy 3 |
TESTS |
16 |
140 |
5222400 |
|
|
140822356 |
sbd |
D |
Dec. 27, 2021, 4:41 p.m. |
OK |
PyPy 3-64 |
TESTS |
16 |
124 |
2560000 |
|
|
140837309 |
acfinity |
D |
Dec. 27, 2021, 7:21 p.m. |
OK |
PyPy 3-64 |
TESTS |
16 |
140 |
4198400 |
|
|
140831783 |
arjasc521 |
D |
Dec. 27, 2021, 6:06 p.m. |
OK |
PyPy 3-64 |
TESTS |
16 |
140 |
4505600 |
|
|
140822740 |
_MADARA_ |
D |
Dec. 27, 2021, 4:43 p.m. |
OK |
PyPy 3-64 |
TESTS |
16 |
171 |
3379200 |
|
|
140858680 |
sakurahashu |
D |
Dec. 28, 2021, 5:23 a.m. |
OK |
PyPy 3-64 |
TESTS |
16 |
171 |
8806400 |
|
|
140823880 |
huikang |
D |
Dec. 27, 2021, 4:51 p.m. |
OK |
PyPy 3-64 |
TESTS |
16 |
233 |
12595200 |
|
|
140823378 |
jaglike_makkar |
D |
Dec. 27, 2021, 4:47 p.m. |
OK |
PyPy 3-64 |
TESTS |
16 |
248 |
7884800 |
|
|
140824215 |
jaglike_makkar |
D |
Dec. 27, 2021, 4:53 p.m. |
OK |
PyPy 3-64 |
TESTS |
16 |
249 |
7884800 |
|
|
140823907 |
jaglike_makkar |
D |
Dec. 27, 2021, 4:51 p.m. |
OK |
PyPy 3-64 |
TESTS |
16 |
249 |
7884800 |
|
|
140823543 |
jaglike_makkar |
D |
Dec. 27, 2021, 4:48 p.m. |
OK |
PyPy 3-64 |
TESTS |
16 |
280 |
7884800 |
|
|
140843649 |
agarus |
D |
Dec. 27, 2021, 9:39 p.m. |
OK |
Python 3 |
TESTS |
16 |
46 |
409600 |
|
|
140854549 |
Kal.El |
D |
Dec. 28, 2021, 4:07 a.m. |
OK |
Python 3 |
TESTS |
16 |
62 |
102400 |
|
|
140853267 |
whatshisbucket |
D |
Dec. 28, 2021, 3:39 a.m. |
OK |
Python 3 |
TESTS |
16 |
62 |
102400 |
|
|
140853061 |
whatshisbucket |
D |
Dec. 28, 2021, 3:34 a.m. |
OK |
Python 3 |
TESTS |
16 |
62 |
102400 |
|
|
140824775 |
AndreySiunov |
D |
Dec. 27, 2021, 4:57 p.m. |
OK |
Python 3 |
TESTS |
16 |
62 |
921600 |
|
|
remove filters
Back to search problems