| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1254887 | Joon_Yorigami | 식물 비교 (IOI20_plants) | C++20 | 93 ms | 5824 KiB |
#include "plants.h"
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vint = vector<int>;
constexpr int maxn = 200'000;
bool k2check=false;
ll pref[maxn+5];
ll n;
void init(int k, std::vector<int> r) {
k2check=true;
n=r.size();
if(k==2)
{
pref[0]=0;
for(int i=0;i<n;i++)
{
pref[i+1]=pref[i]+r[i];
}
}
return;
}
int compare_plants(int x, int y) {
if(k2check)
{
if(pref[y]-pref[x]==0 || pref[n]-pref[y]+pref[x]==n-y+x)
return 1;
else if(pref[y]-pref[x]==y-x || pref[n]-pref[y]+pref[x]==0)
return -1;
else
return 0;
}
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... | ||||
