답안 #153732

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
153732 2019-09-15T14:45:32 Z bogdan_buzatu Telefoni (COCI17_telefoni) C++14
80 / 80
78 ms 2084 KB
#include <iostream>
#include <algorithm>

using namespace std;
int n,v[500100],l=0,nr=0,k;

int main(){
    cin>>n>>k;
    for(int i=1;i<=n;i++){
        cin>>v[i];

    }
    for(int i=1;i<=n;i++){
        if(v[i]==0){
            l++;
        }
        else{
            if(l>=k){
                nr+=l/k;
            }
            l=0;
        }
    }
    cout<<nr;


}
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 376 KB Output is correct
2 Correct 3 ms 376 KB Output is correct
3 Correct 3 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 2 ms 256 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 78 ms 2084 KB Output is correct
9 Correct 78 ms 2012 KB Output is correct
10 Correct 77 ms 2040 KB Output is correct