답안 #429415

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
429415 2021-06-15T23:07:26 Z JUANDI321 식물 비교 (IOI20_plants) C++17
5 / 100
103 ms 7916 KB
#include "plants.h"
#include <vector>
#include <iostream>
 
using namespace std;
int l[200100];
int n;
void init(int k, vector<int> r) 
{
	int nn = r.size();
	n = nn;
	l[0] = 200100;
	for(int i = 0; i<n; i++)
	{
		if(r[i] == 1)l[i+1] = l[i] + 1;
		else l[i+1] = l[i] - 1;
	}
	return;
}
 
int compare_plants(int x, int y) 
{
	if( y-x == l[y]-l[x])return -1;
	if( y-x == -1 *(l[y]-l[x]))return 1;
	if( n-y + x == l[n]-l[y] + l[x] - l[0])return 1;
	if( n-y + x == -1*(l[n]-l[y] + l[x] - l[0]))return -1;
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 304 KB Output is correct
6 Correct 57 ms 4048 KB Output is correct
7 Correct 68 ms 5404 KB Output is correct
8 Correct 93 ms 7880 KB Output is correct
9 Correct 93 ms 7904 KB Output is correct
10 Correct 92 ms 7780 KB Output is correct
11 Correct 89 ms 7916 KB Output is correct
12 Correct 103 ms 7900 KB Output is correct
13 Correct 85 ms 7876 KB Output is correct
14 Correct 83 ms 7876 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Incorrect 1 ms 204 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Incorrect 1 ms 204 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Incorrect 1 ms 204 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 312 KB Output is correct
4 Incorrect 1 ms 204 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 304 KB Output is correct
6 Correct 57 ms 4048 KB Output is correct
7 Correct 68 ms 5404 KB Output is correct
8 Correct 93 ms 7880 KB Output is correct
9 Correct 93 ms 7904 KB Output is correct
10 Correct 92 ms 7780 KB Output is correct
11 Correct 89 ms 7916 KB Output is correct
12 Correct 103 ms 7900 KB Output is correct
13 Correct 85 ms 7876 KB Output is correct
14 Correct 83 ms 7876 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 204 KB Output is correct
17 Incorrect 1 ms 204 KB Output isn't correct
18 Halted 0 ms 0 KB -