Submission #148712

#TimeUsernameProblemLanguageResultExecution timeMemory
148712샌즈뼈 (#200)List of Unique Integers (FXCUP4_unique)C++17
35 / 100
7 ms640 KiB
#include "unique.h" using namespace std; std::vector<int> PickUnique(int N) { vector<int> ans(N,1); int i,j,v1,v2; int cnt[211][211]={}; for (i=0;i<N;i++) for (j=i+1;j<N;j++) cnt[i][j]=UniqueCount(i,j); for (i=0;i<N;i++) { for (j=i+1;j<N;j++) { if (cnt[i][j]==0) ans[j]=0; if (cnt[i][j-1]>cnt[i][j]) ans[j]=0; } } for (i=N-1;i>=0;i--) { for (j=i-1;j>=0;j--) { if (cnt[j][i]==0) ans[j]=0; if (cnt[j+1][i]>cnt[j][i]) ans[j]=0; } } return ans; }

Compilation message (stderr)

unique.cpp: In function 'std::vector<int> PickUnique(int)':
unique.cpp:7:13: warning: unused variable 'v1' [-Wunused-variable]
     int i,j,v1,v2;
             ^~
unique.cpp:7:16: warning: unused variable 'v2' [-Wunused-variable]
     int i,j,v1,v2;
                ^~
#Verdict Execution timeMemoryGrader output
Fetching results...