#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define mp make_pair
#define PI ( acos(-1.0) )
#define FOR(i,a,b) for(i=a ; i<=b ; i++)
#define DBG printf("Hi\n")
#define i64 long long int
#define eps (1e-8)
#define xx first
#define yy second
#define ln 17
#define off 2
#define SZ(z) ((int)z.size())
#define MEM(a,x) memset(a,x,sizeof(a))
#define FastIO ios_base::sync_with_stdio(false); cin.tie(NULL)
using namespace __gnu_pbds;
using namespace std ;
typedef tree< i64, null_type, less<i64>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define IN freopen("262144.in","r",stdin)
#define OUT freopen("262144.out","w",stdout)
#define maxn 100005
#define INF 1000000000
#define mod 998244353LL
#define log 60
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#include "unique.h"
vector <int> PickUnique(int n)
{
vector<int> Left(n+2,0) , Right(n+2,0) ;
for(int i=1 ; i<=n ; i++)
{
Left[i] = UniqueCount(0,i-1) ;
Right[i] = UniqueCount(i-1,n-1) ;
}
vector <int> ans ;
for(int i=1 ; i<=n ; i++)
{
if( Left[i-1]==Left[i]-1 && Right[i+1]==Right[i]-1 ) ans.pb(1) ;
else ans.pb(0) ;
}
// printf("%d\n",UniqueCount(0,4)) ;
return ans ;
}
/*
int main()
{
return 0 ;
}
*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Correct : C = 4 |
2 |
Correct |
1 ms |
384 KB |
Correct : C = 10 |
3 |
Correct |
1 ms |
384 KB |
Correct : C = 50 |
4 |
Correct |
1 ms |
384 KB |
Correct : C = 100 |
5 |
Correct |
1 ms |
384 KB |
Correct : C = 100 |
6 |
Correct |
1 ms |
384 KB |
Correct : C = 154 |
7 |
Correct |
1 ms |
384 KB |
Correct : C = 200 |
8 |
Correct |
1 ms |
512 KB |
Correct : C = 300 |
9 |
Correct |
1 ms |
512 KB |
Correct : C = 356 |
10 |
Correct |
1 ms |
500 KB |
Correct : C = 400 |
11 |
Correct |
1 ms |
512 KB |
Correct : C = 400 |
12 |
Correct |
1 ms |
512 KB |
Correct : C = 400 |
13 |
Correct |
1 ms |
512 KB |
Correct : C = 400 |
14 |
Correct |
1 ms |
512 KB |
Correct : C = 400 |
15 |
Correct |
1 ms |
512 KB |
Correct : C = 400 |