# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
231174 | Cantfindme | List of Unique Integers (FXCUP4_unique) | C++17 | 5 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>
using namespace std;
#define ll long long
typedef pair<int,int> pi;
#define f first
#define s second
#define FAST ios_base::sync_with_stdio(0); cin.tie(0);
#include "unique.h"
const int maxn = 210;
int A[maxn];
std::vector<int> PickUnique(int N) {
vector <int> v(N);
int cursum = 0;
for (int i =0;i<N;i++) {
int res = UniqueCount(0,i);
if (res == cursum+1) A[i] = 1;
cursum = res;
}
for (int i =0;i<N-1;i++) {
int res = UniqueCount(i+1,N-1);
if (A[i] and res == cursum - 1) v[i] = 1;
else v[i] = 0;
cursum = res;
}
if (A[N-1]) v[N-1] = 1;
else v[N-1] = 0;
//for (auto i: v) cout << i << " ";
return v;
//UniqueCount(0, N-1);
//UniqueCount(1, N-2);
//return std::vector<int>({0, 0, 1, 0, 0});
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |