제출 #1132913

#제출 시각아이디문제언어결과실행 시간메모리
1132913LCJLYList of Unique Integers (FXCUP4_unique)C++20
0 / 100
0 ms320 KiB
#include "unique.h"
#include <bits/stdc++.h>
using namespace std;
 
//#define int long long 
#define ld long double
#define show(x,y) cout << y << " " << #x << endl;
#define show2(x,y,i,j) cout << y << " " << #x << "  " << j << " " << #i << endl;
#define show3(x,y,i,j,p,q) cout << y << " " << #x << "  " << j << " " << #i << "  " << q << " " << #p << endl;
#define show4(x,y) for(auto it:y) cout << it << " "; cout << #x << endl;
typedef pair<int,int>pii;
typedef pair<int,pii>pi2;
mt19937_64 rng(chrono::system_clock::now().time_since_epoch().count());

//UniqueCount

vector<int> PickUnique(int n) {
	vector<int>v;
	int prefix[n];
	int suffix[n];
	for(int x=0;x<n;x++){
		prefix[x]=UniqueCount(0,x);
		suffix[x]=UniqueCount(x,n-1);
	}
	
	for(int x=0;x<n;x++){
		bool amos=true;
		if(x>0&&prefix[x]==prefix[x-1]) amos=false;
		if(x<n-1&&suffix[x]==suffix[x+1]) amos=false;
		v.push_back(amos);
	}
	return v;
}
#Verdict Execution timeMemoryGrader output
Fetching results...