# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
148732 | Showing Hands (#200) | List of Unique Integers (FXCUP4_unique) | C++17 | 6 ms | 512 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |