답안 #823315

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
823315 2023-08-12T10:41:30 Z Sohsoh84 식물 비교 (IOI20_plants) C++17
0 / 100
40 ms 3020 KB
#include "plants.h"
#include <bits/stdc++.h>

using namespace std;

#define debug(x)		cerr << #x << ": " << x << endl;
#define sep			' '

void add(int u, int v);

const int MAXN = 4e5 + 10;

int R[MAXN], n, k, L[MAXN];

void init(int k_, std::vector<int> r) {
	k = k_;
	n = r.size();

	for (int i = 0; i < n; i++)
		R[i] = r[i];

	L[n - 1] = 1;
	for (int i = n - 2; i >= 0; i--)
		L[i] = (R[i] == R[i + 1] ? L[i + 1] + 1 : 1);
}

int compare_plants(int x, int y) {
	if (R[x] < R[y]) return 1;
	if (R[x] > R[y]) return -1;
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Incorrect 0 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 0 ms 212 KB Output is correct
3 Incorrect 0 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 0 ms 212 KB Output is correct
3 Incorrect 0 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 0 ms 212 KB Output is correct
3 Incorrect 40 ms 3020 KB Output isn't correct
4 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 Incorrect 0 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 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Incorrect 0 ms 212 KB Output isn't correct
5 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 0 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -