# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
522151 | 2022-02-04T01:11:32 Z | gghx | Telefoni (COCI17_telefoni) | C++14 | 25 ms | 312 KB |
#include <bits/stdc++.h> using namespace std; #define ll long long int main(){ ios::sync_with_stdio(0); cin.tie(0); ll n,d; cin>>n>>d; ll cur=0,count=0,ans=0; for(int i=0;i<n;i++){ bool x; cin>>x; if(x==1){ cur=i; count=0; } else{ count++; if(count==d){ count=0; cur=i; ans++; } } } cout<<ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 0 ms | 204 KB | Output is correct |
3 | Correct | 0 ms | 204 KB | Output is correct |
4 | Correct | 1 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 | 21 ms | 204 KB | Output is correct |
9 | Correct | 25 ms | 304 KB | Output is correct |
10 | Correct | 18 ms | 312 KB | Output is correct |