# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
247089 | errorgorn | 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 <bits/stdc++.h>
#include "unique.h"
using namespace std;
#define rep(x,s,e) for (auto x=s-(s>e);x!=e-(s>e);(s<e?x++:x--))
std::vector<int> PickUnique(int n) {
vector<int> res;
rep(x,0,n){
res.push_back(1);
}
int p=1,c;
rep(x,1,n){
c=UniqueCount(0,x);
if (p>=c) res[x]=0;
p=c;
}
p=1;
rep(x,n-1,0){
c=UniqueCount(x,n-1);
if (p>=c) res[x]=0;
p=c;
}
//rep(x,0,n) cout<<res[x]<<" ";cout<<endl;
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |