#include "unique.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<int> PickUnique(int n){
vector<int> ret(n, 1);
vector<int> a(n), b(n);
for(int i=0; i<n; i++){
a[i] = UniqueCount(0, i);
if(i && a[i] != a[i-1] + 1) ret[i] = 0;
}
for(int i=n-1; i>=0; i--){
b[i] = UniqueCount(i, n-1);
if(i<n-1 && b[i] != b[i+1] + 1) ret[i] = 0;
}
return ret;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Correct : C = 4 |
2 |
Correct |
1 ms |
212 KB |
Correct : C = 10 |
3 |
Correct |
1 ms |
340 KB |
Correct : C = 50 |
4 |
Correct |
1 ms |
340 KB |
Correct : C = 100 |
5 |
Correct |
1 ms |
340 KB |
Correct : C = 100 |
6 |
Correct |
1 ms |
340 KB |
Correct : C = 154 |
7 |
Correct |
1 ms |
340 KB |
Correct : C = 200 |
8 |
Correct |
1 ms |
440 KB |
Correct : C = 300 |
9 |
Correct |
1 ms |
468 KB |
Correct : C = 356 |
10 |
Correct |
1 ms |
468 KB |
Correct : C = 400 |
11 |
Correct |
1 ms |
468 KB |
Correct : C = 400 |
12 |
Correct |
1 ms |
468 KB |
Correct : C = 400 |
13 |
Correct |
1 ms |
436 KB |
Correct : C = 400 |
14 |
Correct |
1 ms |
468 KB |
Correct : C = 400 |
15 |
Correct |
1 ms |
468 KB |
Correct : C = 400 |