#include "unique.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> arr;
int ldp[203],rdp[203];
std::vector<int> PickUnique(int n)
{
for(int i=0;i<n;i++)
{
ldp[i]=UniqueCount(0,i);
rdp[i]=UniqueCount(i,n-1);
} if(ldp[n-1]-ldp[n-2]==-1) arr[n-1]=1; else
if(rdp[0]-rdp[1]==-1) arr[0]=1;
for(int i=1;i<n-1;i++)
{
if(ldp[i]-ldp[i-1]==-1&&rdp[i]-rdp[i+1]==-1) arr[i]=1;
} return arr;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
5 ms |
256 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |