# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1048525 | IUA_Hasin | Comparing Plants (IOI20_plants) | C++17 | 1 ms | 688 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>
#define ll long long
using namespace std;
ll a, n;
vector<ll> arr;
void init(int k, std::vector<int> r) {
a = k;
n = r.size();
for(int i=0; i<r.size(); i++){
arr.push_back(r[i]);
}
return;
}
int compare_plants(int x, int y) {
ll temp = arr[x];
ll temp2 = arr[y];
if(y==n-1){
if(x==0){
if(temp2>0){
return -1;
} else {
return 1;
}
} else {
return 0;
}
} else {
if(y==x+1){
if(temp>0){
return 1;
} else {
return -1;
}
} else {
return 0;
}
}
}
Compilation message (stderr)
# | 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... |