답안 #1051460

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1051460 2024-08-10T07:10:46 Z LittleOrange 식물 비교 (IOI20_plants) C++17
5 / 100
47 ms 4956 KB
#include "plants.h"
#include<bits/stdc++.h>
using namespace std;
using ll = int;
namespace{
	vector<ll> a;
	ll n;
}

void init(int k, std::vector<int> r) {
	n = r.size();
	a.resize(n+1,0);
	for(ll i = 0;i<n;i++) a[i+1] = a[i]+r[i];
}

int compare_plants(int x, int y) {
	if (a[y]-a[x]==y-x) return -1;
	if (a[y]-a[x]==0) return 1;
	if (a[n]-a[y]+a[x]==0) return -1;
	if (a[n]-a[y]+a[x]==n-y+x) return 1;
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 24 ms 3052 KB Output is correct
7 Correct 29 ms 3420 KB Output is correct
8 Correct 38 ms 4944 KB Output is correct
9 Correct 47 ms 4952 KB Output is correct
10 Correct 40 ms 4952 KB Output is correct
11 Correct 39 ms 4944 KB Output is correct
12 Correct 38 ms 4952 KB Output is correct
13 Correct 36 ms 4944 KB Output is correct
14 Correct 37 ms 4956 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Incorrect 0 ms 348 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Incorrect 0 ms 348 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 24 ms 3052 KB Output is correct
7 Correct 29 ms 3420 KB Output is correct
8 Correct 38 ms 4944 KB Output is correct
9 Correct 47 ms 4952 KB Output is correct
10 Correct 40 ms 4952 KB Output is correct
11 Correct 39 ms 4944 KB Output is correct
12 Correct 38 ms 4952 KB Output is correct
13 Correct 36 ms 4944 KB Output is correct
14 Correct 37 ms 4956 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Incorrect 0 ms 348 KB Output isn't correct
18 Halted 0 ms 0 KB -