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"
using namespace std;
int pref[200005],n;
void init(int k,vector<int> r){
n=r.size();
for(int i=0;i<n+3;i++)pref[i]=0;
for(int i=0;i<n;i++)pref[i+1]=pref[i]+r[i];
}
int compare_plants(int x, int y){
if(pref[y]-pref[x]==0)return 1;
else if(pref[y]-pref[x]==y-x)return -1;
else if(pref[n]-pref[y]-pref[x]==0)return -1;
else if(pref[n]-pref[y]-pref[x]==n-y+x)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... |