이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "plants.h"
#include <bits/stdc++.h>
#define mp make_pair
#define f first
#define s second
#define sz(x) (int)(x).size()
#define rsz resize
#define ins insert
#define ft front()
#define bk back()
#define pf push_front
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
int h,n,arr[200001];
void init(int k,vi r)
{
	h=k;
	n=sz(r);
	for (int i=0;i<n;i++)
	{
		arr[i]=r[i];
	}
	return;
}
int compare_plants(int x,int y)
{
	if (arr[x]==0)
	{
		int g=h-2;
		int f=x;
		while(f<y && g>=0)
		{
			f++;g--;
			if (arr[f]==0)g=h-2;
		}
		if (f==y)return 1;
	}
	else
	{
		int g=h-2;
		int f=x;
		while(f<y && g>=0)
		{
			f++;g--;
			if (arr[f]==h-1)g=h-2;
		}
		if (f==y)return -1;
	}
	if (arr[y]==h-1)
	{
		int g=h-2;
		int f=y;
		while(f<n && g>=0)
		{
			f++;g--;
			if (arr[f]==h-1)g=h-2;
		}
		if(f!=n)return 0;
		f=0;
		if (arr[f]==h-1)g=h-2;
		while(f<x && g>=0)
		{
			f++;g--;
			if (arr[f]==h-1)g=h-2;
		}
		if (f==x)return 1;
	}
	else
	{
		int g=h-2;
		int f=y;
		while(f<n && g>=0)
		{
			f++;g--;
			if (arr[f]==0)g=h-2;
		}
		if (f!=n)return 0;
		f=0;
		if (arr[f]==h-1)g=h-2;
		while(f<x && g>=0)
		{
			f++;g--;
			if (arr[f]==0)g=h-2;
		}
		if (f==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... |