이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "plants.h"
#include<bits/stdc++.h>
using namespace std;
int n,k;
vector<int> v;
void init(int _k, std::vector<int> r) {
n = r.size();
v = r;
k = _k;
return;
}
bool between(int idx,int l,int r){
if(l<=idx&&idx<r) return 1;
if(l<=idx+n&&idx+n<r) return 1;
// cout<<idx<<' '<<l<<' '<<r<<endl;
return 0;
}
int compare_plants(int x, int y) {
if(between(y,x,x+k)){
if(v[x]==0) return 1;
else if(v[x] == k-1) return -1;
}
if(between(x,y,y+k)){
if(v[y]==0) return -1;
else if(v[y] == k-1) return 1;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |