답안 #150933

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
150933 2019-09-01T12:19:15 Z nvmdava List of Unique Integers (FXCUP4_unique) C++17
100 / 100
3 ms 632 KB
#include "unique.h"
#include <bits/stdc++.h>
using namespace std;
 
vector<int> res;
int ans[204][204];
 
int get(int l, int r){
	if(l > r) return 0;
	if(ans[l][r] == -1){
		ans[l][r] = UniqueCount(l, r);
	}
	return ans[l][r];
}
 
vector<int> PickUnique(int N) {
	
	memset(ans, -1, sizeof ans);
 
	res = std::vector<int>(N, 0);
	for(int i = 0; i < N; i++){
		if(get(0, i - 1) + 1 == get(0, i) && get(i, N - 1) == get(i + 1, N - 1) + 1)
			res[i] = 1;
	}
	return res;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Correct : C = 3
2 Correct 2 ms 504 KB Correct : C = 8
3 Correct 2 ms 504 KB Correct : C = 45
4 Correct 2 ms 504 KB Correct : C = 91
5 Correct 2 ms 504 KB Correct : C = 94
6 Correct 2 ms 632 KB Correct : C = 140
7 Correct 2 ms 632 KB Correct : C = 181
8 Correct 2 ms 632 KB Correct : C = 276
9 Correct 2 ms 632 KB Correct : C = 322
10 Correct 2 ms 632 KB Correct : C = 371
11 Correct 2 ms 632 KB Correct : C = 371
12 Correct 2 ms 632 KB Correct : C = 358
13 Correct 2 ms 632 KB Correct : C = 365
14 Correct 2 ms 632 KB Correct : C = 201
15 Correct 3 ms 632 KB Correct : C = 399