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> ps; //anzahl kleiner zeichen
void init(int k, std::vector<int> r) {
int n=r.size();
ps.assign(n+1, 0);
for(int i=0; i<n; i++){
ps[i+1] = ps[i] + r[i];
}
}
int compare_plants(int x, int y) {
if(x<y){
int ssum = ps[y] - ps[x];
if(ssum == y-x){
return -1;
}
else if(ssum==0){
return 1;
}
else{
return 0;
}
}
else{
int ssum = ps[x] - ps[y];
if(ssum == x-y){
return 1;
}
else if(ssum==0){
return -1;
}
else{
return 0;
}
}
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... |