#include "unique.h"
#include <bits/stdc++.h>
using namespace std;
std::vector<int> PickUnique(int n) {
vector<int> ret(n);
int t = 1;
for(int i=1;i<n;i++) {
int nxt = UniqueCount(0,i);
if(t > nxt) {
ret[i] = 1;
}
t = nxt;
}
t = 1;
for(int i=n-2;i>=0;i--) {
int nxt = UniqueCount(i,n-1);
if(t > nxt) {
ret[i] = 1;
}
t = nxt;
}
for(int i=0;i<n;i++) ret[i] = 1-ret[i];
return ret;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Correct : C = 2 |
2 |
Correct |
2 ms |
376 KB |
Correct : C = 8 |
3 |
Incorrect |
2 ms |
248 KB |
Wrong |
4 |
Halted |
0 ms |
0 KB |
- |