#include "unique.h"
#include <bits/stdc++.h>
using namespace std;
int arr1[205];
int arr2[205];
std::vector<int> PickUnique(int N) {
arr1[0] = 1;
arr2[N-1] = 1;
for (int x = 1; x<N; x++){
arr1[x] = UniqueCount(0,x);
}
for (int x = 0; x<N-1; x++){
arr2[x] = UniqueCount(x,N-1);
}
vector<int> ans;
if (arr2[0]>arr2[1]){
ans.push_back(1);
}
else{
ans.push_back(0);
}
for (int x = 1; x<N-1; x++){
if (arr2[x]>arr2[x+1] && arr1[x]>arr1[x-1]){
ans.push_back(1);
}
else{
ans.push_back(0);
}
}
if (arr1[N-1]>arr1[N-2]){
ans.push_back(1);
}
else{
ans.push_back(0);
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Correct : C = 2 |
2 |
Correct |
4 ms |
384 KB |
Correct : C = 8 |
3 |
Correct |
4 ms |
384 KB |
Correct : C = 48 |
4 |
Correct |
5 ms |
384 KB |
Correct : C = 98 |
5 |
Correct |
4 ms |
384 KB |
Correct : C = 98 |
6 |
Correct |
4 ms |
384 KB |
Correct : C = 152 |
7 |
Correct |
5 ms |
384 KB |
Correct : C = 198 |
8 |
Correct |
5 ms |
512 KB |
Correct : C = 298 |
9 |
Correct |
5 ms |
512 KB |
Correct : C = 354 |
10 |
Correct |
5 ms |
512 KB |
Correct : C = 398 |
11 |
Correct |
5 ms |
512 KB |
Correct : C = 398 |
12 |
Correct |
5 ms |
512 KB |
Correct : C = 398 |
13 |
Correct |
5 ms |
512 KB |
Correct : C = 398 |
14 |
Correct |
5 ms |
512 KB |
Correct : C = 398 |
15 |
Correct |
5 ms |
512 KB |
Correct : C = 398 |