#include "unique.h"
using namespace std;
std::vector<int> PickUnique(int N) {
int tot = UniqueCount(0, N - 1);
vector<int> ret(N, 0);
for(int i = 0, cur = tot; i < N - 1; i++){
int cnt = UniqueCount(i + 1, N - 1);
if(cnt == cur - 1) ret[i]++;
cur = cnt;
}
for(int i = N - 1, cur = tot; i > 0; i--){
int cnt = UniqueCount(0, i - 1);
if(cnt == cur - 1) ret[i]++;
cur = cnt;
}
for(int i = 1; i < N - 1; i++)
ret[i] = (ret[i] == 2 ? 1 : 0);
return ret;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
304 KB |
Correct : C = 3 |
2 |
Correct |
5 ms |
256 KB |
Correct : C = 9 |
3 |
Correct |
5 ms |
384 KB |
Correct : C = 49 |
4 |
Correct |
5 ms |
384 KB |
Correct : C = 99 |
5 |
Correct |
5 ms |
256 KB |
Correct : C = 99 |
6 |
Correct |
5 ms |
384 KB |
Correct : C = 153 |
7 |
Correct |
5 ms |
384 KB |
Correct : C = 199 |
8 |
Correct |
5 ms |
384 KB |
Correct : C = 299 |
9 |
Correct |
5 ms |
384 KB |
Correct : C = 355 |
10 |
Correct |
6 ms |
512 KB |
Correct : C = 399 |
11 |
Correct |
5 ms |
512 KB |
Correct : C = 399 |
12 |
Correct |
5 ms |
512 KB |
Correct : C = 399 |
13 |
Correct |
5 ms |
512 KB |
Correct : C = 399 |
14 |
Correct |
6 ms |
512 KB |
Correct : C = 399 |
15 |
Correct |
5 ms |
384 KB |
Correct : C = 399 |