| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1204723 | bangan | 식물 비교 (IOI20_plants) | C++20 | 0 ms | 328 KiB |
#include "plants.h"
#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 4;
int n, pre[N];
void init(int k, std::vector<int> r) {
assert(k == 2);
n = r.size();
for (int i=1; i<=n; i++) pre[i] = pre[i-1] + r[i-1];
return;
}
int compare_plants(int x, int y) {
if (x==y) return 0;
if (x<y) {
int t = pre[y]-pre[x];
if (t == y-x) return 1;
else if (!t) return -1;
else return 0;
}
else {
int t = pre[x]-pre[y];
if (!t) return 1;
else if (t == x-y) return 1;
else 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... | ||||
