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;
typedef int ll;
vector<ll>v;
ll k,a[200009],n;
void init(int K, vector<int> r)
{
v=r,n=v.size();
for(ll i=0; i<n; i++)
{
if(v[i])
a[(i+1)%n]--;
else
a[(i+1)%n]++;
}
}
int compare_plants(int x, int y)
{
if(a[x]==a[y])
return 0;
if(a[x]>a[y])
return 1;
return -1;
}
# | 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... |