#include <stdio.h>
#include <stdlib.h>
#include "unique.h"
int map[205][205];
std::vector<int> PickUnique(int N) {
for(int i =0; i< N; i++) {
map[0][i] = UniqueCount(0, i);
map[i][N-1] = UniqueCount(i, N-1);
}
std::vector<int> res;
for(int i=0 ; i<N ; i++)
{
if( i > 0 && map[0][i] == map[0][i-1] + 1 ) {
if( i < N-1 && map[i][N-1] == map[i+1][N-1] +1) {
res.push_back(1);
continue;
}
}
res.push_back(0) ;
}
// for(int i =0; i< N; i++) {
// printf("%d ", res[i]);
// }
return res;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Correct : C = 4 |
2 |
Incorrect |
0 ms |
492 KB |
Wrong |
3 |
Halted |
0 ms |
0 KB |
- |