criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <iostream>
using namespace std;

int ans = -(1 << 30);
using ushort = unsigned short;
// 自分の店を開くか
ushort my_shop = 0;
// 店の数
int n;
// ほかの店の開店時間
ushort others[110];
// ほかの店との兼ね合いによる利益
int profit[110][11];

void update(int n);
void calc_profit();
int pop_count(ushort a);
int pop_count(ushort a, ushort b);

int main(){
	// 店の数
	cin >> n;
	int input;
	// ほかの店の開店時間
	for(int j = 0; j < n; j++){
		others[j] = 0;
	for(int i = 0; i < 10; i++){
		cin >> input;
		others[j] |= (input << i);
	}
	}
	// 開店時間の重複数と利益
	for(int j = 0; j < n; j++){
	for(int i = 0; i < 11; i++){
		cin >> input;
		profit[j][i] = input;
	}
	}
	update(0);
	cout << ans << endl;
	return 0;
}

void update(int n){
	if(n == 10){
		calc_profit();
		return;
	}else{
		// この時間帯に店を開く場合
		my_shop |= (1 << n);  update(n + 1);
		// この時間帯に店を開かない場合
		my_shop &= ~(1 << n); update(n + 1);
	}
}

inline int max(int a, int p){
	return a < p? p: a;
}
void calc_profit(){
	for(int i = 0; i < n; i++){
		int p = profit[i][count(a, i)];
		ans = max(ans, p);
	}
}

int pop_count(ushort a) {
	a = (a & 0x5555) + ((a >> 1) & 0x5555);// 0101 0101 0101 0101
	a = (a & 0x3333) + ((a >> 2) & 0x3333);// 0011 0011 0011 0011
	a = (a & 0x0f0f) + ((a >> 4) & 0x0f0f);// 0000 1111 0000 1111
	a = (a & 0x00ff) + ((a >> 8) & 0x00ff);// 0000 0000 1111 1111
	return a;
}
int count(ushort a, ushort b) {
	return pop_count(a & b);
}


Compiler output:
a.cc: In function 'void calc_profit()':
a.cc:61:41: error: 'a' was not declared in this scope
   61 |                 int p = profit[i][count(a, i)];
      |                                         ^
a.cc:61:35: error: 'count' was not declared in this scope
   61 |                 int p = profit[i][count(a, i)];
      |                                   ^~~~~
Language: C++

#include <cstdio > int N;
int F[100][14]; int P[100][15]; int main ()
{
scanf("%d",&N); for(int i=0;i<N;i++) {
for(int j=0;j<10;j++)scanf("%d",&F[i][j]);
}
for(int i=0;i<N;i++)for(int j=0;j<11;j++)scanf("%d",&P[i][j]); int res = -(1 < <30);
for(int b=1;b<(1<<10);b++)
{
int cc =0;
for(int i=0;i<N;i++) {
int c=0;
for(int j=0;j<10;j++)if((b>>j&1)&&F[i][j])c++; cc+=P[i][c];
} if(res<cc)res=cc;
} printf("%

Compiler output:
a.cc:1:20: warning: extra tokens at end of #include directive
    1 | #include <cstdio > int N;
      |                    ^~~
a.cc:1:10: fatal error: cstdio : No such file or directory
    1 | #include <cstdio > int N;
      |          ^~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<cstdlib>
#include<stack>
#include<queue>
#include<string>
#include<algorithm>
using namespace std;

int n;
int f[100][5][2];
long long int p[100][11];
long long int 

int main(){
    
    for(int i=0;i<n;i++){
        for(int j=0;j<5;j++){
            cin>>f[i][j][0]>>f[i][j][1];
        }
    }
    for(int i=0;i<n;i++){
        for(int j=0;j<=10;j++){
            cin>>p[i][j];
        }
    }
    int rieki=0;
    for(int i=0;i<n;i++){
        for(int j=0;j<5;j++){
            for(int k=0;k<2;k++){
                if(p[i][j][k]>0)rieki+=p[i][j][k];
            }
        }
    }
    cout<<rieki;
    

    return 0;
}

Compiler output:
a.cc:12:11: error: two or more data types in declaration of 'main'
   12 | long long int
      |           ^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string.h>
typedef long long ll;
#define MAX(x, y)	(((x) > (y))? (x) : (y))
#define MIN(x, y)	(((x) < (y))? (x) : (y))
#define ABS(x)		(((x) < 0)? (-1*(x)) : (x))
#define REPI(x,y)	for (int i=(x);i<(y);i++)
#define REPJ(x,y)	for (int j=(x);j<(y);j++)
#define MEMCLR(X)	memset((X),0,sizeof((X)))

using namespace std;
typedef vector<vector<pair<int, int>>> G;
typedef pair<int, int> P;

int i,j,N;
bool F[100][10];
int Q[100][11];
int pmax;

int main() {
	cin >> N;
	
	REPI(0,N) REPJ(0,10) cin >> F[i][j];
	REPI(0,N) REPJ(0,11) cin >> Q[i][j];
	
	REPI(1,1024) {
		int x = 0;
		int cnt = 0;
		REPJ(0,N) {
			for (int k=0; k<10;k++) if (i&(1<<k)) cnt += F[i][k];
			x += Q[i][cnt]
		}
		pmax = MAX(x, pmax);
	}
	
	cout << pmax;
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:39: error: expected ';' before '}' token
   34 |                         x += Q[i][cnt]
      |                                       ^
      |                                       ;
   35 |                 }
      |                 ~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string.h>
typedef long long ll;
#define MAX(x, y)	(((x) > (y))? (x) : (y))
#define MIN(x, y)	(((x) < (y))? (x) : (y))
#define ABS(x)		(((x) < 0)? (-1*(x)) : (x))
#define REPI(x,y)	for (int i=(x);i<(y);i++)
#define REPJ(x,y)	for (int j=(x);j<(y);j++)
#define MEMCLR(X)	memset((X),0,sizeof((X)))

using namespace std;
typedef vector<vector<pair<int, int>>> G;
typedef pair<int, int> P;

int i,j,N;
bool F[100][10];
int P[100][11];
int pmax;

int main() {
	cin >> N;
	
	REPI(0,N) REPJ(0,10) cin >> F[i][j];
	REPI(0,N) REPJ(0,11) cin >> P[i][j];
	
	REPI(1,1024) {
		int x = 0;
		int cnt = 0;
		REPJ(0,N) {
			for (int k=0; k<10;k++) if (i&(1<<k)) cnt += F[i][k];
			x += P[i][cnt]
		}
		pmax = MAX(x, pmax);
	}
	
	cout << pmax;
	
	return 0;
}


Compiler output:
a.cc:20:14: error: 'int P [100][11]' redeclared as different kind of entity
   20 | int P[100][11];
      |              ^
a.cc:16:24: note: previous declaration 'typedef struct std::pair<int, int> P'
   16 | typedef pair<int, int> P;
      |                        ^
a.cc: In function 'int main()':
a.cc:27:38: error: expected primary-expression before '[' token
   27 |         REPI(0,N) REPJ(0,11) cin >> P[i][j];
      |                                      ^
a.cc:34:31: error: expected primary-expression before '[' token
   34 |                         x += P[i][cnt]
      |                               ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string.h>
typedef long long ll;
typedef unsigned char UCHAR
#define MAX(x, y)	(((x) > (y))? (x) : (y))
#define MIN(x, y)	(((x) < (y))? (x) : (y))
#define ABS(x)		(((x) < 0)? (-1*(x)) : (x))
#define REPI(x,y)	for (int i=(x);i<(y);i++)
#define REPJ(x,y)	for (int j=(x);j<(y);j++)
#define MEMCLR(X)	memset((X),0,sizeof((X)))

using namespace std;
typedef vector<vector<pair<int, int>>> G;
typedef pair<int, int> P;

int i,j,N;
bool F[100][10];
int P[100][11];
int pmax;

int main() {
	cin >> N;
	
	REPI(0,N) REPJ(0,10) cin >> F[i][j];
	REPI(0,N) REPJ(0,11) cin >> P[i][j];
	
	REPI(1,1024) {
		int x = 0;
		int cnt = 0;
		REPJ(0,N) {
			for (int k=0; k<10;k++) if (i&(1<<k)) cnt += F[i][k];
			x += P[i][cnt]
		}
		pmax = MAX(x, pmax);
	}
	
	cout << pmax;
	
	return 0;
}


Compiler output:
a.cc:15:1: error: expected initializer before 'using'
   15 | using namespace std;
      | ^~~~~
a.cc:16:9: error: 'vector' does not name a type
   16 | typedef vector<vector<pair<int, int>>> G;
      |         ^~~~~~
a.cc:17:9: error: 'pair' does not name a type
   17 | typedef pair<int, int> P;
      |         ^~~~
a.cc: In function 'int main()':
a.cc:25:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   25 |         cin >> N;
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:35:39: error: expected ';' before '}' token
   35 |                         x += P[i][cnt]
      |                                       ^
      |                                       ;
   36 |                 }
      |                 ~                      
a.cc:40:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   40 |         cout << pmax;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: Java

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[][] f = new int[n][10];
		int[][] p = new int[n][11];
		for(int i = 0 ; i < n ; i++) {
			for(int j = 0 ; j < 10 ; j++) {
				f[i][j] = sc.nextInt();
			}
		}
		for(int i = 0 ; i < n ; i++) {
			for(int j = 0 ; j < 11 ; j++) {
				p[i][j] = sc.nextInt();
			}
		}
		int ans = -1001001001;
		for(int mask = 1 ; mask < (1<<10) ; mask++) {
			int money = 0;
			for(int i = 0 ; i < n ; i++) {
				int cnt = 0;
				for(int j = 0 ; j < 10 ; j++) {
					if((mask>>(j&1)) && f[i][j] == 1) cnt++;
				}
				money += p[i][cnt];
			}
			ans = Math.max(ans, money);
		}
		System.out.println(ans);
	}
}


Compiler output:
Main.java:25: error: bad operand types for binary operator '&&'
					if((mask>>(j&1)) && f[i][j] == 1) cnt++;
					                 ^
  first type:  int
  second type: boolean
1 error
Language: C++

#include <iostream>
#include <vector>
#include <bitset>
#include <algorithm>

using namespace std;


int main() {
#ifdef __APPLE__
    freopen("input2.txt", "r", stdin);
#endif
    int N;
cin >> N;

    vector<vector<int>> shops;
    vector<vector<long>> profits;
    for (int i = 0; i < N; ++i) {
        vector<int> shop(10);
        for (int j = 0; j < 10; ++j) {
            cin >> shop[j];
        }
        shops.push_back(shop);
    }

    for (int i = 0; i < N; ++i) {
        vector<long> profit(11);
        for (int j = 0; j < 11; ++j) {
            cin >> profit[j];
        }
        profits.push_back(profit);
    }


    long max_profit = LONG_MIN;

    vector<int> num_of_opens_for_each_shop(N);

    for (int i = 1; i < 1024; ++i) {
        for (int j = 0; j < N; ++j) {
            num_of_opens_for_each_shop[j] = 0;
        }

        long sum = 0;
        bitset<10> pattern = bitset<10>((unsigned long long)i);
        for (int j = 0; j < 10; ++j) { // j: weekday
            if (pattern[j]) {
                for (int k = 0; k < N; ++k) {
                    if (shops[k][j]) ++num_of_opens_for_each_shop[k];
                }
            }
        }

        for (int j = 0; j < N; ++j) {
            sum += profits[j][num_of_opens_for_each_shop[j]];
        }

        max_profit = max(max_profit, sum);
    }

    cout << max_profit << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:23: error: 'LONG_MIN' was not declared in this scope
   35 |     long max_profit = LONG_MIN;
      |                       ^~~~~~~~
a.cc:5:1: note: 'LONG_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <algorithm>
  +++ |+#include <climits>
    5 |
Language: C++

#include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <utility>
using namespace std;

#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define RFOR(i, a, b) for (int i = a; i > b; --i)
#define REP(i, n) for (int i = 0; i < n; ++i)

typedef long long ll;

const int kMaxN = 100;
const int kInf = 1000000000;

int N;
int F[kMaxN][10];
int P[kMaxN][11];
int ans = -kInf;

// bool opened = false;

void Bfs(int j, vector<int> c) {
  if (j < 10) {
    Bfs(j+1, c);

    // opened = true;
    vector<int> c2(c);
    REP(i, N) { if (F[i][j]) { ++c2[i]; } }
    Bfs(j+1, c2);
    // opened = false;
  } else if (opened) {
    int ans2 = 0;
    REP(i, N) { ans2 += P[i][c[i]]; }
    ans = max(ans, ans2);
  }
  return;
}

int main() {
  cin >> N;
  REP(i, N) { REP(j, 10) { cin >> F[i][j]; } }
  REP(i, N) { REP(j, 11) { cin >> P[i][j]; } }

  vector<int> c(10, 0);
  Bfs(0, c);

  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'void Bfs(int, std::vector<int>)':
a.cc:36:14: error: 'opened' was not declared in this scope
   36 |   } else if (opened) {
      |              ^~~~~~
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<math.h>
#include<map>
#include<algorithm>
#include<set>
#define rep(i,N) for(int i=0;i<(N);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e12;
int n;
int f[110][100];
ll p[110][100];
int main() {
	cin >> n;
	rep(i, n) {
		rep(j, 10) {
			cin >> f[i][j];
		}
	}
	rep(i, n) {
		rep(j, 11) {
			cin >> p[i][j];
		}
	}
	ll ans = -INF;
	FOR(i, 1, (1 << 10)) {
		ll sum = 0;
		rep(j, n) {
			ll cnt = 0;
			rep(k, 10) {
				if (i&(1 << k) && f[j][k])cnt++;// i&(1 << k) iのk番目のビットが立ってるか　&論理積
			}
			sum += p[j][cnt];
		}
		ans = max(ans, sum);
	}
	cout << ans << endl;
}

Compiler output:
a.cc:15:1: error: 'll' does not name a type
   15 | ll p[110][100];
      | ^~
a.cc: In function 'int main()':
a.cc:25:32: error: 'p' was not declared in this scope
   25 |                         cin >> p[i][j];
      |                                ^
a.cc:28:9: error: 'll' was not declared in this scope
   28 |         ll ans = -INF;
      |         ^~
a.cc:30:19: error: expected ';' before 'sum'
   30 |                 ll sum = 0;
      |                   ^~~~
      |                   ;
a.cc:32:27: error: expected ';' before 'cnt'
   32 |                         ll cnt = 0;
      |                           ^~~~
      |                           ;
a.cc:34:59: error: 'cnt' was not declared in this scope; did you mean 'int'?
   34 |                                 if (i&(1 << k) && f[j][k])cnt++;// i&(1 << k) iのk番目のビットが立ってるか　&論理積
      |                                                           ^~~
      |                                                           int
a.cc:36:25: error: 'sum' was not declared in this scope
   36 |                         sum += p[j][cnt];
      |                         ^~~
a.cc:36:32: error: 'p' was not declared in this scope
   36 |                         sum += p[j][cnt];
      |                                ^
a.cc:36:37: error: 'cnt' was not declared in this scope; did you mean 'int'?
   36 |                         sum += p[j][cnt];
      |                                     ^~~
      |                                     int
a.cc:38:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   38 |                 ans = max(ans, sum);
      |                 ^~~
      |                 abs
a.cc:38:32: error: 'sum' was not declared in this scope
   38 |                 ans = max(ans, sum);
      |                                ^~~
a.cc:40:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   40 |         cout << ans << endl;
      |                 ^~~
      |                 abs
Language: C++

#include<bits/stdc++.h>
#define rep(i,a,n) for (int i = a; i < n; i++)
#define per(i,n,a) for (int i = n - 1; i >= a; i--)
using namespace std;

int N,F [100][14],P [100][15];
int main () {
    scanf("% d", &N);
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < 10; j++) scanf("% d", &F[i][j]);
    }
    for (int i = 0; i < N; i++) for (int j = 0; j < 11; j++) scanf("%d", &P[i][j]);
    int res = -(1 < < 30);
    for (int b = 1; b < (1 < < 10); b++) {
        int cc = 0;
        for (int i = 0; i < N; i++) {
            int c = 0;
            for (int j = 0; j < 10; j++) if ((b >> j & 1) && F[i][j])c++;
            cc += P[i][c];
        }
        if (res < cc)res = cc;
    }
    printf("%d\n", res);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:21: error: expected primary-expression before '<' token
   13 |     int res = -(1 < < 30);
      |                     ^
a.cc:14:30: error: expected primary-expression before '<' token
   14 |     for (int b = 1; b < (1 < < 10); b++) {
      |                              ^
Language: C++

#include <iostream>
#include <string>
#include <stdlib.h>
#include <stdio.h>
#include <sys/time.h>
#include <bits/stdc++.h>
#include <algorithm>

using namespace std;

int main() {
    int totaltime=10; // MON-FRI*AM/PM
    int n; cin>>n;
    
    int timetable[n][totaltime];
    for (int i=0; i<n; i++) for (int j=0; j<totaltime; j++) cin>>timetable[i][j];

    int profit[n][totaltime+1];
    for (int i=0; i<n; i++) for (int j=0; j<(totaltime+1); j++) cin>>profit[i][j];

    int ans;
    for (int p=1; p<pow(2, totaltime); p++) {
        int max_profit=0;

        for (int i=0; i<n; i++) {
            int match_count=0;

            for (int j=0; j<totaltime; j++) {
                if ((p>>j&1)==1 && timetable[i][j]==1) match_count++;
            }
            max_profit += profit[i][match_count];
        }

        if (i==0) {
            ans=max_profit;
        } else if (ans < max_profit) {
            ans=max_profit;
        }
    }

    cout<<ans<<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:34:13: error: 'i' was not declared in this scope
   34 |         if (i==0) {
      |             ^
Language: C++

#include < cstdio >
int N ;
int F [100][14];
int P [100][15];
int main ()
{
scanf ("% d " ,& N );
for ( int i =0; i < N ; i ++)
{
for ( int j =0; j <10; j ++) scanf ("% d " ,& F [ i ][ j ]);
}
for ( int i =0; i < N ; i ++) for ( int j =0; j <11; j ++) scanf ("% d " ,& P [ i ][ j ]);
int res = -(1 < <30);
for ( int b =1; b <(1 < <10); b ++)
{
int cc =0;
for ( int i =0; i < N ; i ++)
{
int c =0;
for ( int j =0; j <10; j ++) if (( b > > j &1)&& F [ i ][ j ]) c ++;
cc += P [ i ][ c ];
}
if ( res < cc ) res = cc ;
}
printf ("% d \ n " , res );
}

Compiler output:
a.cc:1:10: fatal error:  cstdio : No such file or directory
    1 | #include < cstdio >
      |          ^~~~~~~~~~
compilation terminated.
Language: C

# include < cstdio >
int N ;
int F [100][14];
int P [100][15];
int main ()
{
scanf ("% d " ,& N );
for ( int i =0; i < N ; i ++)
{
for ( int j =0; j <10; j ++) scanf ("% d " ,& F [ i ][ j ]);
}
for ( int i =0; i < N ; i ++) for ( int j =0; j <11; j ++) scanf ("% d " ,& P [ i ][ j ]);
int res = -(1 < <30);
for ( int b =1; b <(1 < <10); b ++)
{
int cc =0;
for ( int i =0; i < N ; i ++)
{
int c =0;
for ( int j =0; j <10; j ++) if (( b > > j &1)&& F [ i ][ j ]) c ++;
cc += P [ i ][ c ];
}
if ( res < cc ) res = cc ;
}
printf ("% d \ n " , res );
}

Compiler output:
main.c:1:11: fatal error:  cstdio : No such file or directory
    1 | # include < cstdio >
      |           ^~~~~~~~~~
compilation terminated.
Language: C++


#include"iostream"
#include"vector"
#include<cstdio>
using namespace std;

int N;
int F[100][14];
int P[100][15];

int _tmain(int argc, _TCHAR* argv[])
{
	scanf("%d", &N);
	for (int i = 0; i < N; i++)
		for (int j = 0; j < 10; ++j)
			scanf("%d", &F[i][j]);
	for (int i = 0; i < N; i++)
		for (int j = 0; j < 10; ++j)
			scanf("%d", &P[i][j]);
	int res = -(1<<30);//2^30?
	for (int b = 1; b < (1 << 10); b++){//2^10
		int cc = 0;
		for (int i = 0; i < N; i++){
			int c = 0;
			for (int j = 0; j < 10; j++)
				if ((b >> j & 1) && F[i][j])c++;
			cc += P[i][c];
		}
		if (res < cc)res = cc;
	}
	printf("%d\n", res);
}



Compiler output:
a.cc:11:22: error: '_TCHAR' has not been declared
   11 | int _tmain(int argc, _TCHAR* argv[])
      |                      ^~~~~~
a.cc: In function 'int _tmain(int, int**)':
a.cc:32:1: warning: no return statement in function returning non-void [-Wreturn-type]
   32 | }
      | ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;

int main() {
	int N; cin >> N;
	vector<vector<int>>F(N, vector<int>(10));
	vector<vector<int>>P(N, vector<int>(11));
	for (int i = 0; i < N; i++)for (int j = 0; j < 10; j++)cin >> F[i][j];
	for (int i = 0; i < N; i++)for (int j = 0; j < 11; j++)cin >> P[i][j];

	int ans = INT32_MIN;
	for (int i = 1; i < pow(2, 10); i++) {
		vector<char>used(10);
		for (int j = 0; j < 10; j++)used[j] = (i>>j) & 1;

		vector<int>cnt(N);
		for (int j = 0; j < 10; j++) {
			for (int k = 0; k < N; k++) {
				if (used[j] && F[k][j])cnt[k]++;
			}
		}

		int sum = 0;
		for (int j = 0; j < N; j++)sum += P[j][cnt[j]];
		ans = max(ans , sum);
	}

	cout << ans << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:19: error: 'INT32_MIN' was not declared in this scope
   14 |         int ans = INT32_MIN;
      |                   ^~~~~~~~~
a.cc:15:29: error: 'pow' was not declared in this scope
   15 |         for (int i = 1; i < pow(2, 10); i++) {
      |                             ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int N=1e5+10,INF=0x3f3f3f3f;
int f[N][15];
int p[N][15];
int temp[N];
int main()
{
    ios_base::sync_with_stdio(0);
    int n;
	cin>>n;
    for(int i=0;i<n;i++)
	{
        for(int j=0;j<10;j++)
		{
            cin>>f[i][j];
        }
    }
    for(int i=0;i<n;i++)
	{
        for(int j=0;j<=10;j++)
		{
            cin>>p[i][j];
        }
    }
    ll res=-INF;
    for(int i=1;i<(1<<10);i++)
	{
        memset(temp,0,sizeof temp);
        for(int j=0;j<n;j++)
		{
            for(int k=0;k<10;k++)
			{
                if(f[j][k] && ((1<<k)&i))
				{
                    temp[j]++;
                }
            }
        }
        ll t=0;
        for(int j=0;j<n;j++)
		{
            t+=p[j][temp[j]];
        }
        res=max(res,t);
    }
    cout<<res<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:5: error: 'll' was not declared in this scope
   26 |     ll res=-INF;
      |     ^~
a.cc:40:11: error: expected ';' before 't'
   40 |         ll t=0;
      |           ^~
      |           ;
a.cc:43:13: error: 't' was not declared in this scope
   43 |             t+=p[j][temp[j]];
      |             ^
a.cc:45:9: error: 'res' was not declared in this scope
   45 |         res=max(res,t);
      |         ^~~
a.cc:45:21: error: 't' was not declared in this scope
   45 |         res=max(res,t);
      |                     ^
a.cc:47:11: error: 'res' was not declared in this scope
   47 |     cout<<res<<endl;
      |           ^~~
Language: C++

#include <cstdio > int N; int F[100][14]; int P[100][15]; int main() { scanf("%d",&N); for(int i=0;i<N;i++) { for(int j=0;j<10;j++)scanf("%d",&F[i][j]); } for(int i=0;i<N;i++)for(int j=0;j<11;j++)scanf("%d",&P[i][j]); int res=-(1<<30); for(int b=1;b<(1<<10);b++) { int cc=0; for(int i=0;i<N;i++) { int c=0; for(int j=0;j<10;j++)if((b>>j&1)&&F[i][j])c++; cc+=P[i][c]; } if(res<cc)res=cc; } printf("%d\n",res); }


Compiler output:
a.cc:1:20: warning: extra tokens at end of #include directive
    1 | #include <cstdio > int N; int F[100][14]; int P[100][15]; int main() { scanf("%d",&N); for(int i=0;i<N;i++) { for(int j=0;j<10;j++)scanf("%d",&F[i][j]); } for(int i=0;i<N;i++)for(int j=0;j<11;j++)scanf("%d",&P[i][j]); int res=-(1<<30); for(int b=1;b<(1<<10);b++) { int cc=0; for(int i=0;i<N;i++) { int c=0; for(int j=0;j<10;j++)if((b>>j&1)&&F[i][j])c++; cc+=P[i][c]; } if(res<cc)res=cc; } printf("%d\n",res); }
      |                    ^~~
a.cc:1:10: fatal error: cstdio : No such file or directory
    1 | #include <cstdio > int N; int F[100][14]; int P[100][15]; int main() { scanf("%d",&N); for(int i=0;i<N;i++) { for(int j=0;j<10;j++)scanf("%d",&F[i][j]); } for(int i=0;i<N;i++)for(int j=0;j<11;j++)scanf("%d",&P[i][j]); int res=-(1<<30); for(int b=1;b<(1<<10);b++) { int cc=0; for(int i=0;i<N;i++) { int c=0; for(int j=0;j<10;j++)if((b>>j&1)&&F[i][j])c++; cc+=P[i][c]; } if(res<cc)res=cc; } printf("%d\n",res); }
      |          ^~~~~~~~~
compilation terminated.
Language: C++


#include<bits/stdc++.h>

using namespace std;

const int N = 1e5 + 10, INF = 0x3f3f3f3f ;

int f[N][15];
int p[N][15];
int temp[N];

int main(){
    ios_base::sync_with_stdio(0);
    int n;cin>>n;
    for(int i = 0;i < n;i++) {
        for(int j = 0;j < 10;j++) {
            cin>>f[i][j];
        }
    }
    for(int i = 0;i < n;i++) {
        for(int j = 0;j <= 10;j++) {
            cin>>p[i][j];
        }
    }
    ll res = -INF;
    for(int i = 1;i < (1<<10);i++) {
        memset(temp,0,sizeof temp);
        for(int j = 0;j < n;j++) {
            for(int k = 0;k < 10;k++) {
                if(f[j][k] && ((1<<k)&i)) {
                    temp[j]++;
                }
            }
        }
        ll t = 0;
        for(int j = 0;j < n;j++) {
            t += p[j][temp[j]];
        }
        res = max(res,t);
    }
    cout<<res<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:5: error: 'll' was not declared in this scope
   25 |     ll res = -INF;
      |     ^~
a.cc:35:11: error: expected ';' before 't'
   35 |         ll t = 0;
      |           ^~
      |           ;
a.cc:37:13: error: 't' was not declared in this scope
   37 |             t += p[j][temp[j]];
      |             ^
a.cc:39:9: error: 'res' was not declared in this scope
   39 |         res = max(res,t);
      |         ^~~
a.cc:39:23: error: 't' was not declared in this scope
   39 |         res = max(res,t);
      |                       ^
a.cc:41:11: error: 'res' was not declared in this scope
   41 |     cout<<res<<endl;
      |           ^~~
Language: C

#include <cstdio > int N;
int F[100][14]; int P[100][15]; int main ()
{
scanf("%d",&N); for(int i=0;i<N;i++) {
for(int j=0;j<10;j++)scanf("%d",&F[i][j]);
}
for(int i=0;i<N;i++)for(int j=0;j<11;j++)scanf("%d",&P[i][j]); int res = -(1 < <30);
for(int b=1;b<(1<<10);b++)
{
int cc =0;
for(int i=0;i<N;i++) {
int c=0;
for(int j=0;j<10;j++)if((b>>j&1)&&F[i][j])c++; cc+=P[i][c];
} if(res<cc)res=cc;
} printf("%d\n",res);
}

Compiler output:
main.c:1:20: warning: extra tokens at end of #include directive
    1 | #include <cstdio > int N;
      |                    ^~~
main.c:1:10: fatal error: cstdio : No such file or directory
    1 | #include <cstdio > int N;
      |          ^~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <limits.h>
typedef long long ll;

using namespace std;

int f[100][10];
int cnt[100];
ll p[100][11];

int main()
{
	int n,now;
	ll pp=0;
	ll max=LLONG_MIN;
	ll ans=0;
	
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cnt[i]=0;
		for(int j=0;j<10;j++)
		{
			cin>>f[i][j];
		}
	}
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<11;j++)
		{
			cin>>p[i][j];
		}
	}

	//ここから解答
	for(int i=1;i<1024;i++)
	{
		//各種変数の初期化
		pp=0;
		for(int j=0;j<n;j++)
		{
			cnt[j]=0;
		}
		//店ごとに開いている時間数を求める
		for(int j=0;j<n;j++)
		{
			for(int k=0;k<10;k++)
			{
				now = i&(int)pow(2,k);//いまチェックしている時間
				if(now==(int)pow(2,k)&&f[j][k]==1)
				{
					cnt[j]++;
				}
			}
		}
		
		/*for(int j=0;j<n;j++)
		{
			cerr<<i<<":"<<cnt[j]<<endl;
		}*/
		//利益を求める
		for(int j=0;j<n;j++)
		{
			pp+=p[j][cnt[j]];
		}
		//最大値と比較する
		if(pp>max)
		{
			max=pp;
		}
	}
	cout<<max<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:46: error: 'pow' was not declared in this scope; did you mean 'now'?
   52 |                                 now = i&(int)pow(2,k);//いまチェックしている時間
      |                                              ^~~
      |                                              now
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <limits.h>
typedef long long ll;

using namespace std;

int f[100][10];
int cnt[100];
ll p[100][11];

int main()
{
	int n,now;
	ll pp=0;
	ll max=LLONG_MIN;
	ll ans=0;
	
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cnt[i]=0;
		for(int j=0;j<10;j++)
		{
			cin>>f[i][j];
		}
	}
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<11;j++)
		{
			cin>>p[i][j];
		}
	}

	//ここから解答
	for(int i=1;i<(int)pow(2,10);i++)
	{
		//各種変数の初期化
		pp=0;
		for(int j=0;j<n;j++)
		{
			cnt[j]=0;
		}
		//店ごとに開いている時間数を求める
		for(int j=0;j<n;j++)
		{
			for(int k=0;k<10;k++)
			{
				now = i&(int)pow(2,k);//いまチェックしている時間
				if(now==(int)pow(2,k)&&f[j][k]==1)
				{
					cnt[j]++;
				}
			}
		}
		
		/*for(int j=0;j<n;j++)
		{
			cerr<<i<<":"<<cnt[j]<<endl;
		}*/
		//利益を求める
		for(int j=0;j<n;j++)
		{
			pp+=p[j][cnt[j]];
		}
		//最大値と比較する
		if(pp>max)
		{
			max=pp;
		}
	}
	cout<<max<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:28: error: 'pow' was not declared in this scope; did you mean 'now'?
   39 |         for(int i=1;i<(int)pow(2,10);i++)
      |                            ^~~
      |                            now
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <limits.h>
typedef long long ll;

using namespace std;

int f[100][10];
int cnt[100];
ll p[100][11];

int main()
{
	int n,now;
	ll pp=0;
	ll max=LLONG_MIN;
	ll ans=0;
	
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cnt[i]=0;
		for(int j=0;j<10;j++)
		{
			cin>>f[i][j];
		}
	}
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<11;j++)
		{
			cin>>p[i][j];
		}
	}

	//ここから解答
	for(int i=1;i<pow(2,10);i++)
	{
		//各種変数の初期化
		pp=0;
		for(int j=0;j<n;j++)
		{
			cnt[j]=0;
		}
		//店ごとに開いている時間数を求める
		for(int j=0;j<n;j++)
		{
			for(int k=0;k<10;k++)
			{
				now = i&(int)pow(2,k);//いまチェックしている時間
				if(now==(int)pow(2,k)&&f[j][k]==1)
				{
					cnt[j]++;
				}
			}
		}
		
		/*for(int j=0;j<n;j++)
		{
			cerr<<i<<":"<<cnt[j]<<endl;
		}*/
		//利益を求める
		for(int j=0;j<n;j++)
		{
			pp+=p[j][cnt[j]];
		}
		//最大値と比較する
		if(pp>max)
		{
			max=pp;
		}
	}
	cout<<max<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:23: error: 'pow' was not declared in this scope; did you mean 'now'?
   39 |         for(int i=1;i<pow(2,10);i++)
      |                       ^~~
      |                       now
Language: Java

import java.util.*;

public class HelloWorld{
public static Scanner sc = new Scanner (System.in);
     public static void main(String []args){
        
        int N = sc.nextInt();
        int[][] F = input(N,10);
        int[][] P = input(N,11);
        int ans = 0;
        //System.out.println(Arrays.toString(F[0]));
        for (int b=1;b<(1<<10);b++){
            int cc = 0;
            for (int i=0;i<N;i++){
                int c = 0;
                for(int j=0;j<10;j++)if(((b>>(9-j)&1)==F[i][j])&&F[i][j]==1)c++;
                cc += P[i][c];
            }
            if(b==1)ans=cc;
            ans = Math.max(ans,cc);
        }
        //for(int i=0;i<N;i++)System.out.println(Arrays.toString(F[i]));
        //for(int i=0;i<N;i++)System.out.println(Arrays.toString(P[i]));
        System.out.println(ans);
        
     }
     
     public static int[][] input(int N,int n){
         int[][] a = new int[N][n];
         for (int i=0;i<N;i++) for (int j=0;j<n;j++) a[i][j]=sc.nextInt();
         return a;
     }
}

Compiler output:
Main.java:3: error: class HelloWorld is public, should be declared in a file named HelloWorld.java
public class HelloWorld{
       ^
1 error
Language: C++

3
1 1 1 1 1 1 0 0 1 1
0 1 0 1 1 1 1 0 1 0
1 0 1 1 0 1 0 1 0 1
-8 6 -2 -8 -8 4 8 7 -6 2 2
-9 2 0 1 7 -5 0 -2 -6 5 5
6 -6 7 -9 6 -5 8 0 -9 -7 -7

Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 3
      | ^
Language: C++

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
using namespace std;
int main(){
    int N;
    scanf("%d", &N);
    vector<vector<int> > f(N, vector<int>(10));
    for(int i = 0; i < N; i++){
        for(int j = 0; j < 10; j++){
            scanf("%d", &f[i][j]);
        }
    }

    vector<vector<int> > p(N, vector<int>(11));
    for(int i = 0; i < N; i++){
        for(int j = 0; j < 11; j++){
            scanf("%d", &p[i][j]);
        }
    }

    int max_profit = -1e11;
    for(unsigned int i = 1; i < pow(2, 10); i++){
        int profit = 0;
        for(int j = 0; j < N; j++){
            int cnt = 0;
            for(int k = 0; k < 10; k++){
                if(i >> k & (unsigned int) 1)
                    cnt += f[j][k];
            }
            profit += p[j][cnt];
        }
        max_profit = max(max_profit, profit);
    }
    printf("%d\n", max_profit);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'vector' was not declared in this scope
    9 |     vector<vector<int> > f(N, vector<int>(10));
      |     ^~~~~~
a.cc:5:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    4 | #include<cmath>
  +++ |+#include <vector>
    5 | using namespace std;
a.cc:9:19: error: expected primary-expression before 'int'
    9 |     vector<vector<int> > f(N, vector<int>(10));
      |                   ^~~
a.cc:12:26: error: 'f' was not declared in this scope
   12 |             scanf("%d", &f[i][j]);
      |                          ^
a.cc:16:19: error: expected primary-expression before 'int'
   16 |     vector<vector<int> > p(N, vector<int>(11));
      |                   ^~~
a.cc:19:26: error: 'p' was not declared in this scope
   19 |             scanf("%d", &p[i][j]);
      |                          ^
a.cc:23:22: warning: overflow in conversion from 'double' to 'int' changes value from '-1.0e+11' to '-2147483648' [-Woverflow]
   23 |     int max_profit = -1e11;
      |                      ^~~~~
a.cc:30:28: error: 'f' was not declared in this scope
   30 |                     cnt += f[j][k];
      |                            ^
a.cc:32:23: error: 'p' was not declared in this scope
   32 |             profit += p[j][cnt];
      |                       ^
Language: C++

scanf ("% d " ,& N );
for ( int i =0; i < N ; i ++)
{
for ( int j =0; j <10; j ++) scanf ("% d " ,& F [ i ][ j ]);
}
for ( int i =0; i < N ; i ++) for ( int j =0; j <11; j ++) scanf ("% d " ,& P [ i ][ j ]);
int res = -(1 < <30);
for ( int b =1; b <(1 < <10); b ++)
{
int cc =0;
for ( int i =0; i < N ; i ++)
{
int c =0;
for ( int j =0; j <10; j ++) if (( b > > j &1)&& F [ i ][ j ]) c ++;
cc += P [ i ][ c ];
}
if ( res < cc ) res = cc ;
}
printf ("% d \ n " , res );

Compiler output:
a.cc:1:7: error: expected constructor, destructor, or type conversion before '(' token
    1 | scanf ("% d " ,& N );
      |       ^
a.cc:2:1: error: expected unqualified-id before 'for'
    2 | for ( int i =0; i < N ; i ++)
      | ^~~
a.cc:2:17: error: 'i' does not name a type
    2 | for ( int i =0; i < N ; i ++)
      |                 ^
a.cc:2:25: error: 'i' does not name a type
    2 | for ( int i =0; i < N ; i ++)
      |                         ^
a.cc:6:1: error: expected unqualified-id before 'for'
    6 | for ( int i =0; i < N ; i ++) for ( int j =0; j <11; j ++) scanf ("% d " ,& P [ i ][ j ]);
      | ^~~
a.cc:6:17: error: 'i' does not name a type
    6 | for ( int i =0; i < N ; i ++) for ( int j =0; j <11; j ++) scanf ("% d " ,& P [ i ][ j ]);
      |                 ^
a.cc:6:25: error: 'i' does not name a type
    6 | for ( int i =0; i < N ; i ++) for ( int j =0; j <11; j ++) scanf ("% d " ,& P [ i ][ j ]);
      |                         ^
a.cc:6:47: error: 'j' does not name a type
    6 | for ( int i =0; i < N ; i ++) for ( int j =0; j <11; j ++) scanf ("% d " ,& P [ i ][ j ]);
      |                                               ^
a.cc:6:54: error: 'j' does not name a type
    6 | for ( int i =0; i < N ; i ++) for ( int j =0; j <11; j ++) scanf ("% d " ,& P [ i ][ j ]);
      |                                                      ^
a.cc:7:17: error: expected primary-expression before '<' token
    7 | int res = -(1 < <30);
      |                 ^
a.cc:8:1: error: expected unqualified-id before 'for'
    8 | for ( int b =1; b <(1 < <10); b ++)
      | ^~~
a.cc:8:17: error: 'b' does not name a type
    8 | for ( int b =1; b <(1 < <10); b ++)
      |                 ^
a.cc:8:31: error: 'b' does not name a type
    8 | for ( int b =1; b <(1 < <10); b ++)
      |                               ^
a.cc:19:8: error: expected constructor, destructor, or type conversion before '(' token
   19 | printf ("% d \ n " , res );
      |        ^
Language: C++

#include <iostream>
#include <cctype>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <string>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
typedef long long ll;
const int INF = 100000000, mod = 1000000007;
using namespace std;

int n, f[100][10], p[100][10], ans = 0;

int main() {
    cin >> n;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < 10; j++) cin >> f[i][j];
    }
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < 10; j++) cin >> p[i][j];
    }
    for (int work = 1; work < (1 << 10); work++) {
        int t = 0;
        for (int i = 0; i < n; i++) {
            int count = 0;
            for (int j = 0; j < 10; j++) if ((work >> j & 1) && f[i][j]) count++;
            t += p[i][c];
        }
        if (ans < t) ans = t;
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:23: error: 'c' was not declared in this scope
   35 |             t += p[i][c];
      |                       ^
Language: C++

//問題URL
//

//解き方メモ
//
    
#include<iostream>
#include<vector>
using namespace std;

#define MAX_SHOP_NUM 100
#define TZ_NUM 10

int main(){
  int n;
  vector<int> f;
  vector< vector<int> > p;
  int max_sum = INT_MIN;

  //input
  cin >> n;

  f.resize(n);
  p.resize(n);

  //Fは２進数表記とする
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < TZ_NUM; j++) {
      int tmp;
      cin >> tmp;

      f[i] <<= 1; //左シフト
      if(tmp == 1){
	f[i] += 0x1;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    p[i].resize(10);
    for (int j = 0; j < TZ_NUM+1; j++) {
      cin >> p[i][j];
    }
  }

  //proc
  int tz = 1;
  while (tz < 0x400) { //11111111までループ

    int tmp_sum = 0;
    for (int i = 0; i < (int)f.size(); i++) {
      //cout << i << ")";
      int tz_diff = f[i] & tz; //tz_diff:時間帯が重なるビットが1
      int cnt = 0;
      while(tz_diff>0){
	cnt += tz_diff & 0x1;
	tz_diff >>= 1;
	//cout << cnt << ",";
      }
      tmp_sum += p[i][cnt];
    }
    //cout << tz << "," << ","<< tmp_sum << endl;
    max_sum = max(max_sum,tmp_sum);
    tz += 0x1;
  }
  //cout << p[1][0] << endl;;

  cout << max_sum << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'INT_MIN' was not declared in this scope
   18 |   int max_sum = INT_MIN;
      |                 ^~~~~~~
a.cc:9:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    8 | #include<vector>
  +++ |+#include <climits>
    9 | using namespace std;
Language: Java

import java.util.Scanner;
 
class Main {
  public static void main(Stirng[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int[][] F = new int[N.length][10];
    int[][] P = new int[N.length][11];
    int[] PSum = new int[10];
    int[] count = new int[N.length];
    int sum = 0;
    for(int i=0;i<N.length;i++){
      for(int j= 0;j<9;j++){
        F[i][j] = sc.nextInt();
      }
    }
    for(int i=0;i<N.length-1;i++){
      for(int j= 0;j<10;j++){
        P[i][j] = sc.nextInt();
      }
    }
    for(int i=0;i<N.length-1;i++){
      for(int j=0;j<9;i++){
        if(F[i][j]==1){
          count[i]++;
        }
      }
      for(int j=0;j<9;i++){
        PSum[j] += P[count[i]][j];
      }
    }
    for(int j=0;j<9;j++){
      if((sum <= 0) && (sum >= PSum[j])) sum = PSum[j];
      else if(sum >= 0) sum += PSum[j];
    }
    System.out.println(sum);
  }
} 

Compiler output:
Main.java:4: error: cannot find symbol
  public static void main(Stirng[] args){
                          ^
  symbol:   class Stirng
  location: class Main
Main.java:7: error: int cannot be dereferenced
    int[][] F = new int[N.length][10];
                         ^
Main.java:8: error: int cannot be dereferenced
    int[][] P = new int[N.length][11];
                         ^
Main.java:10: error: int cannot be dereferenced
    int[] count = new int[N.length];
                           ^
Main.java:12: error: int cannot be dereferenced
    for(int i=0;i<N.length;i++){
                   ^
Main.java:17: error: int cannot be dereferenced
    for(int i=0;i<N.length-1;i++){
                   ^
Main.java:22: error: int cannot be dereferenced
    for(int i=0;i<N.length-1;i++){
                   ^
7 errors
Language: Java

import java.util.Scanner;

class Main {
  public static void main(Stirng[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int[][] F = new int[N.length][10];
    int[][] P = new int[N.length][11];
    int[] PSum = new int[10];
    int[] count = new int[N.length];
    int sum = 0;
    for(int i=0;i<N.length;i++){
      for(int j= 0;j<9;j++){
        F[i][j] = sc.nextInt();
      }
    }
    for(int i=0;i<N.length-1;i++){
      for(int j= 0;j<10;j++){
        P[i][j] = sc.nextInt();
      }
    }
    for(int i=0;i<N.length-1;i++){
      for(int j=0;j<9;i++){
        if(F[i][j]==1){
          count[i]++;
        }
      }
      for(int j=0;j<9;i++){
        PSum[j] += P[count[i]][j];
      }
    }
    for(int j=0;j<9;j++){
      if((sum <= 0) && (sum >= PSum[j])) sum = PSum[j];
      else if(sum >= 0) sum += PSum[j];
    }
    System.out.println(sum);

Compiler output:
Main.java:36: error: reached end of file while parsing
    System.out.println(sum);
                            ^
1 error
Language: C++

#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> ii;
typedef pair<ll, ll> pll;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;

#define getBit(x,i) (x&(1<<i))
#define setBit(x,i) (x|(1<<i))
#define mem(A,N) memset(A,N,sizeof(A))
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define mp make_pair
#define rep(i, x, y)  for(int i = x; i < y; ++i)
#define Rep(i, x, y)  for(int i = x; i <= y; ++i)
#define srep(i, x, y) for(int i = x; i > y; --i)
#define sRep(i, x, y) for(int i = x; i >= y; --i)
#define all(v) v.begin(),v.end()
#define Sort(x) sort(x.begin(), x.end())
#define f1(i,n) for (int i=1; i<=n; i++)
#define f0(i,n) for (int i=0; i<n; i++)
#define sz(x) ((int)(x).size())
#define len(x) ((int)(x).length())
#define fi first
#define se second

#define linf 0x7FFFFFFFFFFFFFFF
#define inf 0x7FFFFFFF
#define mod 1000000007
#define eps 1e-9
#define Pi 3.14159265358979323846

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl
#define write(x) cerr << #x << " = " << (x) << ", "
#define writeI0 cerr << "i = " << 0 << ", "
#define dumpI0 cerr << "i = " << 0 << endl
#define printSet(x) for(auto it = s.begin(); it!=s.end(); it++) (it==s.begin())? cout << *it : cout << ' ' << *it; cout << endl;
#define printVector(x) for(auto it = x.begin(); it!=x.end(); it++) (it==x.begin())? cout << *it : cout << ' ' << *it; cout << endl;
#define printArray(a,x,y) for(auto it = a+x; it != a+y; it++) (it==a+x)? cout << *it : cout << ' ' << *it; cout << endl;
#define PrintArray(a,x,y) for(auto it = a+x; it != a+y+1; it++) (it==a+x)? cout << *it : cout << ' ' << *it; cout << endl;

// ***************** End Of Template ********************

int a[1000][5][2];
int b[1000][10];
int n;
ll dp[100];
ll f(int i) {
    if(i == n) return 0;
    if(dp[i] != n) return dp[i];
    ll sol = b[i][0] + dp(i+1);
    int c = 0;
    rep(j, 0, 5)
        rep(k, 0, 2) {
            if(a[i][j][k] == 1) {
                c++;
            }
        }
    rep(j, 1, c) {
        sol = max(sol, b[i][j] + dp(i+1));
    }
    return dp[i] = sol;

}

int main() {
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    cin >> n;
    rep(i, 0, n)
        rep(j, 0, 5)
            rep(k, 0, 2)
                cin >> a[i][j][k];
    rep(i, 0, n)
        rep(j, 0, 10)
            cin >> b[i][j];

    cout << f(0);
    return 0;
}


Compiler output:
a.cc: In function 'll f(int)':
a.cc:60:26: error: 'dp' cannot be used as a function
   60 |     ll sol = b[i][0] + dp(i+1);
      |                        ~~^~~~~
a.cc:69:36: error: 'dp' cannot be used as a function
   69 |         sol = max(sol, b[i][j] + dp(i+1));
      |                                  ~~^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
#define LL long long

int f[105][6][3];
int p[105][11];

int main()
{

    int n;
    cin >> n;
    for(int i = 0; i < n; i++)
        for(int j = 0; j < 5; j++)
            for(int k = 0; k < 2; k++)
                scanf("%d", &f[i][j][k]);
    int aaa;
    for(int i = 0; i < n; i++)
    {
        for(int j = 0; j <= 10; j++)
            scanf("%d", &p[i][j]);
    }
    int ans = -INF;
    for(int ll = 1; ll < 1024; ll++)
    {
        int sw[10];
        int kk = ll;
        int ansn = 0;
        for(int j = 0; j < 10; j++)
        {
            sw[j] = kk % 2;
            kk = kk / 2;
        }
        for(int i = 0; i < n; i++)
        {
            int sum = 0;
            int cnt = 0;
            for(int j = 0; j < 5; j++)
            {
                for(int k = 0; k < 2; k++)
                {
                    sum += f[i][j][k]*sw[cnt++];
                }
            }
            ansn += p[i][sum];
        }
        ans = max(ans, ansn);
    }

    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:16: error: 'INF' was not declared in this scope
   24 |     int ans = -INF;
      |                ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
const int INF = 100000000;
int BitCount(int64_t x) {
	x = (x & 0x5555555555555555) + (x >>  1 & 0x5555555555555555);
	x = (x & 0x3333333333333333) + (x >>  2 & 0x3333333333333333);
	x = (x & 0x0f0f0f0f0f0f0f0f) + (x >>  4 & 0x0f0f0f0f0f0f0f0f);
	x = (x & 0x00ff00ff00ff00ff) + (x >>  8 & 0x00ff00ff00ff00ff);
	x = (x & 0x0000ffff0000ffff) + (x >> 16 & 0x0000ffff0000ffff);
	x = (x & 0x00000000ffffffff) + (x >> 32 & 0x00000000ffffffff);
	return (int)(x);
}
int main() {
	int N;
	cin >> N;
	int F[1000];
	int P[100][100];
	for(int i = 0; i < N; i++) {
		int t;
		F[i] = 0;
		for(int j = 0; j < 10; j++) {
			cin >> t;
			F[i] |= t << j;
		}
	}
	for(int i = 0; i < N; i++) {
		for(int j = 0; j < 11; j++) {
			cin >> P[i][j];
		}
	}
	int ans = -INF;
	for(int i = 1; i < 1024; i++) {
		int64_t prof = 0;
		if(BitCount(i) == 0) continue;
		for(int j = 0; j < N; j++) {
			prof += P[j][BitCount(i & F[j])];
		}
		ans = max(prof, ans);
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:26: error: no matching function for call to 'max(int64_t&, int&)'
   38 |                 ans = max(prof, ans);
      |                       ~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:38:26: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'int')
   38 |                 ans = max(prof, ans);
      |                       ~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:38:26: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   38 |                 ans = max(prof, ans);
      |                       ~~~^~~~~~~~~~~