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 <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
#define get4(a,b,c,d,...) d
#define lp3(x,a,b) for(int x=(a);x<(b);x++)
#define lp2(x,a) lp3(x,0,a)
#define lp1(a) lp2(loopvar,a)
#define lp(x...) get4(x,lp3,lp2,lp1,0)(x)
#define trv(x,S) for(auto& x:(S))
#define pb push_back
#define sz(S) (int)(S).size()
#include "plants.h"
const int mx=100;
int n;
int ord[mx];
void incr(int& x)
{
x++;
if(x==n) x=0;
}
void decr(int& x)
{
if(x==0) x=n;
x--;
}
void init(int k, vi r)
{
n=sz(r);
lp(nump,n)
{
int idx=0;
while(r[idx]!=k-1) idx++;
idx=(idx+k)%n;
while(r[idx]!=k-1) idx++;
r[idx]=0;
ord[idx]=nump;
}
return;
}
int compare_plants(int x, int y)
{
if(ord[x]>ord[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... |