# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
148734 | graneli (#200) | List of Unique Integers (FXCUP4_unique) | C++17 | 5 ms | 256 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 F first
#define S second
#define mp make_pair
#define pb push_back
//#define ll __int128
#define ll long long
#define LEFT(a) ((a)<<1)
#define RIGHT(a) (LEFT(a) + 1)
#define MID(a,b) ((a+b)>>1)
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define y1 y122
using namespace std;
const int N = 1000005;
vector < int > ANS;
std::vector<int> PickUnique(int N) {
UniqueCount(0, N-1);
UniqueCount(1, N-2);
for (int i = 0; i < N; i++)
ANS.pb (1);
int num = 1;
for (int i = 1; i < N; i++){
int p = UniqueCount(0, i);
if (p <= num)
ANS[i] = 0;
num = p;
}
num = 1;
for (int i = N - 2; i >= 0; i--){
int p = UniqueCount(i, N - 1);
if (p <= num)
ANS[i] = 0;
num = p;
}
return ANS;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |