Submission #762364

#TimeUsernameProblemLanguageResultExecution timeMemory
762364goodbyehanbyeolList of Unique Integers (FXCUP4_unique)C++17
100 / 100
1 ms468 KiB
#include "unique.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; vector<int> PickUnique(int n){ vector<int> ret(n, 1); vector<int> a(n), b(n); for(int i=0; i<n; i++){ a[i] = UniqueCount(0, i); if(i && a[i] != a[i-1] + 1) ret[i] = 0; } for(int i=n-1; i>=0; i--){ b[i] = UniqueCount(i, n-1); if(i<n-1 && b[i] != b[i+1] + 1) ret[i] = 0; } return ret; }
#Verdict Execution timeMemoryGrader output
Fetching results...