Submission #148783

#TimeUsernameProblemLanguageResultExecution timeMemory
148783HSNU (#200)List of Unique Integers (FXCUP4_unique)C++17
0 / 100
5 ms384 KiB
#include "unique.h" //#define NDEBUG #include <bits/stdc++.h> #define StarBurstStream ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); #define iter(a) a.begin(), a.end() #define riter(a) a.rbegin(), a.rend() #define lsort(a) sort(iter(a)) #define gsort(a) sort(riter(a)) #define mp(a, b) make_pair(a, b) #define pb(a) push_back(a) #define pf(a) push_front(a) #define pob pop_back() #define pof pop_front() #define F first #define S second #define printv(a, b) {bool pvaspace=false; \ for(auto pva : a){ \ if(pvaspace) b << " "; pvaspace=true;\ b << pva;\ }\ b << "\n";} #define pii pair<int, int> #define pll pair<ll, ll> #define modadd(a, b) (((a % MOD) + (b % MOD)) % MOD) #define modtimes(a, b) (((a % MOD) * (b % MOD)) % MOD) //#define TEST typedef long long ll; typedef unsigned long long ull; using namespace std; const ll MOD = 1000000007; const ll MAX = 2147483647; std::vector<int> PickUnique(int N) { vector<int> ans(N); int last = UniqueCount(0, N - 1); for(int i = N - 1; i >= 1; i--){ int t = UniqueCount(0, i - 1); if(t < last) ans[i] = 1; last = t; } last = UniqueCount(0, N - 1); for(int i = 0; i < N - 1; i++){ int t = UniqueCount(i + 1, N - 1); if(t < last) ans[i] &= 1; else ans[i] = 0; last = t; } //printv(ans, cerr); return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...