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

157/294

Solve/Submission

Ranking

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

Your feedback is our precious!



Or call +88 02 9853138 for support