답안 #151484

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
151484 2019-09-03T11:36:32 Z leduykhongngu List of Unique Integers (FXCUP4_unique) C++17
컴파일 오류
0 ms 0 KB
#include <vector>
std::vector<int> PickUnique(int N)
{
	std::vector<int> res(N, 1);
	int preask = 1;
    for (int i = 1; i < N; ++i) {
		int ask = UniqueCount(0, i);
		if (ask <= preask) {
			res[i] = 0;
		}
		preask = ask;
	}
	preask = 1;
	for (int i = N - 2; i >= 0; --i) {
		int ask = UniqueCount(i, N - 1);
		if (ask <= preask) {
			res[i] = 0;
		}
		preask = ask;
	}
	return res;
}

Compilation message

unique.cpp: In function 'std::vector<int> PickUnique(int)':
unique.cpp:7:13: error: 'UniqueCount' was not declared in this scope
   int ask = UniqueCount(0, i);
             ^~~~~~~~~~~
unique.cpp:15:13: error: 'UniqueCount' was not declared in this scope
   int ask = UniqueCount(i, N - 1);
             ^~~~~~~~~~~