Language: C++

main(){int n,a=1e9,c[2][20];cin>>n;R(i,n)cin>>c[0][i];R(i,n)cin>>c[1][i];vector<vector<int>>p(1<<n,vector<int>(51,1e9));p[0][0]=0;R(B,1<<n){int o=0,d[n];R(i,n)if(!(B&1<<i))d[i]=o++;R(i,n){int k=c[abs(i-n+o)%2][i];R(j,k+1)p[B|1<<i][k]=min(p[B|1<<i][k],p[B][j]+d[i]);}}R(i,51)a=min(a,p[(1<<n)-1][i]);cout<<(a>1e8?-1:a);}

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main(){int n,a=1e9,c[2][20];cin>>n;R(i,n)cin>>c[0][i];R(i,n)cin>>c[1][i];vector<vector<int>>p(1<<n,vector<int>(51,1e9));p[0][0]=0;R(B,1<<n){int o=0,d[n];R(i,n)if(!(B&1<<i))d[i]=o++;R(i,n){int k=c[abs(i-n+o)%2][i];R(j,k+1)p[B|1<<i][k]=min(p[B|1<<i][k],p[B][j]+d[i]);}}R(i,51)a=min(a,p[(1<<n)-1][i]);cout<<(a>1e8?-1:a);}
      | ^~~~
a.cc: In function 'int main()':
a.cc:1:29: error: 'cin' was not declared in this scope
    1 | main(){int n,a=1e9,c[2][20];cin>>n;R(i,n)cin>>c[0][i];R(i,n)cin>>c[1][i];vector<vector<int>>p(1<<n,vector<int>(51,1e9));p[0][0]=0;R(B,1<<n){int o=0,d[n];R(i,n)if(!(B&1<<i))d[i]=o++;R(i,n){int k=c[abs(i-n+o)%2][i];R(j,k+1)p[B|1<<i][k]=min(p[B|1<<i][k],p[B][j]+d[i]);}}R(i,51)a=min(a,p[(1<<n)-1][i]);cout<<(a>1e8?-1:a);}
      |                             ^~~
a.cc:1:38: error: 'i' was not declared in this scope
    1 | main(){int n,a=1e9,c[2][20];cin>>n;R(i,n)cin>>c[0][i];R(i,n)cin>>c[1][i];vector<vector<int>>p(1<<n,vector<int>(51,1e9));p[0][0]=0;R(B,1<<n){int o=0,d[n];R(i,n)if(!(B&1<<i))d[i]=o++;R(i,n){int k=c[abs(i-n+o)%2][i];R(j,k+1)p[B|1<<i][k]=min(p[B|1<<i][k],p[B][j]+d[i]);}}R(i,51)a=min(a,p[(1<<n)-1][i]);cout<<(a>1e8?-1:a);}
      |                                      ^
a.cc:1:36: error: 'R' was not declared in this scope
    1 | main(){int n,a=1e9,c[2][20];cin>>n;R(i,n)cin>>c[0][i];R(i,n)cin>>c[1][i];vector<vector<int>>p(1<<n,vector<int>(51,1e9));p[0][0]=0;R(B,1<<n){int o=0,d[n];R(i,n)if(!(B&1<<i))d[i]=o++;R(i,n){int k=c[abs(i-n+o)%2][i];R(j,k+1)p[B|1<<i][k]=min(p[B|1<<i][k],p[B][j]+d[i]);}}R(i,51)a=min(a,p[(1<<n)-1][i]);cout<<(a>1e8?-1:a);}
      |                                    ^
a.cc:1:74: error: 'vector' was not declared in this scope
    1 | main(){int n,a=1e9,c[2][20];cin>>n;R(i,n)cin>>c[0][i];R(i,n)cin>>c[1][i];vector<vector<int>>p(1<<n,vector<int>(51,1e9));p[0][0]=0;R(B,1<<n){int o=0,d[n];R(i,n)if(!(B&1<<i))d[i]=o++;R(i,n){int k=c[abs(i-n+o)%2][i];R(j,k+1)p[B|1<<i][k]=min(p[B|1<<i][k],p[B][j]+d[i]);}}R(i,51)a=min(a,p[(1<<n)-1][i]);cout<<(a>1e8?-1:a);}
      |                                                                          ^~~~~~
a.cc:1:88: error: expected primary-expression before 'int'
    1 | main(){int n,a=1e9,c[2][20];cin>>n;R(i,n)cin>>c[0][i];R(i,n)cin>>c[1][i];vector<vector<int>>p(1<<n,vector<int>(51,1e9));p[0][0]=0;R(B,1<<n){int o=0,d[n];R(i,n)if(!(B&1<<i))d[i]=o++;R(i,n){int k=c[abs(i-n+o)%2][i];R(j,k+1)p[B|1<<i][k]=min(p[B|1<<i][k],p[B][j]+d[i]);}}R(i,51)a=min(a,p[(1<<n)-1][i]);cout<<(a>1e8?-1:a);}
      |                                                                                        ^~~
a.cc:1:121: error: 'p' was not declared in this scope
    1 | main(){int n,a=1e9,c[2][20];cin>>n;R(i,n)cin>>c[0][i];R(i,n)cin>>c[1][i];vector<vector<int>>p(1<<n,vector<int>(51,1e9));p[0][0]=0;R(B,1<<n){int o=0,d[n];R(i,n)if(!(B&1<<i))d[i]=o++;R(i,n){int k=c[abs(i-n+o)%2][i];R(j,k+1)p[B|1<<i][k]=min(p[B|1<<i][k],p[B][j]+d[i]);}}R(i,51)a=min(a,p[(1<<n)-1][i]);cout<<(a>1e8?-1:a);}
      |                                                                                                                         ^
a.cc:1:133: error: 'B' was not declared in this scope
    1 | main(){int n,a=1e9,c[2][20];cin>>n;R(i,n)cin>>c[0][i];R(i,n)cin>>c[1][i];vector<vector<int>>p(1<<n,vector<int>(51,1e9));p[0][0]=0;R(B,1<<n){int o=0,d[n];R(i,n)if(!(B&1<<i))d[i]=o++;R(i,n){int k=c[abs(i-n+o)%2][i];R(j,k+1)p[B|1<<i][k]=min(p[B|1<<i][k],p[B][j]+d[i]);}}R(i,51)a=min(a,p[(1<<n)-1][i]);cout<<(a>1e8?-1:a);}
      |                                                                                                                                     ^
a.cc:1:299: error: 'cout' was not declared in this scope
    1 | main(){int n,a=1e9,c[2][20];cin>>n;R(i,n)cin>>c[0][i];R(i,n)cin>>c[1][i];vector<vector<int>>p(1<<n,vector<int>(51,1e9));p[0][0]=0;R(B,1<<n){int o=0,d[n];R(i,n)if(!(B&1<<i))d[i]=o++;R(i,n){int k=c[abs(i-n+o)%2][i];R(j,k+1)p[B|1<<i][k]=min(p[B|1<<i][k],p[B][j]+d[i]);}}R(i,51)a=min(a,p[(1<<n)-1][i]);cout<<(a>1e8?-1:a);}
      |                                                                                                                                                                                                                                                                                                           ^~~~