DCP-496: Only '1' Substrings !! Back to All Problems

Easy String > Basic


You are given a binary string which contains only character '0' or '1'. Your task is to find total sub-strings in given string which consists of only '1'. Input: ------ Input starts with an integer **T (1<=T<=2)**, denoting the number of test cases. Each case contains a single line with binary string S, length of which do not exceed 10000. Output: ------- For each case of input, output the total count of sub-strings containing only character '1'. Sample Input ------------ 2 1001 1101 Sample Output ------------- 2 4


Problem Setter:

Bishal Gautam

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C 2.00
C++ 2.00
C++14 2.00
C# 2.00
Go 2.00
Java 2.00
JavaScript 2.00
Objective-C 2.00
Perl 2.00
PHP 2.00
Python 2.00
Python3 2.00
Ruby 2.00
VB.Net 2.00

Problem Stats

160/305

Solve/Submission

Ranking

# User Language Timing
01 Informatimukas Cpp 0.00s
02 dipta007 Cpp 0.00s
03 showmic Cpp14 0.00s
04 prodipdatta7 Cpp14 0.00s
05 Hasinur_ Cpp 0.00s
06 sakib_muhit Cpp 0.00s
07 uzzal_rahman Cpp 0.00s
08 mahbubcseju Cpp 0.00s
09 monir769 Cpp14 0.00s
10 Nobel Cpp 0.00s
11 rohijulislam Cpp 0.00s
12 Dragon_Curve Cpp 0.00s
13 Mimsad Cpp14 0.00s
14 hruday_kohli Cpp 0.00s
15 Satkhira Cpp 0.00s
16 enaim Cpp 0.00s
17 MRITuhin Cpp14 0.00s
18 Najat Cpp 0.00s
19 nahid08 Cpp 0.00s
20 Riz1ahmed Cpp 0.00s
21 DynamicOvi Cpp 0.00s
22 Bisnu039 Cpp 0.00s
23 dhruba_ Cpp 0.00s
24 rajunahidhasan0 Cpp14 0.00s
25 Masum_ice Cpp 0.00s
26 skmonirlive Cpp14 0.00s
27 mhiceiuk Cpp 0.00s
28 duronto20 Cpp 0.00s
29 snow_man Cpp 0.00s
30 Shafquat Cpp 0.00s
31 rashedul_riad Cpp 0.00s
32 farhanshahoriar Cpp 0.00s
33 hmsayem Cpp14 0.00s
34 hamza133913 Cpp 0.00s
35 computerbox Cpp 0.00s
36 feodorv C 0.00s
37 CSE1604085_nishan Cpp 0.00s
38 by_default C 0.00s
39 chinmoysaha Cpp 0.00s
40 RobinHood3082 C 0.00s
41 10102020 Cpp 0.00s
42 Mahi955 Cpp 0.01s
43 nafischonchol Cpp 0.01s
44 Bruteforcekid Cpp14 0.01s
45 grotesque Cpp 0.01s
46 Chayti_Saha98 Cpp14 0.01s
47 Rizon_sunny Cpp14 0.01s
48 1604099_ishtiaq Cpp 0.01s
49 MathProgrammer Cpp 0.01s
50 dmehedi Cpp14 0.01s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support