Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(register int i=a;i<=b;i++)
template <typename T>
void read(T &x){
    x=0;
    int flag=1;
    char c=getchar();
    while(c=='-'){
        flag=-1;
        c=getchar();
    }
    while(c>='0'&&c<='9'){
        x=x*10+c-'0';
        c=getchar();
    }
    x*=flag;
}
struct edge{
    int to,next;
}edge[40000000010];
int head[40000000010]={0},tot=0;
void add(int u,int v){
    edge[tot].to=v;
    edge[tot].next=head[u];
    head[u]=tot++;
}
int n;
ll a[200010];
map<ll,bool> po;

int linker[200010];
bool used[200010];

bool dfs(int u){
    for(int i=head[u];i!=-1;i=edge[i].next){
        int v=edge[i].to;
        if(!used[v]){
            used[v]=1;
            if(linker[v]==-1||dfs(linker[v])){
                linker[v]=u;
                return true;
            }
        }
    }
    return false;
}
int hungary(){
    int res=0;
    memset(linker,-1,sizeof(linker));
    for(int u=0;u<n;u++){
        memset(used,false,sizeof(used));
        if(dfs(u))res++;
    }
    return res;
}
int main(){
    read(n);rep(i,0,n-1)read(a[i]);
    memset(head,-1,sizeof(head));
    for(ll i=2;i<=2000000000;i*=2)
        po[i]=true;
    rep(i,0,n-2)rep(j,i+1,n-1)if(po[a[i]+a[j]])add(i,j),add(j,i);
    cout<<hungary()/2;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:59:17: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   59 |     read(n);rep(i,0,n-1)read(a[i]);
      |                 ^
a.cc:4:37: note: in definition of macro 'rep'
    4 | #define rep(i,a,b) for(register int i=a;i<=b;i++)
      |                                     ^
a.cc:63:9: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   63 |     rep(i,0,n-2)rep(j,i+1,n-1)if(po[a[i]+a[j]])add(i,j),add(j,i);
      |         ^
a.cc:4:37: note: in definition of macro 'rep'
    4 | #define rep(i,a,b) for(register int i=a;i<=b;i++)
      |                                     ^
a.cc:63:21: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   63 |     rep(i,0,n-2)rep(j,i+1,n-1)if(po[a[i]+a[j]])add(i,j),add(j,i);
      |                     ^
a.cc:4:37: note: in definition of macro 'rep'
    4 | #define rep(i,a,b) for(register int i=a;i<=b;i++)
      |                                     ^
/tmp/ccNXf4dr.o: in function `add(int, int)':
a.cc:(.text+0xc): relocation truncated to fit: R_X86_64_PC32 against symbol `tot' defined in .bss section in /tmp/ccNXf4dr.o
a.cc:(.text+0x29): relocation truncated to fit: R_X86_64_PC32 against symbol `tot' defined in .bss section in /tmp/ccNXf4dr.o
a.cc:(.text+0x3d): relocation truncated to fit: R_X86_64_PC32 against symbol `head' defined in .bss section in /tmp/ccNXf4dr.o
a.cc:(.text+0x5b): relocation truncated to fit: R_X86_64_PC32 against symbol `tot' defined in .bss section in /tmp/ccNXf4dr.o
a.cc:(.text+0x64): relocation truncated to fit: R_X86_64_PC32 against symbol `tot' defined in .bss section in /tmp/ccNXf4dr.o
a.cc:(.text+0x79): relocation truncated to fit: R_X86_64_PC32 against symbol `head' defined in .bss section in /tmp/ccNXf4dr.o
/tmp/ccNXf4dr.o: in function `dfs(int)':
a.cc:(.text+0x9e): relocation truncated to fit: R_X86_64_PC32 against symbol `head' defined in .bss section in /tmp/ccNXf4dr.o
a.cc:(.text+0xcf): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/ccNXf4dr.o
a.cc:(.text+0xe6): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/ccNXf4dr.o
a.cc:(.text+0xfe): relocation truncated to fit: R_X86_64_PC32 against symbol `linker' defined in .bss section in /tmp/ccNXf4dr.o
a.cc:(.text+0x11a): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status