| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1166004 | irmuun | 식물 비교 (IOI20_plants) | C++20 | 2 ms | 328 KiB |
#include "plants.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define all(s) s.begin(),s.end()
#define rall(s) s.rbegin(),s.rend()
int n,k;
vector<int>r,sum;
int get(int x,int y){
if(x>y) return 0;
return r[y]-(x>0?r[x-1]:0);
}
void init(int K,vector<int>R){
k=K;
r=R;
n=r.size();
sum.resize(n);
sum[0]=r[0];
for(int i=1;i<n;i++){
sum[i]=sum[i-1]+r[i];
}
}
int compare_plants(int x,int y){
if(get(x,y-1)==0) return 1;
if(get(y,n-1)==n-y&&get(0,x-1)==x) return 1;
if(get(x,y-1)==y-x) return -1;
if(get(y,n-1)==0&&get(0,x-1)==0) 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... | ||||
