#include "unique.h"
#include<bits/stdc++.h>
#define ll long long
using namespace std;
vector<int> PickUnique(int N) {
vector<int>ans;
for(int i=0;i<N;i++)
{
ll sig=0;
ll sigg=0;
if(i==0)
{
ll cntR=UniqueCount(i,N-1);
ll cntR1=UniqueCount(i+1,N-1);
if(cntR1<cntR)sig=1;
if(sig)ans.push_back(1);
else ans.push_back(0);
}
else if(i==N-1)
{
ll cntL=UniqueCount(0,i);
ll cntL1=UniqueCount(0,i-1);
if(cntL1<cntL)sigg=1;
if(sigg)ans.push_back(1);
else ans.push_back(0);
}
else
{
ll cntR=UniqueCount(i,N-1);
ll cntR1=UniqueCount(i+1,N-1);
if(cntR1<cntR)sig=1;
ll cntL=UniqueCount(0,i);
ll cntL1=UniqueCount(0,i-1);
if(cntL1<cntL)sigg=1;
if(sigg && sig)ans.push_back(1);
else ans.push_back(0);
}
}
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
384 KB |
Correct : C = 4 |
2 |
Correct |
5 ms |
384 KB |
Correct : C = 16 |
3 |
Correct |
6 ms |
256 KB |
Correct : C = 96 |
4 |
Correct |
6 ms |
384 KB |
Correct : C = 196 |
5 |
Correct |
6 ms |
384 KB |
Correct : C = 196 |
6 |
Correct |
6 ms |
384 KB |
Correct : C = 304 |
7 |
Correct |
6 ms |
384 KB |
Correct : C = 396 |
8 |
Partially correct |
5 ms |
432 KB |
Partially correct : C = 596 |
9 |
Partially correct |
6 ms |
512 KB |
Partially correct : C = 708 |
10 |
Partially correct |
5 ms |
512 KB |
Partially correct : C = 796 |
11 |
Partially correct |
6 ms |
512 KB |
Partially correct : C = 796 |
12 |
Partially correct |
6 ms |
512 KB |
Partially correct : C = 796 |
13 |
Partially correct |
6 ms |
512 KB |
Partially correct : C = 796 |
14 |
Partially correct |
5 ms |
512 KB |
Partially correct : C = 796 |
15 |
Partially correct |
6 ms |
512 KB |
Partially correct : C = 796 |