| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 434588 | pere_gil | Comparing Plants (IOI20_plants) | C++17 | 120 ms | 6104 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "plants.h"
#include "bits/stdc++.h"
using namespace std;
vector<int> v;
vector<int> acc;
int tam;
void init(int k, std::vector<int> r) {
	v=r;
	tam=k;
	acc.push_back(v[0]);
	for(int i=1;i<v.size();i++)
		acc.push_back(acc[i-1]+v[i]);
	
	return;
}
bool op1(int l, int r){
	int aux;
	if(l<r){
		aux=acc[r-1];
		aux-=(l==0) ? 0 : acc[l-1];
		return aux==(r-l);
	}
	aux=acc.back()-acc[l-1];
	aux+=(r==0) ? 0 : acc[r-1];
	return aux==(acc.size()-l+r);
}
bool op2(int l, int r){
	int aux;
	if(l<r){
		aux=acc[r-1];
		aux-=(l==0) ? 0 : acc[l-1];
		return !aux;
	}
	aux=acc.back()-acc[l-1];
	aux+=(r==0) ? 0 : acc[r-1];
	return !aux;
}
int compare_plants(int x, int y) {
	if(op1(x,y) || op2(y,x)) return -1;
	if(op1(y,x) || op2(x,y)) return 1;
	return 0;
	
	return 0;
}
컴파일 시 표준 에러 (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... | ||||
