#include "unique.h"
#include<bits/stdc++.h>
using namespace std;
std::vector<int> PickUnique(int N) {
UniqueCount(0, N-1);
vector<int> ans(N,1);
vector<int> p1(N,0),p2(N,0);
p1[0]=1;
for(int i=1;i<N;i++){
p1[i]=UniqueCount(0,i);
}
p2[N-1]=1;
for(int i=N-2;i>=0;i--){
p2[i]=UniqueCount(i,N-1);
}
for(int i=1;i<N;i++){
if(p1[i]<=p1[i-1]){
ans[i]=0;
}
}
for(int i=N-2;i>=0;i--){
if(p2[i]<=p2[i+1]){
ans[i]=0;
}
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Correct : C = 3 |
2 |
Correct |
2 ms |
376 KB |
Correct : C = 9 |
3 |
Correct |
2 ms |
248 KB |
Correct : C = 49 |
4 |
Correct |
2 ms |
248 KB |
Correct : C = 99 |
5 |
Correct |
2 ms |
248 KB |
Correct : C = 99 |
6 |
Correct |
2 ms |
380 KB |
Correct : C = 153 |
7 |
Correct |
2 ms |
376 KB |
Correct : C = 199 |
8 |
Correct |
2 ms |
376 KB |
Correct : C = 299 |
9 |
Correct |
2 ms |
376 KB |
Correct : C = 355 |
10 |
Correct |
2 ms |
504 KB |
Correct : C = 399 |
11 |
Correct |
2 ms |
504 KB |
Correct : C = 399 |
12 |
Correct |
2 ms |
524 KB |
Correct : C = 399 |
13 |
Correct |
2 ms |
508 KB |
Correct : C = 399 |
14 |
Correct |
2 ms |
376 KB |
Correct : C = 399 |
15 |
Correct |
2 ms |
424 KB |
Correct : C = 399 |