답안 #768979

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
768979 2023-06-29T03:56:57 Z t6twotwo 식물 비교 (IOI20_plants) C++17
5 / 100
60 ms 8680 KB
#include "plants.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int N, K;
vector<int> R, pfs;
void init(int k, std::vector<int> r) {
	K = k, R = r; N = R.size();
	pfs.resize(N + 1);
	for (int i = 0; i < N; i++) {
		pfs[i + 1] = pfs[i] + R[i];
	}
}

int compare_plants(int x, int y) {
	if (pfs[y] - pfs[x] == 0) {
		return 1;
	}
	if (pfs[y] - pfs[x] == y - x) {
		return -1;
	}
	if (pfs[N] - pfs[y] + pfs[x] == 0) {
		return -1;
	}
	if (pfs[N] - pfs[y] + pfs[x] == N - y + x) {
		return 1;
	}
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 304 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 40 ms 4032 KB Output is correct
7 Correct 45 ms 5544 KB Output is correct
8 Correct 59 ms 8616 KB Output is correct
9 Correct 58 ms 8640 KB Output is correct
10 Correct 59 ms 8668 KB Output is correct
11 Correct 57 ms 8652 KB Output is correct
12 Correct 60 ms 8632 KB Output is correct
13 Correct 55 ms 8672 KB Output is correct
14 Correct 55 ms 8680 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Incorrect 1 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Incorrect 1 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Incorrect 1 ms 212 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 300 KB Output is correct
3 Correct 1 ms 304 KB Output is correct
4 Incorrect 0 ms 212 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 304 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 40 ms 4032 KB Output is correct
7 Correct 45 ms 5544 KB Output is correct
8 Correct 59 ms 8616 KB Output is correct
9 Correct 58 ms 8640 KB Output is correct
10 Correct 59 ms 8668 KB Output is correct
11 Correct 57 ms 8652 KB Output is correct
12 Correct 60 ms 8632 KB Output is correct
13 Correct 55 ms 8672 KB Output is correct
14 Correct 55 ms 8680 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Incorrect 1 ms 212 KB Output isn't correct
18 Halted 0 ms 0 KB -