Submission #151628

#TimeUsernameProblemLanguageResultExecution timeMemory
151628thebesList of Unique Integers (FXCUP4_unique)C++17
100 / 100
3 ms548 KiB
#include <bits/stdc++.h> #include "unique.h" using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef vector<int> vi; #define pb push_back vi PickUnique(int N){ vi res; for(int i=0;i<N;i++) res.pb(1); int p = 0; for(int i=0;i<N;i++){ int u = UniqueCount(0,i); if(u!=p+1) res[i]=0; p = u; } p = 0; for(int i=N-1;i>=0;i--){ int u = UniqueCount(i,N-1); if(u!=p+1) res[i]=0; p = u; } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...