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>
using namespace std;
vector<int> r;
int n;
void init(int k, std::vector<int> R) {
assert(k==2);
r=R;
n = R.size();
return;
}
int compare_plants(int x, int y) {
if(x>y)swap(x,y);
int one=0,zero=0;
for(int i=x;i<y;i++){
if(r[i]==1)one++;
else zero++;
}
if(zero==0)return 1;
else if(one==0)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... |