Rating changes for last rounds are temporarily rolled back. They will be returned soon. ×

 
 
 
 
General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
84039536 Practice:
Nesta
1367C - 21 C++17 (GCC 7-32) Accepted 93 ms 8 KB 2020-06-17 08:43:31 2020-06-17 12:04:50
→ Source
#include<bits/stdc++.h>

using namespace std;

int main()
{
    int t;
    cin>>t;
    while(t--){
        int n,k;
        cin>>n>>k;
        int cnt=k,ans=0;
        for(int i=0;i<n;i++){
            char a;
            cin>>a;
            if(a=='0')cnt++;
            else{
                ans+=(cnt-k)/(k+1);
                cnt=0;
            }
        }
        ans+=cnt/(k+1);
        cout<<ans<<endl;
    }
    return 0;
}
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details