# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
723503 | vjudge1 | Telefoni (COCI17_telefoni) | C++17 | 46 ms | 2472 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define S second
#define F first
#define ll long long
#define PB push_back
#define PF push_front
using namespace std;
signed main(){
ll n,d;
ll cont = 0;
cin >> n >> d;
vector<int>V;
for(ll i = 0;i < n;i++){
ll x;
cin >> x;
V.PB(x);
}
ll pos = 0;
for(pos = 0; pos < n ;pos){
if(V[pos] == 1){
pos++;
continue;
}
else{
pos += d;
if(pos <= n && V[pos-1] != 1)
cont++;
}
}
cout << cont;
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |