Submission #149127

#TimeUsernameProblemLanguageResultExecution timeMemory
149127TLEWA맞 (#200)List of Unique Integers (FXCUP4_unique)C++17
0 / 100
5 ms256 KiB
#include "unique.h" #include <bits/stdc++.h> using namespace std; vector<int> arr; int ldp[203],rdp[203]; std::vector<int> PickUnique(int n) { for(int i=0;i<n;i++) { ldp[i]=UniqueCount(0,i); rdp[i]=UniqueCount(i,n-1); } if(ldp[n-1]-ldp[n-2]==1) arr[n-1]=1; else if(rdp[0]-rdp[1]==1) arr[0]=1; for(int i=1;i<n-1;i++) { if(ldp[i]-ldp[i-1]==1&&rdp[i]-rdp[i+1]==1) arr[i]=1; } return arr; }
#Verdict Execution timeMemoryGrader output
Fetching results...