Language: C++


#include<bits/stdc++.h>
#define ll long long//
#define rp(i,a,b) for(ll i=a;i<b;i++)
#define r(i,n) for(ll i=0;i<n;i++)
#define rt return
#define db double
#define ldb long double
#define vd void
#define p(x) cout<<(x)<<endl;
#define ce continue;
#define bl bool
#define r0 rt 0;
#define r1 rt 1;
#define elif else if
#define bk break;
#define A p("A")
#define B p("B")
#define C p("C")
#define D p("D")
#define E p("E")
#define F p("F")
#define S(a) sort(a.begin(),a.end());
#define R(a) reverse(a.begin(),a.end());
#define cl cout<<endl;
#define pb(x) push_back(x);
#define str string
using namespace std;
void Cond(int g){if(g)p("YES")else p("NO")rt;}
void cond(int g){if(g)p("Yes")else p("No")rt;}
ll gcd(ll a,ll b){if(a<b)swap(a,b);if(a%b==0)rt b;gcd(b,a%b);}
str su="0123456789";
str m1="abcdefghijklmnopqrstuvwxyz";
str m2="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
map<char,ll>m5;
typedef pair<ll,ll> P;
const ll INF=(ll)1e18+10;
ll t1=0,t2=0,t3=0,t4=0,t5=0,t6=0,t7=0,t8=0,g=0,ans=0;
ll n=0,m=0,k=0,mx=-INF,mn=INF,ct=0;
ll tmp=0,tmp1=0,tmp2=0,tmp3=0,tmp4=0;
ll sum=0,mask=0;
set<P> pst;
set<ll>st,st1,st2;
set<char> cst;
ll powmod(ll a,ll b,ll x){//(a^b)modx
    if(!b)r1
    if(!(b%2)){//B
        ll t=powmod(a,b/2,x);
        rt t*t%x;
    }
    rt ((a)*powmod(a,b-1,x))%x;
}
void di(){m5['a']=0;
    m5['b']=1;
    m5['c']=2;
    m5['d']=3;
    m5['e']=4;
    m5['f']=5;
    m5['g']=6;
    m5['h']=7;
    m5['i']=8;
    m5['j']=9;
    m5['k']=10;
    m5['l']=11;
    m5['m']=12;
    m5['n']=13;
    m5['o']=14;
    m5['p']=15;
    m5['q']=16;
    m5['r']=17;
    m5['s']=18;
    m5['t']=19;
    m5['u']=20;
    m5['v']=21;
    m5['w']=22;
    m5['x']=23;
    m5['y']=24;
    m5['z']=25;
}
map<ll,ll>mp,mp1,mp2,mp3;
typedef std::vector<ll> vl;
typedef pair<ll,ll> P;
typedef pair<ll,P>  P2;
typedef struct edge2{P tos;ll cost;}EDGE2;
typedef struct edge1{ll to,cost;}EDGE;
bl used[(ll)1e9];
const ll M=(ll)1e9+7;
ll fac[1000007],finv[1000007],inv[1000007];
void initcmb(){
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    for(int i=2;i<1000007;i++){
        fac[i]=fac[i-1]*i%M;
        inv[i]=M-inv[M%i]*(M/i)%M;
        finv[i]=finv[i-1]*inv[i]%M;
    }
}
ll cmb(ll n,ll k){
    if(n<k)return 0;
    if(n<0 || k<0)return 0;
    return fac[n]*(finv[k]*finv[n-k]%M)%M;
}
db pi=3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const ll MAX=5+(ll)1e5*3;
vl rui(MAX);

   

vector<vector<EDGE>>G(1e6);



vd enumDivisors(ll x){
m = x;//x is used as a constant value .
vl v;//all prime numbers are stored here .
v.clear();
mp.clear();//sisuu of each prime number .

for(ll i=2;i*i<=x;++i){
    if(!(m%i)){
        v.pb(i);
        while(!(m%i)){
            m/=i;
            mp[i]++;
        }
    }
}
if(m!=1){v.pb(m);mp[m]++;}
}//enum_Divisors .

vd bitSearch(){
    ll x;

cin>>n>>m>>x;

vl c(n);

vector<vector<ll>>a(n);

r(i,n){
    cin>>c[i];
    r(j,m){
        cin>>t1;
        a[i].pb(t1);
    }
}
vl v;
for(mask = 0;mask < (1LL<<12); mask++){
    sum = 0;
    v.clear();
    mp.clear();

    r(i,12){
        if((mask>>i)&1LL&&i<n){
            sum+=(c[i]);
            v.pb(i)
        }
    }

    r(i,v.size()){
        r(j,m){
            mp[j]+=(a[v[i]][j]);
        }
    }

    g=0;
    r(i,m){
        if(mp[i]<x){
                g=1;
                break;
        }
    }
    if(g)ce;
    
    chmin(mn,sum);
}
p(mn==INF?-1:mn)

}


vd Bsearch(int idx){//1 INDEX .
    ll lef,rig,mid;
    lef=1;
    rig=m+1;
    g=0;
    st.clear();
    while((rig-lef)>=0){
        mid=(rig+lef)/2;
  //      cout<<lef<<" "<<rig<<" "<<mid<<" "<<f(mid)<<endl;
        if(st.find(mid)!=st.end()){
            break;
        }
        st.insert(mid);
        if(f(mid)){
            lef=mid;
            g=1;
        }else{
            rig=mid;
        }
    }
    if(g)chmax(mx,mid+idx);
}


int main(){//swap(ary１,ary２)
    //a.erase(a.begin()+5),a.insert(a.begin()+3,tmp)    ios_base::sync_with_stdio(0); cin.tie(0);
di();
}//main


Compiler output:
a.cc: In function 'void Bsearch(int)':
a.cc:199:12: error: 'f' was not declared in this scope
  199 |         if(f(mid)){
      |            ^
a.cc: In function 'long long int gcd(long long int, long long int)':
a.cc:31:54: warning: control reaches end of non-void function [-Wreturn-type]
   31 | ll gcd(ll a,ll b){if(a<b)swap(a,b);if(a%b==0)rt b;gcd(b,a%b);}
      |                                                   ~~~^~~~~~~