Submission #82731

# Submission time Handle Problem Language Result Execution time Memory
82731 2018-11-01T13:43:08 Z heon Telefoni (COCI17_telefoni) C++11
32 / 80
35 ms 3576 KB
#include<bits/stdc++.h>

using namespace std;

int main(){
	
	ios_base::sync_with_stdio(false);
	cin.tie(0);

	int n, d;
	cin >> n >> d;
	vector <int> v(n);
	for(int i = 0; i < n; i++) cin >> v[i];
	int sol = 0, left = d - 1;
	for(int i = 1; i < n; i++, left--){
		if(!v[i] && left == 0){
			left = d;
			sol++;
		}
		else if(v[i] && left) left = d;
	}
	cout << sol;
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Correct 2 ms 472 KB Output is correct
3 Incorrect 2 ms 472 KB Output isn't correct
4 Correct 2 ms 476 KB Output is correct
5 Incorrect 2 ms 528 KB Output isn't correct
6 Incorrect 2 ms 544 KB Output isn't correct
7 Correct 2 ms 548 KB Output is correct
8 Incorrect 24 ms 2384 KB Output isn't correct
9 Incorrect 21 ms 2972 KB Output isn't correct
10 Correct 35 ms 3576 KB Output is correct