Submission #100736

# Submission time Handle Problem Language Result Execution time Memory
100736 2019-03-13T20:04:39 Z dalgerok Telefoni (COCI17_telefoni) C++17
80 / 80
19 ms 1152 KB
#include<bits/stdc++.h>
using namespace std;




int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int n, d, x, cur = 0, ans = 0;
    cin >> n >> d;
    for(int i = 1; i <= n; i++){
        cin >> x;
        if(x == 0){
            cur += 1;
        }
        else{
            ans += cur / d;
            cur = 0;
        }
    }
    cout << ans;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 3 ms 384 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 2 ms 384 KB Output is correct
6 Correct 2 ms 384 KB Output is correct
7 Correct 3 ms 384 KB Output is correct
8 Correct 19 ms 896 KB Output is correct
9 Correct 19 ms 1152 KB Output is correct
10 Correct 18 ms 948 KB Output is correct