Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
int maxarray(int* a,int s){
    int b = 0;
    rep(i,s)if(a[i]>b)b=a[i];
    return b;
}
int main(void){
    int n,mw;
    cin >> n >> mw;
    int dp[mw+1];
    rep(i,mw+1)dp[i]=0;
    rep(i,n){
        int v,w;
        cin >> v >> w;
        rep(j,mw)if((j == 0||dp[j]!=0)&&w+j<=mw&&dp[w+j]<dp[j]+v)dp[w+j]=dp[j]+v;
    }
    cout << maxarray(dp,mw+1) << endl;
    return 0;
}



Compiler output:
a.cc:5:1: error: extended character   is not valid in an identifier
    5 |     int b = 0;
      | ^
a.cc:5:1: error: extended character   is not valid in an identifier
a.cc:5:1: error: extended character   is not valid in an identifier
a.cc:5:1: error: extended character   is not valid in an identifier
a.cc:6:1: error: extended character   is not valid in an identifier
    6 |     rep(i,s)if(a[i]>b)b=a[i];
      | ^
a.cc:6:1: error: extended character   is not valid in an identifier
a.cc:6:1: error: extended character   is not valid in an identifier
a.cc:6:1: error: extended character   is not valid in an identifier
a.cc:7:1: error: extended character   is not valid in an identifier
    7 |     return b;
      | ^
a.cc:7:1: error: extended character   is not valid in an identifier
a.cc:7:1: error: extended character   is not valid in an identifier
a.cc:7:1: error: extended character   is not valid in an identifier
a.cc:10:1: error: extended character   is not valid in an identifier
   10 |     int n,mw;
      | ^
a.cc:10:1: error: extended character   is not valid in an identifier
a.cc:10:1: error: extended character   is not valid in an identifier
a.cc:10:1: error: extended character   is not valid in an identifier
a.cc:11:1: error: extended character   is not valid in an identifier
   11 |     cin >> n >> mw;
      | ^
a.cc:11:1: error: extended character   is not valid in an identifier
a.cc:11:1: error: extended character   is not valid in an identifier
a.cc:11:1: error: extended character   is not valid in an identifier
a.cc:12:1: error: extended character   is not valid in an identifier
   12 |     int dp[mw+1];
      | ^
a.cc:12:1: error: extended character   is not valid in an identifier
a.cc:12:1: error: extended character   is not valid in an identifier
a.cc:12:1: error: extended character   is not valid in an identifier
a.cc:13:1: error: extended character   is not valid in an identifier
   13 |     rep(i,mw+1)dp[i]=0;
      | ^
a.cc:13:1: error: extended character   is not valid in an identifier
a.cc:13:1: error: extended character   is not valid in an identifier
a.cc:13:1: error: extended character   is not valid in an identifier
a.cc:14:1: error: extended character   is not valid in an identifier
   14 |     rep(i,n){
      | ^
a.cc:14:1: error: extended character   is not valid in an identifier
a.cc:14:1: error: extended character   is not valid in an identifier
a.cc:14:1: error: extended character   is not valid in an identifier
a.cc:15:1: error: extended character   is not valid in an identifier
   15 |         int v,w;
      | ^
a.cc:15:1: error: extended character   is not valid in an identifier
a.cc:15:1: error: extended character   is not valid in an identifier
a.cc:15:1: error: extended character   is not valid in an identifier
a.cc:15:1: error: extended character   is not valid in an identifier
a.cc:15:1: error: extended character   is not valid in an identifier
a.cc:15:1: error: extended character   is not valid in an identifier
a.cc:15:1: error: extended character   is not valid in an identifier
a.cc:16:1: error: extended character   is not valid in an identifier
   16 |         cin >> v >> w;
      | ^
a.cc:16:1: error: extended character   is not valid in an identifier
a.cc:16:1: error: extended character   is not valid in an identifier
a.cc:16:1: error: extended character   is not valid in an identifier
a.cc:16:1: error: extended character   is not valid in an identifier
a.cc:16:1: error: extended character   is not valid in an identifier
a.cc:16:1: error: extended character   is not valid in an identifier
a.cc:16:1: error: extended character   is not valid in an identifier
a.cc:17:1: error: extended character   is not valid in an identifier
   17 |         rep(j,mw)if((j == 0||dp[j]!=0)&&w+j<=mw&&dp[w+j]<dp[j]+v)dp[w+j]=dp[j]+v;
      | ^
a.cc:17:1: error: extended character   is not valid in an identifier
a.cc:17:1: error: extended character   is not valid in an identifier
a.cc:17:1: error: extended character   is not valid in an identifier
a.cc:17:1: error: extended character   is not valid in an identifier
a.cc:17:1: error: extended character   is not valid in an identifier
a.cc:17:1: error: extended character   is not valid in an identifier
a.cc:17:1: error: extended character   is not valid in an identifier
a.cc:18:1: error: extended character   is not valid in an identifier
   18 |     }
      | ^
a.cc:18:1: error: extended character   is not valid in an identifier
a.cc:18:1: error: extended character   is not valid in an identifier
a.cc:18:1: error: extended character   is not valid in an identifier
a.cc:19:1: error: extended character   is not valid in an identifier
   19 |     cout << maxarray(dp,mw+1) << endl;
      | ^
a.cc:19:1: error: extended character   is not valid in an identifier
a.cc:19:1: error: extended character   is not valid in an identifier
a.cc:19:1: error: extended character   is not valid in an identifier
a.cc:20:1: error: extended character   is not valid in an identifier
   20 |     return 0;
      | ^
a.cc:20:1: error: extended character   is not valid in an identifier
a.cc:20:1: error: extended character   is not valid in an identifier
a.cc:20:1: error: extended character   is not valid in an identifier
a.cc: In function 'int maxarray(int*, int)':
a.cc:5:1: error: '\U000000a0\U000000a0\U000000a0\U000000a0int' was not declared in this scope
    5 |     int b = 0;
      | ^~~~~~~
a.cc:6:9: error: 'i' was not declared in this scope
    6 |     rep(i,s)if(a[i]>b)b=a[i];
      |         ^
a.cc:6:1: error: '\U000000a0\U000000a0\U000000a0\U000000a0rep' was not declared in this scope
    6 |     rep(i,s)if(a[i]>b)b=a[i];
      | ^~~~~~~
a.cc:7:1: error: '\U000000a0\U000000a0\U000000a0\U000000a0return' was not declared in this scope
    7 |     return b;
      | ^~~~~~~~~~
a.cc:8:1: warning: no return statement in function returning non-void [-Wreturn-type]
    8 | }
      | ^
a.cc: In function 'int main()':
a.cc:10:1: error: '\U000000a0\U000000a0\U000000a0\U000000a0int' was not declared in this scope
   10 |     int n,mw;
      | ^~~~~~~
a.cc:11:1: error: '\U000000a0\U000000a0\U000000a0\U000000a0cin' was not declared in this scope
   11 |     cin >> n >> mw;
      | ^~~~~~~
a.cc:11:12: error: 'n' was not declared in this scope; did you mean 'yn'?
   11 |     cin >> n >> mw;
      |            ^
      |            yn
a.cc:11:17: error: 'mw' was not declared in this scope
   11 |     cin >> n >> mw;
      |                 ^~
a.cc:12:8: error: expected ';' before 'dp'
   12 |     int dp[mw+1];
      |        ^~~
      |        ;
a.cc:13:9: error: 'i' was not declared in this scope
   13 |     rep(i,mw+1)dp[i]=0;
      |         ^
a.cc:13:1: error: '\U000000a0\U000000a0\U000000a0\U000000a0rep' was not declared in this scope
   13 |     rep(i,mw+1)dp[i]=0;
      | ^~~~~~~
a.cc:19:1: error: '\U000000a0\U000000a0\U000000a0\U000000a0cout' was not declared in this scope
   19 |     cout << maxarray(dp,mw+1) << endl;
      | ^~~~~~~~
a.cc:19:22: error: 'dp' was not declared in this scope; did you mean 'dup'?
   19 |     cout << maxarray(dp,mw+1) << endl;
      |                      ^~
      |                      dup
a.cc:20:1: error: '\U000000a0\U000000a0\U000000a0\U000000a0return' was not declared in this scope
   20 |     return 0;
      | ^~~~~~~~~~