제출 #1132568

#제출 시각아이디문제언어결과실행 시간메모리
1132568emptypringlescanList of Unique Integers (FXCUP4_unique)C++20
100 / 100
0 ms584 KiB
#include <bits/stdc++.h>
#include "unique.h"
using namespace std;
vector<int> PickUnique(int n){
	vector<int> can(n);
	for(int i=0; i<n; i++) can[i]=1;
	int prev=0;
	for(int i=0; i<n; i++){
		int x=UniqueCount(0,i);
		if(x<=prev) can[i]=0;
		prev=x;
	}
	prev=0;
	for(int i=n-1; i>=0; i--){
		int x=UniqueCount(i,n-1);
		if(x<=prev) can[i]=0;
		prev=x;
	}
	return can;
}
#Verdict Execution timeMemoryGrader output
Fetching results...