Kotlin Heroes: Practice 8

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.

ContestId
Name
Phase
Frozen
Duration (Seconds)
Relative Time
Start Time
1570 Kotlin Heroes: Practice 8 FINISHED False 518400 143310323 Oct. 1, 2021, 1:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 271 ) E Erasing Zeroes PROGRAMMING *special strings

You are given a string (s). Each character is either 0 or 1 . You want all 1 's in the string to form a contiguous subsegment. For example, if the string is 0 , 1 , 00111 or 01111100 , then all 1 's form a contiguous subsegment, and if the string is 0101 , 100001 or 11111111111101 , then this condition is not met. You may erase some (possibly none) 0 's from the string. What is the minimum number of 0 's that you have to erase? The first line contains one integer (t) ((1 \le t \le 100)) — the number of test cases. Then (t) lines follow, each representing a test case. Each line contains one string (s) ((1 \le |s| \le 100)); each character of (s) is either 0 or 1 . Print (t) integers, where the (i)-th integer is the answer to the (i)-th testcase (the minimum number of 0 's that you have to erase from (s)). In the first test case you have to delete the third and forth symbols from string 010011 (it turns into 0111 ).

Tutorials

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
131019158 Kude E Oct. 6, 2021, 11:57 p.m. OK Kotlin 1.4 TESTS 7 77 20889600
130634071 dqhungdl E Oct. 3, 2021, 8:36 a.m. OK Kotlin 1.4 TESTS 7 78 20992000
130794873 f_cktorial E Oct. 4, 2021, 12:22 p.m. OK Kotlin 1.4 TESTS 7 92 20992000
130969785 Pipall E Oct. 6, 2021, 11:13 a.m. OK Kotlin 1.4 TESTS 7 93 20889600
130968260 little_angel E Oct. 6, 2021, 10:52 a.m. OK Kotlin 1.4 TESTS 7 93 20889600
130931493 henrychenOutlook E Oct. 5, 2021, 11:33 p.m. OK Kotlin 1.4 TESTS 7 93 20889600
130912154 Gompu123 E Oct. 5, 2021, 4:49 p.m. OK Kotlin 1.4 TESTS 7 93 20889600
130828609 _Muhammad E Oct. 4, 2021, 5:23 p.m. OK Kotlin 1.4 TESTS 7 93 20889600
130819117 madlogic E Oct. 4, 2021, 3:32 p.m. OK Kotlin 1.4 TESTS 7 93 20889600
130611569 __declspec E Oct. 3, 2021, 3:37 a.m. OK Kotlin 1.4 TESTS 7 93 20889600
131027077 190050045_ecm E Oct. 7, 2021, 4:04 a.m. OK Kotlin 1.5 TESTS 7 156 25190400
131011540 Simple..Boy E Oct. 6, 2021, 8:01 p.m. OK Kotlin 1.5 TESTS 7 156 25292800
130911312 yamil_21 E Oct. 5, 2021, 4:38 p.m. OK Kotlin 1.5 TESTS 7 156 25292800
130770312 ankushkhanna E Oct. 4, 2021, 7:30 a.m. OK Kotlin 1.5 TESTS 7 156 25497600
130974929 mip182 E Oct. 6, 2021, 12:13 p.m. OK Kotlin 1.5 TESTS 7 170 25292800
130742002 maxmixajlov E Oct. 3, 2021, 9:47 p.m. OK Kotlin 1.5 TESTS 7 170 25292800
130749516 Genius3435 E Oct. 4, 2021, 2:18 a.m. OK Kotlin 1.5 TESTS 7 170 25395200
130540942 MrOtter E Oct. 2, 2021, 8:28 a.m. OK Kotlin 1.5 TESTS 7 171 0
131069931 akshay101197 E Oct. 7, 2021, 1:20 p.m. OK Kotlin 1.5 TESTS 7 171 25292800
131046932 TusharBhut E Oct. 7, 2021, 8:51 a.m. OK Kotlin 1.5 TESTS 7 171 25292800

remove filters

Back to search problems