Submission #59574668


Source Code Expand

Copy
a,b = map(int,input().split())
s = input()
count = 0
ans =0
for ch in s:
if ch=='O':
count+=1
else:
count=0
if count == b:
ans+=1
count=0
print(ans)
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
a,b = map(int,input().split())
s = input()
count = 0
ans =0
for ch in s:
    if ch=='O':
        count+=1
    else:
        count=0
    if count == b:
        ans+=1
        count=0

print(ans)

Submission Info

Submission Time
Task B - Strawberries
User T_Nady
Language Python (CPython 3.11.4)
Score 200
Code Size 208 Byte
Status AC
Exec Time 12 ms
Memory 8704 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 27
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt, 01_random_17.txt, 01_random_18.txt, 01_random_19.txt, 01_random_20.txt, 01_random_21.txt, 01_random_22.txt, 01_random_23.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 9 ms 8444 KB
00_sample_01.txt AC 9 ms 8520 KB
00_sample_02.txt AC 9 ms 8424 KB
01_random_00.txt AC 9 ms 8492 KB
01_random_01.txt AC 9 ms 8476 KB
01_random_02.txt AC 10 ms 8456 KB
01_random_03.txt AC 9 ms 8480 KB
01_random_04.txt AC 9 ms 8452 KB
01_random_05.txt AC 9 ms 8472 KB
01_random_06.txt AC 10 ms 8520 KB
01_random_07.txt AC 9 ms 8476 KB
01_random_08.txt AC 9 ms 8420 KB
01_random_09.txt AC 12 ms 8520 KB
01_random_10.txt AC 10 ms 8472 KB
01_random_11.txt AC 9 ms 8584 KB
01_random_12.txt AC 9 ms 8516 KB
01_random_13.txt AC 9 ms 8632 KB
01_random_14.txt AC 9 ms 8504 KB
01_random_15.txt AC 9 ms 8528 KB
01_random_16.txt AC 9 ms 8580 KB
01_random_17.txt AC 9 ms 8704 KB
01_random_18.txt AC 9 ms 8496 KB
01_random_19.txt AC 9 ms 8624 KB
01_random_20.txt AC 9 ms 8448 KB
01_random_21.txt AC 9 ms 8588 KB
01_random_22.txt AC 9 ms 8644 KB
01_random_23.txt AC 9 ms 8492 KB


2025-03-23 (Sun)
02:15:29 +00:00