답안 #521300

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
521300 2022-02-01T14:27:08 Z chaoyue Telefoni (COCI17_telefoni) C++17
80 / 80
14 ms 844 KB
#include <bits/stdc++.h>
using namespace std;

#define ll long long

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n, d, x, dist=0, cnt=0;
	cin>>n>>d;
	for(int i=0; i<n; i++){
		cin>>x;
		if(x){
			dist = 0;
		}
		else{
			dist++;
			if(dist >= d){
				dist = 0;
				cnt++;
			}
		}
	}
	cout<<cnt;
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 14 ms 800 KB Output is correct
9 Correct 13 ms 784 KB Output is correct
10 Correct 13 ms 844 KB Output is correct