| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 884044 | vjudge1 | Telefoni (COCI17_telefoni) | C++14 | 12 ms | 3284 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define ll long long
#define S second
#define F first
#define PB push_back
#define PF push_front
const int SIZE = 1e5;
using namespace std;
int main()
{
ios_base::sync_with_stdio(0);cout.tie(0);cin.tie(0);
int a,b;
cin >> a >> b;
vector<int>V;
for(int i = 0; i < a; i++){
int x;
cin >> x;
V.PB(x);
}
int cnt = 0;
for(int i = 0; i < a-1; i++){
if(V[i+1] == 0){
bool cmp = 0;
int x = 0;
for(int j = i+ b; j > i; j--){
if(V[j] == 1){
cmp = 1;
x = j;
}
}
if(cmp){
i=x;
}
else{
i+=b;
cnt++;
}
}
}
cout<<cnt;
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
