답안 #149016

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
149016 2019-09-01T05:34:59 Z (대충 적당한 팀명)(#3621, rose0310, cos18, baikdohyup) List of Unique Integers (FXCUP4_unique) C++17
0 / 100
6 ms 384 KB
#include "unique.h"
#include <iostream>

std::vector<int> PickUnique(int N)
{
	std::vector<int> arr1, arr2;
	int front = 0, end = N - 1;
	int count = UniqueCount(0, N-1);

	while (front < N / 2) {
		front++;

		int ucount = UniqueCount(front, N-1);

		if (ucount >= count) {
			arr1.push_back(0);
		}
		else {
			arr1.push_back(1);
		}

		count = ucount;
	}

	count = UniqueCount(0, N-1);

	while (end >= N / 2) {
		end--;

		int ucount = UniqueCount(0, end);

		if (ucount >= count) {
			arr2.push_back(0);
		}
		else {
			arr2.push_back(1);
		}

		count = ucount;
	}

	while (!arr2.empty()) {
		arr1.push_back(arr2.back());
		arr2.pop_back();
	}

	return arr1;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 256 KB Correct : C = 4
2 Incorrect 5 ms 384 KB Wrong
3 Halted 0 ms 0 KB -