# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
230551 | syy | 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 "unique.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define FOR(i, a, b) for(int i = (int)a; i <= (int)b; i++)
#define DEC(i, a, b) for(int i = (int)a; i >= (int)b; i--)
typedef pair<int, int> pi;
#define f first
#define s second
#define pb push_back
#define all(v) v.begin(), v.end()
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
int pre[205], suf[205];
vector<int> PickUnique(int n) {
FOR(i, 0, n-1) {
pre[i] = UniqueCount(0, i);
suf[i] = UniqueCount(i, n-1);
}
vector<int> res(n, 0);
if (suf[0] > suf[1]) res[0] = 1;
if (pre[n-2] < pre[n-1]) res[n-1] = 1;
FOR(i, 1, n-2) {
if (pre[i-1] < pre[i] and suf[i] > suf[i+1]) res[i] = 1;
}
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |