답안 #522149

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
522149 2022-02-04T01:10:44 Z gghx Telefoni (COCI17_telefoni) C++14
16 / 80
19 ms 840 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;
    }
    else{
      count++;
      if(count==d){
        count=0;
        cur=i;
        ans++;
      }
    }
  }
  cout<<ans;

}

Compilation message

telefoni.cpp: In function 'int main()':
telefoni.cpp:10:6: warning: variable 'cur' set but not used [-Wunused-but-set-variable]
   10 |   ll cur=0,count=0,ans=0;
      |      ^~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 316 KB Output is correct
3 Incorrect 0 ms 204 KB Output isn't correct
4 Incorrect 1 ms 204 KB Output isn't correct
5 Incorrect 0 ms 316 KB Output isn't correct
6 Incorrect 0 ms 204 KB Output isn't correct
7 Incorrect 1 ms 204 KB Output isn't correct
8 Incorrect 17 ms 796 KB Output isn't correct
9 Incorrect 19 ms 840 KB Output isn't correct
10 Incorrect 18 ms 788 KB Output isn't correct