# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
814694 | vjudge1 | Comparing Plants (IOI20_plants) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "plants.h"
#include <bits/stdc++.h>
#include "grader.cpp"
using namespace std;
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<long long, long long> pll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<long long> vl;
int n, K;
vi cmp;
void init(int k, vector<int> r) {
n = (int)r.size();
K = k;
cmp = r;
}
int compare_plants(int x, int y) {
if(K == 2){
if(abs(x-y) > 1)
return 0;
if(x > y){
if(cmp[y] == 1) return -1;
else return 1;
}
else{
if(cmp[x] == 1) return -1;
else return 1;
}
}
}