제출 #148734

#제출 시각아이디문제언어결과실행 시간메모리
148734graneli (#200)List of Unique Integers (FXCUP4_unique)C++17
0 / 100
5 ms256 KiB
#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 timeMemoryGrader output
Fetching results...