Submission #148459

#TimeUsernameProblemLanguageResultExecution timeMemory
1484591 WA = 5 Push Up (#200)List of Unique Integers (FXCUP4_unique)C++17
100 / 100
6 ms512 KiB
#include "unique.h" #include <bits/stdc++.h> std::vector<int> PickUnique(int N) { std::vector<int> ret(N,1); int sav1[201], sav2[201]; for(int i = 0; i < N; i++){ sav1[i] = UniqueCount(0,i); sav2[i] = UniqueCount(i,N-1); } for(int i = 0; i < N; i++){ if(i != 0){ int v1 = sav1[i]; int v2 = sav1[i-1]; if(v1 != v2+1) ret[i] = 0; } if(i != N-1){ int v1 = sav2[i]; int v2 = sav2[i+1]; if(v1 != v2+1) ret[i] = 0; } } return ret; }
#Verdict Execution timeMemoryGrader output
Fetching results...