Submission #379247

#TimeUsernameProblemLanguageResultExecution timeMemory
379247huangqrList of Unique Integers (FXCUP4_unique)C++17
100 / 100
1 ms492 KiB
#include "unique.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; std::vector<int> PickUnique(int N) { vector<int>v; for(int i=0;i<N;i++)v.push_back(1); ll pre=0; for(int i=0;i<N;i++){ ll cur=UniqueCount(0,i); v[i]&=max(cur-pre,0ll); pre=cur; } pre=0; for(int i=N-1;i>=0;i--){ ll cur=UniqueCount(i,N-1); v[i]&=max(cur-pre,0ll); pre=cur; } return v; }
#Verdict Execution timeMemoryGrader output
Fetching results...