/***************************************************************
* Author : Nguyen Trong Van Viet *
* Age : 17 *
* School : 12T2 Le Khiet High School for the Gifted *
* Hometown : Quang Ngai , Viet Nam . *
* Khanh An is my lover :) the more I code , the nearer I am *
****************************************************************/
#define TASK "text"
#define INPUT TASK".INP"
#define OUTPUT TASK".OUT"
bool mtt = 0 ;
int test = 1 ;
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define db double
#define ve vector
#define vi vector<int>
#define vll vector<ll>
#define str string
#define pb push_back
#define pk pop_back
#define el '\n'
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mp make_pair
#define fi first
#define se second
#define uni(a) sort(all(a)),a.resize(unique(all(a))-a.begin())
#define FOR(i,a,b) for(int i=(int)(a);i<=(int)(b);i++)
#define FORD(i,a,b) for(int i=(int)(a);i>=(int)(b);i--)
#define FORN(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define all(a) a.begin(),a.end()
#define LB lower_bound
#define UB upper_bound
#define tct template<class T>
#define BIT(msk,i) (msk>>(i)&1)
#define M(i) (1ll<<(i))
#define SZ(_) (int)(_.size())
#define btpc __builtin_popcountll
#define ctz __builtin_ctzll
ll lg(ll a){return __lg(a);}
ll sq(ll a){return a*a;}
ll gcd(ll a,ll b){return __gcd(a,b);}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
ll rd(ll l , ll r ){return l+1LL*rand()*rand()%(r-l+1);}
#define prt(a,n) {FOR(_i,1,n)cout<<a[_i]<<" ";cout<<el;}
#define prv(a) {for(auto _v:a)cout<<_v<<" "; cout<<el;}
int xx[] = {0,-1,0,1} ;
int yy[] = {-1,0,1,0} ;
const db PI = acos(-1) , EPS = 1e-9;
const ll inf = 1e18 , cs = 331 , sm = 1e9+7;
const int N = 2e5+5 , oo = 2e9 , LO = 17 , CH = 26 ;
tct bool mini(T& a,T b){return (a>b)?a=b,1:0;}
tct bool maxi(T& a,T b){return (a<b)?a=b,1:0;}
void add(ll& a , ll b){a+=b;if(a>=sm)a-=sm;}
void sub(ll& a , ll b){a-=b;if(a<0)a+=sm;}
/* DON'T BELIEVE LOVE WILL INSPIRE YOU -> TRAIN HARDER -> YOU WILL GET THE LOVE YOU WANT !!*/
#include "Anna.h"
string up ;
namespace
{
void Anna(int n , ve<char>S)
{
FORN(i,0,n)
{
if(S[i]=='X')up+="00" ;
if(S[i]=='Y')up+="01" ;
if(S[i]=='Z')up+="10" ;
}
for(auto x : up)Send(x-'0') ;
}
}
/***************************************************************
* Author : Nguyen Trong Van Viet *
* Age : 17 *
* School : 12T2 Le Khiet High School for the Gifted *
* Hometown : Quang Ngai , Viet Nam . *
* Khanh An is my lover :) the more I code , the nearer I am *
****************************************************************/
#define TASK "text"
#define INPUT TASK".INP"
#define OUTPUT TASK".OUT"
bool mtt = 0 ;
int test = 1 ;
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define db double
#define ve vector
#define vi vector<int>
#define vll vector<ll>
#define str string
#define pb push_back
#define pk pop_back
#define el '\n'
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mp make_pair
#define fi first
#define se second
#define uni(a) sort(all(a)),a.resize(unique(all(a))-a.begin())
#define FOR(i,a,b) for(int i=(int)(a);i<=(int)(b);i++)
#define FORD(i,a,b) for(int i=(int)(a);i>=(int)(b);i--)
#define FORN(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define all(a) a.begin(),a.end()
#define LB lower_bound
#define UB upper_bound
#define tct template<class T>
#define BIT(msk,i) (msk>>(i)&1)
#define M(i) (1ll<<(i))
#define SZ(_) (int)(_.size())
#define btpc __builtin_popcountll
#define ctz __builtin_ctzll
ll lg(ll a){return __lg(a);}
ll sq(ll a){return a*a;}
ll gcd(ll a,ll b){return __gcd(a,b);}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
ll rd(ll l , ll r ){return l+1LL*rand()*rand()%(r-l+1);}
#define prt(a,n) {FOR(_i,1,n)cout<<a[_i]<<" ";cout<<el;}
#define prv(a) {for(auto _v:a)cout<<_v<<" "; cout<<el;}
int xx[] = {0,-1,0,1} ;
int yy[] = {-1,0,1,0} ;
const db PI = acos(-1) , EPS = 1e-9;
const ll inf = 1e18 , cs = 331 , sm = 1e9+7;
const int N = 2e5+5 , oo = 2e9 , LO = 17 , CH = 26 ;
tct bool mini(T& a,T b){return (a>b)?a=b,1:0;}
tct bool maxi(T& a,T b){return (a<b)?a=b,1:0;}
void sub(ll& a , ll b){a-=b;if(a<0)a+=sm;}
/* DON'T BELIEVE LOVE WILL INSPIRE YOU -> TRAIN HARDER -> YOU WILL GET THE LOVE YOU WANT !!*/
#include "Bruno.h"
int a[N] ;
namespace
{
const int MSK = M(18) ;
int f[MSK] ;
int trace[MSK] ;
int n ;
int dfs(int msk)
{
if(f[msk]==-1)return f[msk] ;
if(msk==0)return 0 ;
FORN(i,0,n)if(msk>>i&1)
{
bool ok = (a[i]==1) ;
if(ok)FORD(j,i-1,0)if(msk>>j&1)
{
ok&=(a[i]==0) ;
break;
}
if(ok)FORN(j,i+1,n)if(msk>>j&1)
{
ok&=(a[i]==2);
break;
}
if(maxi(f[msk],dfs(msk^M(i))+ok))trace[msk]=i ;
}
return f[msk] ;
}
void go(int msk)
{
if(msk==0)return;
Remove(trace[msk]);
go(msk^M(trace[msk])) ;
}
void Bruno(int N ,int L , vi A)
{
n = N ;
FOR(i,1,n)
{
a[i] = A[i*2]*2+A[i*2+1] ;
}
memset(f,-1,sizeof f) ;
int res = dfs((1<<n)-1) ;
go((1<<n)-1) ;
}
}
Compilation message
Anna.cpp:74:10: warning: 'void {anonymous}::Anna(int, std::vector<char>)' defined but not used [-Wunused-function]
74 | void Anna(int n , ve<char>S)
| ^~~~
/usr/bin/ld: /tmp/ccrt3T3t.o: in function `main':
grader_anna.cpp:(.text.startup+0x14c): undefined reference to `Anna(int, std::vector<char, std::allocator<char> >)'
collect2: error: ld returned 1 exit status
Bruno.cpp: In function 'void {anonymous}::Bruno(int, int, std::vector<int>)':
Bruno.cpp:111:13: warning: unused variable 'res' [-Wunused-variable]
111 | int res = dfs((1<<n)-1) ;
| ^~~
Bruno.cpp: At global scope:
Bruno.cpp:103:10: warning: 'void {anonymous}::Bruno(int, int, std::vector<int>)' defined but not used [-Wunused-function]
103 | void Bruno(int N ,int L , vi A)
| ^~~~~
/usr/bin/ld: /tmp/ccIYMD1g.o: in function `main':
grader_bruno.cpp:(.text.startup+0x24d): undefined reference to `Bruno(int, int, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status