# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
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
# | 결과 | 실행 시간 | 메모리 | 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 |