제출 #148732

#제출 시각아이디문제언어결과실행 시간메모리
148732Showing Hands (#200)List of Unique Integers (FXCUP4_unique)C++17
100 / 100
6 ms512 KiB
#include "unique.h" #include<bits/stdc++.h> #define sz(x) ((int)x.size()) #define pb push_back #define ii pair<int,int> #define st first #define nd second #define ll long long #define N 200005 #define inf 1000000000 #define MOD 1000000007 using namespace std; std::vector<int> PickUnique(int n) { vector<int> res(n),pre(n,0),suf(n,0); int cnt=0; for(int i=0;i<n;i++) { int nw=UniqueCount(0,i); if(nw>cnt) pre[i]=1; cnt=nw; } cnt=0; for(int i=n-1;i>=0;i--) { int nw=UniqueCount(i,n-1); if(nw>cnt) suf[i]=1; cnt=nw; } for(int i=0;i<n;i++) { res[i]=pre[i]&suf[i]; } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...