Language: C++

#include<bits/stdc++.h>
using namespace std;
????
int dp[2][5005][2]{};//1 here 0 there
int main(){
????????for(int x=0;x<2;x++){
????????for(int y=0;y<5000;y++){
????????????????dp[x][y][0]=dp[x][y][1]=1<<29;
????????????????}
????????}
????????dp[0][0][0]=dp[0][0][1]=0;
????????int a;
????????cin>>a;
????????for(int b=1;b<a;b++){
????????for(int i=0;i<=a/2;i++)dp[b&1][i][0]=dp[b&1][i][1]=1<<29;
????????int c;scanf("%d",&c);
????????dp[b&1][0][0]=dp[(b+1)&1][0][0];
????????for(int d=a/2;d>=1;d--){
????????????????????????????dp[b&1][d][1]=min({dp[(b+1)&1][d-1][1],dp[(b+1)&1][d-1][0]+c});
????????????????????dp[b&1][d][0]=min({dp[(b+1)&1][d][0],dp[(b+1)&1][d][1]+c});
????????????????}
????????}
??????cout<<min(dp[(a+1)&1][a/2][0],dp[(a+1)&1][a/2][1])<<endl;
}

Compiler output:
a.cc:3:1: error: expected unqualified-id before '?' token
    3 | ????
      | ^
a.cc: In function 'int main()':
a.cc:6:1: error: expected primary-expression before '?' token
    6 | ????????for(int x=0;x<2;x++){
      | ^
a.cc:6:2: error: expected primary-expression before '?' token
    6 | ????????for(int x=0;x<2;x++){
      |  ^
a.cc:6:3: error: expected primary-expression before '?' token
    6 | ????????for(int x=0;x<2;x++){
      |   ^
a.cc:6:4: error: expected primary-expression before '?' token
    6 | ????????for(int x=0;x<2;x++){
      |    ^
a.cc:6:5: error: expected primary-expression before '?' token
    6 | ????????for(int x=0;x<2;x++){
      |     ^
a.cc:6:6: error: expected primary-expression before '?' token
    6 | ????????for(int x=0;x<2;x++){
      |      ^
a.cc:6:7: error: expected primary-expression before '?' token
    6 | ????????for(int x=0;x<2;x++){
      |       ^
a.cc:6:8: error: expected primary-expression before '?' token
    6 | ????????for(int x=0;x<2;x++){
      |        ^
a.cc:6:9: error: expected primary-expression before 'for'
    6 | ????????for(int x=0;x<2;x++){
      |         ^~~
a.cc:6:9: error: expected ':' before 'for'
    6 | ????????for(int x=0;x<2;x++){
      |         ^~~
      |         :
a.cc:6:9: error: expected primary-expression before 'for'
    6 | ????????for(int x=0;x<2;x++){
      |         ^~~
a.cc:6:9: error: expected ':' before 'for'
    6 | ????????for(int x=0;x<2;x++){
      |         ^~~
      |         :
a.cc:6:9: error: expected primary-expression before 'for'
    6 | ????????for(int x=0;x<2;x++){
      |         ^~~
a.cc:6:9: error: expected ':' before 'for'
    6 | ????????for(int x=0;x<2;x++){
      |         ^~~
      |         :
a.cc:6:9: error: expected primary-expression before 'for'
    6 | ????????for(int x=0;x<2;x++){
      |         ^~~
a.cc:6:9: error: expected ':' before 'for'
    6 | ????????for(int x=0;x<2;x++){
      |         ^~~
      |         :
a.cc:6:9: error: expected primary-expression before 'for'
    6 | ????????for(int x=0;x<2;x++){
      |         ^~~
a.cc:6:9: error: expected ':' before 'for'
    6 | ????????for(int x=0;x<2;x++){
      |         ^~~
      |         :
a.cc:6:9: error: expected primary-expression before 'for'
    6 | ????????for(int x=0;x<2;x++){
      |         ^~~
a.cc:6:9: error: expected ':' before 'for'
    6 | ????????for(int x=0;x<2;x++){
      |         ^~~
      |         :
a.cc:6:9: error: expected primary-expression before 'for'
    6 | ????????for(int x=0;x<2;x++){
      |         ^~~
a.cc:6:9: error: expected ':' before 'for'
    6 | ????????for(int x=0;x<2;x++){
      |         ^~~
      |         :
a.cc:6:9: error: expected primary-expression before 'for'
    6 | ????????for(int x=0;x<2;x++){
      |         ^~~
a.cc:6:9: error: expected ':' before 'for'
    6 | ????????for(int x=0;x<2;x++){
      |         ^~~
      |         :
a.cc:6:9: error: expected primary-expression before 'for'
    6 | ????????for(int x=0;x<2;x++){
      |         ^~~
a.cc:6:21: error: 'x' was not declared in this scope
    6 | ????????for(int x=0;x<2;x++){
      |                     ^
a.cc:11:1: error: expected primary-expression before '?' token
   11 | ????????dp[0][0][0]=dp[0][0][1]=0;
      | ^
a.cc:11:2: error: expected primary-expression before '?' token
   11 | ????????dp[0][0][0]=dp[0][0][1]=0;
      |  ^
a.cc:11:3: error: expected primary-expression before '?' token
   11 | ????????dp[0][0][0]=dp[0][0][1]=0;
      |   ^
a.cc:11:4: error: expected primary-expression before '?' token
   11 | ????????dp[0][0][0]=dp[0][0][1]=0;
      |    ^
a.cc:11:5: error: expected primary-expression before '?' token
   11 | ????????dp[0][0][0]=dp[0][0][1]=0;
      |     ^
a.cc:11:6: error: expected primary-expression before '?' token
   11 | ????????dp[0][0][0]=dp[0][0][1]=0;
      |      ^
a.cc:11:7: error: expected primary-expression before '?' token
   11 | ????????dp[0][0][0]=dp[0][0][1]=0;
      |       ^
a.cc:11:8: error: expected primary-expression before '?' token
   11 | ????????dp[0][0][0]=dp[0][0][1]=0;
      |        ^
a.cc:11:9: error: 'dp' was not declared in this scope; did you mean 'dup'?
   11 | ????????dp[0][0][0]=dp[0][0][1]=0;
      |         ^~
      |         dup
a.cc:11:34: error: expected ':' before ';' token
   11 | ????????dp[0][0][0]=dp[0][0][1]=0;
      |                                  ^
      |                                  :
a.cc:11:34: error: expected primary-expression before ';' token
a.cc:11:34: error: expected ':' before ';' token
   11 | ????????dp[0][0][0]=dp[0][0][1]=0;
      |                                  ^
      |                                  :
a.cc:11:34: error: expected primary-expression before ';' token
a.cc:11:34: error: expected ':' before ';' token
   11 | ????????dp[0][0][0]=dp[0][0][1]=0;
      |                                  ^
      |                                  :
a.cc:11:34: error: expected primary-expression before ';' token
a.cc:11:34: error: expected ':' before ';' token
   11 | ????????dp[0][0][0]=dp[0][0][1]=0;
      |                                  ^
      |                                  :
a.cc:11:34: error: expected primary-expression before ';' token
a.cc:11:34: error: expected ':' before ';' token
   11 | ????????dp[0][0][0]=dp[0][0][1]=0;
      |                                  ^
      |                                  :
a.cc:11:34: error: expected primary-expression before ';' token
a.cc:11:34: error: expected ':' before ';' token
   11 | ????????dp[0][0][0]=dp[0][0][1]=0;
      |                                  ^
      |                                  :
a.cc:11:34: error: expected primary-expression before ';' token
a.cc:11:34: error: expected ':' before ';' token
   11 | ????????dp[0][0][0]=dp[0][0][1]=0;
      |                                  ^
      |                                  :
a.cc:11:34: error: expected primary-expression before ';' token
a.cc:11:34: error: expected ':' before ';' token
   11 | ????????dp[0][0][0]=dp[0][0][1]=0;
      |                                  ^
      |                                  :
a.cc:11:34: error: expected primary-expression before ';' token
a.cc:12:1: error: expected primary-expression before '?' token
   12 | ????????int a;
      | ^
a.cc:12:2: error: expected primary-expression before '?' token
   12 | ????????int a;
      |  ^
a.cc:12:3: error: expected primary-expression before '?' token
   12 | ????????int a;
      |   ^
a.cc:12:4: error: expected primary-expression before '?' token
   12 | ????????int a;
      |    ^
a.cc:12:5: error: expected primary-expression before '?' token
   12 | ????????int a;
      |     ^
a.cc:12:6: error: expected primary-expression before '?' token
   12 | ????????int a;
      |      ^
a.cc:12:7: error: expected primary-expression before '?' token
   12 | ????????int a;
      |       ^
a.cc:12:8: error: expected primary-expression before '?' token
   12 | ????????int a;
      |        ^
a.cc:12:9: error: expected primary-expression before 'int'
   12 | ????????int a;
      |         ^~~
a.cc:12:9: error: expected ':' before 'int'
   12 | ????????int a;
      |         ^~~
      |         :
a.cc:12:9: error: expected primary-expression before 'int'
   12 | ????????int a;
      |         ^~~
a.cc:12:9: error: expected ':' before 'int'
   12 | ????????int a;
      |         ^~~
      |         :
a.cc:12:9: error: expected primary-expression before 'int'
   12 | ????????int a;
      |         ^~~
a.cc:12:9: error: expected ':' before 'int'
   12 | ????????int a;
      |         ^~~
      |         :
a.cc:12:9: error: expected primary-expression before 'int'
   12 | ????????int a;
      |         ^~~
a.cc:12:9: error: expected ':' before 'int'
   12 | ????????int a;
      |         ^~~
      |         :
a.cc:12:9: error: expected primary-expression before 'int'
   12 | ????????int a;
      |         ^~~
a.cc:12:9: error: expected ':' before 'int'
   12 | ????????int a;
      |         ^~~
      |         :
a.cc:12:9: error: expected primary-expression before 'int'
   12 | ????????int a;
      |         ^~~
a.cc:12:9: error: expected ':' before 'int'
   12 | ????????int a;
      |         ^~~
      |         :
a.cc:12:9: error: expected primary-expression before 'int'
   12 | ????????int a;
      |         ^~~
a.cc:12:9: error: expected ':' before 'int'
   12 | ????????int a;
      |         ^~~
      |         :
a.cc:12:9: error: expected primary-expression before 'int'
   12 | ????????int a;
      |         ^~~
a.cc:12:9: error: expected ':' before 'int'
   12 | ????????int a;
      |         ^~~
      |         :
a.cc:12:9: error: expected primary-expression before 'int'
   12 | ????????int a;
      |         ^~~
a.cc:13:1: error: expected primary-expression before '?' token
   13 | ????????cin>>a;
      | ^
a.cc:13:2: error: expected primary-expression before '?' token
   13 | ????????cin>>a;
      |  ^
a.cc:13:3: error: expected primary-expression before '?' token
   13 | ????????cin>>a;
      |   ^
a.cc:13:4: error: expected primary-expression before '?' token
   13 | ????????cin>>a;
      |    ^
a.cc:13:5: error: expected primary-expression before '?' token
   13 | ????????cin>>a;
      |     ^
a.cc:13:6: error: expected primary-expression before '?' token
   13 | ????????cin>>a;
      |      ^
a.cc:13:7: error: expected primary-expression before '?' token
   13 | ????????cin>>a;
      |       ^
a.cc:13:8: error: expected primary-expression before '?' token
   13 | ????????cin>>a;
      |        ^
a.cc:13:14: error: 'a' was not declared in this scope
   13 | ????????cin>>a;
      |              ^
a.cc:13:15: error: expected ':' before ';' token
   13 | ????????cin>>a;
      |               ^
      |               :
a.cc:13:15: error: expected primary-expression before ';' token
a.cc:13:15: error: expected ':' before ';' token
   13 | ????????cin>>a;
      |               ^
      |               :
a.cc:13:15: error: expected primary-expression before ';' token
a.cc:13:15: error: expected ':' before ';' token
   13 | ????????cin>>a;
      |               ^
      |               :
a.cc:13:15: error: expected primary-expression before ';' token
a.cc:13:15: error: expected ':' before '