# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
148945 | 2019-09-01T05:26:11 Z | 샌즈뼈(#3582, exqt, esselem) | List of Unique Integers (FXCUP4_unique) | C++17 | 6 ms | 512 KB |
#include "unique.h" using namespace std; std::vector<int> PickUnique(int N) { vector<int> ans(N,0); int i,j,v1,v2; int base = UniqueCount(0,N-1); int f[211]={}; v1=base; for (i=1;i<N-1;i++) { v2=UniqueCount(i,N-1); if (v1>v2) f[i-1]++; v1=v2; } if (v1==2) f[N-2]++; v1=base; for (i=N-2;i>=1;i--) { v2=UniqueCount(0,i); if (v1>v2) f[i+1]++; v1=v2; } if (v1==2) f[1]++; for (i=1;i<N-1;i++) if (f[i]==2) ans[i]=1; if (f[0]==1) ans[0]=1; if (f[N-1]==1) ans[N-1]=1; return ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 256 KB | Correct : C = 1 |
2 | Correct | 5 ms | 256 KB | Correct : C = 7 |
3 | Correct | 6 ms | 384 KB | Correct : C = 47 |
4 | Correct | 5 ms | 384 KB | Correct : C = 97 |
5 | Correct | 5 ms | 256 KB | Correct : C = 97 |
6 | Correct | 5 ms | 384 KB | Correct : C = 151 |
7 | Correct | 5 ms | 384 KB | Correct : C = 197 |
8 | Correct | 5 ms | 384 KB | Correct : C = 297 |
9 | Correct | 5 ms | 384 KB | Correct : C = 353 |
10 | Correct | 5 ms | 512 KB | Correct : C = 397 |
11 | Correct | 5 ms | 384 KB | Correct : C = 397 |
12 | Correct | 5 ms | 512 KB | Correct : C = 397 |
13 | Correct | 5 ms | 512 KB | Correct : C = 397 |
14 | Correct | 5 ms | 512 KB | Correct : C = 397 |
15 | Correct | 6 ms | 512 KB | Correct : C = 397 |