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

#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define rfor(i, a, b) for(int i = a; i < (int)b; i++)
#define all(ary) (ary).begin(), (ary).end()
#define debug(x) cerr << #x << ": " << x << '\n'
const long long INF = 1LL << 60;
const int MOD = 1000000007; // 1e9 + 7
using namespace std;
using vec = vector<int>;
using ll = long long;
template <class T = int> T in(){ T x; cin >> x; return (x);}
template <class T> inline bool chmin(T &a, T b) { if ( a > b ) { a = b; return 1; } return 0; }
template <class T> inline bool chmax(T &a, T b) { if ( a < b ) { a = b; return 1; } return 0; }
const int dy[4] = {-1, 0, 0, 1};
const int dx[4] = {0, -1, 1, 0};

int N, F[101][101], P[101][101];
ll res = -INF;

int main(int argc, char *argv[]){
    cin >> N;
    rep(i, N) rep(j, 10) cin >> F[i][j];
    rep(i, N) rep(j, 11) cin >> P[i][j];
    rfor(i, 1, 1 << 10){
        int sum = 0;
        rep(j, N){
            int c = 0;
            rep(k, 10)
                if(i & (1 << k) && F[i][j])
                    c++;
            sum += P[i][c];
        }
        res = max(res, sum);
    }
    cout << res << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:33:18: error: no matching function for call to 'max(ll&, int&)'
   33 |         res = max(res, sum);
      |               ~~~^~~~~~~~~~
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:33:18: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   33 |         res = max(res, sum);
      |               ~~~^~~~~~~~~~
/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:33:18: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   33 |         res = max(res, sum);
      |               ~~~^~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
    int N; cin >> N;
    int F[N][10];
    int P[N][11];
    ll ans = -1e8;

    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];
        }
    }

    for (int bits = 1; bits < 2**10; bits++) {
       ll sum = 0;
       for (int i = 0; i < N; i++) {
          int cnt = 0;
          for (int j = 0; j < 10; j++) {
             if (((bits>>j)&1) && F[i][j]) cnt++;
          }
          sum += P[i][cnt];
       }
       ans = max(ans, sum);
    }

    cout << ans << endl;

    return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:33: error: invalid type argument of unary '*' (have 'int')
   22 |     for (int bits = 1; bits < 2**10; bits++) {
      |                                 ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  cin >>n;
  vector<int> a(n);
  for( int i =0;i<n;i++){
    for(int j=0;j<10;j++){
      int b;
      cin >> b;
      a.at(i) +=b;
    }
  }
  long ans =0;
  bool op =false;
  vector<vector<int>>p(n,vector<int>(11));
  for(int i=0;i<n;i++){
    int mise = a.at(i);
    int kari = -10000000;
    for(int j=0;j<11;j++){
      cin >> p.at(i).at(j);
      if(j<=mise){
        kari= max(kari,p.at(i).at(j));
        if(op==false&& j>=1&&kari==p.at(i).at(j)){
          op=true;
        }
      }
      
    }
    ans +=kari;
  }
  if(op ){
    cout << ans;
  }
  else{
    ans = -10000000;
    for(int i=0;i<n;i++){
      ans = max(ans,p.at(i).at(1));
    }
    cout <<ans;
  }
      
      
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:16: error: no matching function for call to 'max(long int&, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
   39 |       ans = max(ans,p.at(i).at(1));
      |             ~~~^~~~~~~~~~~~~~~~~~~
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:39:16: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'})
   39 |       ans = max(ans,p.at(i).at(1));
      |             ~~~^~~~~~~~~~~~~~~~~~~
/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:39:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   39 |       ans = max(ans,p.at(i).at(1));
      |             ~~~^~~~~~~~~~~~~~~~~~~
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: In function 'int main()':
a.cc:13:19: error: expected primary-expression before '<' token
   13 |   int res = -(1 < <30);
      |                   ^
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: In function 'int main()':
a.cc:9:80: error: expected primary-expression before '<' token
    9 | for(int i=0;i<N;i++)for(int j=0;j<11;j++)scanf("%d",&P[i][j]); int res = -(1 < <30);
      |                                                                                ^
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<string>

using namespace std;

int ans = 0; int N = 0;
int a[10]; int F[110][10]; int P[110][11];

void func(void){
  
  int sum = 0; 
  
  for(int i = 0; i < N; i++){
    int cnt = 0;
    for(int j = 0; j < 10; j++){
      if(a[j] == 1 && F[i][j] == 1){  cnt++;}}
      sum += P[i][cnt];}
  
  ans = max(ans,sum);}}


void dfs(int pos){ //a[10] に01列を出力する
  if(pos == 10){ func(); return;}
  a[pos] = 0; dfs(pos + 1);
  a[pos] = 1; dfs(pos + 1);}

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 < 11; j++){
      cin >> P[i][j];}}
  
  dfs(0);
  
  cout << ans << endl;
  
  return 0;}




Compiler output:
a.cc:21:23: error: expected declaration before '}' token
   21 |   ans = max(ans,sum);}}
      |                       ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main () {
  int N;
  cin >> N;
  vector<vector<int>>sh(N, vector<int>(10));
  for (int i = 0; i < N; i ++) {
    for (int j = 0; j < 10; j ++) {
      cin >> sh[i][j];
    }
  }
  vector<vector<int>>pro(N, vector<int>(10));
  for (int i = 0; i < N; i ++) {
    for (int j = 0; j < 10; j ++) {
      cin >> pro[i][j];
    }
  }
  int ma = 1024;
  int ans = -1000000005;
  for (int i_ = 0; i_ < ma; i_ ++) {
    vector<int>num(N, 0);
    int i = i_;
    int l = 0;
    for (int j = 0; j < 10; j ++) {
      for (int k = 0; k < N; k ++) {
        if (j % 2 && sh[k][j]) num[k] ++;
      }
    }
    for (int j = 0; j < N; j ++) l += pro[num[j]];
    if (ans < l) ans = l;
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:36: error: no match for 'operator+=' (operand types are 'int' and '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'})
   30 |     for (int j = 0; j < N; j ++) l += pro[num[j]];
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main () {
  int N;
  cin >> N;
  vector<vector<int>>sh(N, vector<int>(10));
  for (int i = 0; i < N; i ++) {
    for (int j = 0; j < 10; j ++) {
      cin >> sh[i][j];
    }
  }
  vector<vector<int>>pro(N, vector<int>(10));
  for (int i = 0; i < N; i ++) {
    for (int j = 0; j < 10; j ++) {
      cin >> pro[i][j];
    }
  }
  int ma = 1024;
  int ans = -1000000005;
  for (int i_ = 0; i_ < ma; i_ ++) {
    vector<int>num(N, 0);
    int i = i_;
    int l = 0;
    for (int j = 0; j < 10; j ++) {
      for (int k = 0; k < N; k ++) {
        if (j % 2 && sh[k][j]) num[k] ++;
      }
    }
    for (int j = 0; j < N; j ++) l += pro[j];
    if (ans < l) ans = l;
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:36: error: no match for 'operator+=' (operand types are 'int' and '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'})
   30 |     for (int j = 0; j < N; j ++) l += pro[j];
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main () {
  int N;
  cin >> N;
  vector<vector<int>>sh(N, vector<int>(10));
  for (int i = 0; i < N; i ++) {
    for (int j = 0; j < 10; j ++) {
      cin >> sh[i][j];
    }
  }
  vector<vector<int>>pro(N, vector<int>(10));
  for (int i = 0; i < N; i ++) {
    for (int j = 0; j < 10; j ++) {
      cin >> pro[i][j];
    }
  }
  int ma = 1024;
  int ans = -1000000005;
  for (int i_ = 0; i_ < ma; i_ ++) {
    vector<int>num(N, 0);
    int i = i_;
    int l = 0;
    for (int j = 0; j < 10; j ++) {
      for (int k = 0; k < N; k ++) {
        if (j % 2 && sh[k][j]) num[k] ++;
      }
    }
    for (int j = 0; j < N; j ++) k += pro[j];
    if (ans < k) ans = k;
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:34: error: 'k' was not declared in this scope
   30 |     for (int j = 0; j < N; j ++) k += pro[j];
      |                                  ^
a.cc:31:15: error: 'k' was not declared in this scope
   31 |     if (ans < k) ans = k;
      |               ^
Language: C++

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

using namespace std;
using ll = long long;

ll calc_value(const vector<int>& v, const vector<vector<int>>& F, const vector<vector<int>>& P)
{
    vector<int> counts(F.size(), 0);

    for (int j = 0; j < v.size(); ++j) {
        if (v[j] == 0) {
            continue;
        }

        for (int i = 0; i < F.size(); ++i) {
            if (F[i][j] == 1) {
                ++counts[i];
            }
        }
    }

    ll value = 0;
    for (int i = 0; i < counts.size(); ++i) {
        value += P[i][counts[i]];
    }

    return value;
}

bool all_zero(const vector<int>& v)
{
    for (const auto& vi : v) {
        if (vi == 1) {
            return false;
        }
    }

    return true;
}

ll func(vector<int> v, int i, const vector<vector<int>>& F, const vector<vector<int>>& P)
{
    if (i >= 10) {
        if (all_zero(v)) {
            return -INT_MAX;
        }

        return calc_value(v, F, P);
    }

    ll max_value = -INT_MAX;

    v[i] = 0;
    max_value = max(max_value, func(v, i+1, F, P));
    v[i] = 1;
    max_value = max(max_value, func(v, i+1, F, P));

    return max_value;
}

int main()
{
    int N;
    cin >> N;

    vector<vector<int>> F(
        N, vector<int>(10, 0)
    );

    for (int i = 0; i < N; ++i) {
        for (int j = 0; j < 10; ++j) {
            cin >> F[i][j];
        }
    }

    vector<vector<int>> P(
        N, vector<int>(11, 0)
    );

    for (int i = 0; i < N; ++i) {
        for (int j = 0; j < 11; ++j) {
            cin >> P[i][j];
        }
    }

    vector<int> v(10, 0);
    cout << func(v, 0, F, P) << endl;

    return 0;
}


Compiler output:
a.cc: In function 'll func(std::vector<int>, int, const std::vector<std::vector<int> >&, const std::vector<std::vector<int> >&)':
a.cc:47:21: error: 'INT_MAX' was not declared in this scope
   47 |             return -INT_MAX;
      |                     ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <vector>
  +++ |+#include <climits>
    4 | 
a.cc:53:21: error: 'INT_MAX' was not declared in this scope
   53 |     ll max_value = -INT_MAX;
      |                     ^~~~~~~
a.cc:53:21: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

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

int main(){
	int n,f[100][100],p[100][11];

	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<11;j++)cin>>p[i][j];
	}

	int ans=-(1<<30);
	for(int b=0;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(ans<cc)ans=cc;
	}
	cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:37: error: expected ';' before ')' token
   11 |                 for(int j=0;j<10,j++)cin>>f[i][j];
      |                                     ^
      |                                     ;
Language: C++

import sys
sys.setrecursionlimit(10000)

N=int(input())
count=[]
F=[list(map(int,input().split())) for i in range(N)]
P=[list(map(int,input().split())) for i in range(N)]
INF=10**9

def dfs(s):
    if len(s)==10:
        if "1" not in s:
            val=-INF
        if "1" in s:
            val=0
            c=[0 for i in range(N)]
            for i in range(N):
                #F1 F2
                count=0
                for j in range(10):
                    
                    if int(int(s[j])*F[i][j]):
                        c[i]+=1
                    #print("count",count)

            for i in range(N):
                val+=P[i][c[i]]
        return val
    else:
        return max(dfs(s+"0"),dfs(s+"1"))
print(dfs(""))

Compiler output:
a.cc:18:18: error: invalid preprocessing directive #F1
   18 |                 #F1 F2
      |                  ^~
a.cc:24:22: error: invalid preprocessing directive #print
   24 |                     #print("count",count)
      |                      ^~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;
typedef map<int, int> mi;
typedef set<int> si;
#define VV(T) vector<vector< T > >
#define dump(x)  cout << #x << " = " << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) << endl

#define rep(i, n) REP(i, 0, n)                              // 0, 1, ..., n-1
#define REP(i, x, n) for(int i = x; i < n; i++)             // x, x + 1, ..., n-1
#define FOREACH(x,a) for(auto& (x) : (a) )

#define ALL(v) (v).begin() , (v).end()
#define RALL(v) (v).rbegin(), (v).rend()

#define pb push_back
#define pu push
#define mp make_pair
#define fi first
#define sc second

#define COUT(x) cout << (x) << endl
#define VECCIN(x) for(auto&youso_: (x) )cin>>youso_
#define VECCOUT(x) for(auto&youso_: (x) )cout<<youso_<<" ";cout<<endl

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int n, f[105][15], p[105][15], cnt, ans=(1<<30), c;


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    cin >> n;
    rep (i, n) rep (j, 10) cin >>f[i][j];
    rep (i, n) rep (j, 11) cin >> p[i][j];

    for (int i = 1; i < (1<<10); i++) {
        cnt = 0;
        rep (j, n) {
            c = 0;
            for (int k = 0; k < 10; k++) {
                if (i >> (k & 1)  && ff[j][k]) c++;
            }
            cnt += p[j][c];
        }
        ans = ans(max, cnt);
    }
    COUT(ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:38: error: 'ff' was not declared in this scope; did you mean 'ffs'?
   57 |                 if (i >> (k & 1)  && ff[j][k]) c++;
      |                                      ^~
      |                                      ffs
a.cc:61:18: error: 'ans' cannot be used as a function
   61 |         ans = ans(max, cnt);
      |               ~~~^~~~~~~~~~
Language: C++

#include <vector>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <cstdlib>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0;i<n;i++)
#define SORT(c) sort((c).begin(),(c).end())

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  int n;
  int f[100][14];
  int p[100][15];

  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<11;j++) {
      cin >> 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;
    }
  }

  cout << res << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:19: error: 'N' was not declared in this scope
   39 |     for(int i=0;i<N;i++) {
      |                   ^
Language: C++

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

int n,m;
int f[100][10];
long long p[100][11];

int main() {
	cin >> n >> m;
	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];
		}
	}
	int count;
	long long ans, answer = -1000000001;
	for (int i = 0; i <= pow(2, 10); i++) {
		ans = 0;
		for (int k = 0; k < n; k++) {
			int num = i;
			count = 0;
			for (int j = 0; j < 10; j++) {
				if (num % 2 == 1) {
					if (f[k][j] == 1) {
						count++;
					}
				}
				num /= 2;
			}
			ans += p[k][count];
			
		}
		answer = max(ans, answer);
	}
	cout << answer << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:30: error: 'pow' was not declared in this scope
   26 |         for (int i = 0; i <= pow(2, 10); 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("%d\n", res);

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:63: error: 'p' was not declared in this scope
   14 |     for(int i=0; i<N; i++)for(int j=0; j<11; j++)scanf("%d", &p[i][j]);
      |                                                               ^
Language: C++

#include <iostream>
#include <numeric>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <map>
using namespace std;
using ll=long long;
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define repbit(n) for(ll bit=0,bit<(1<<n),bit++)
inline constexpr int intpow(ll a,ll b){
    if(b==0) return 1;
    ll ans=intpow(a,b/2);
    return ans*ans*(b&1?a:1);
}
int main(){
    int n;
    cin>>n;
    vector<int> bits(n);
    vector<vector<ll>> f(n,vector<ll>(10)),p(n,vector<ll>(10));
    ll ans=-100000000;
    rep(i,0,n){
        rep(j,0,10){
            cin>>f[i][j];
        }
    }
    rep(i,0,n){
        rep(j,0,10){
            cin>>p[i][j];
        }
    }
    rep(i,0,n) rep(j,0,10) bits[i] |= (f[i][j]<<(9-j));
    rep(bit,0,(1<<n)){
        rep(i,0,n){
            int k=bit;
            k&=bits[i];
            ans=max(ans,p[i][ __builtin_popcount(k) ]);
        }
    }
    cout<<ans
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:14: error: expected ';' before '}' token
   42 |     cout<<ans
      |              ^
      |              ;
   43 | }
      | ~
Language: C++

#include <iostream>
#include <numeric>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <map>
using namespace std;
using ll=long long;
#define rep(i,a,b) for(ll i=a;i<b;i++)
inline constexpr int intpow(ll a,ll b){
    if(b==0) return 1;
    ll ans=intpow(a,b/2);
    return ans*ans*(b&1?a:1);
}
int main(){
    int n;
    cin>>n;
    vector<vector<ll>> f(n,vector<ll>(10)),p(n,vector<ll>(10));
    ll ans=0,cnt=0;
    vector<ll> sum(10);
    rep(i,0,n){
        rep(j,0,10){
            cin>>f[i][j];
        }
    }
    rep(i,0,n){
        rep(j,0,10){
            cin>>p[i][j];
            if(f[i][j]) sum[j]+=p[i][j];
        }
    }
    ll maxsum=-10000001;
    rep(j,0,10){
        if(maxsum<sum[j]) maxsum=sum[j];
    }
    rep(j,0,10){
        if(sum[j]>0) ans+=sum[j];
        cnt++;
    }
    if(!cnt) ans=maxsum;
    cout<<ans
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:14: error: expected ';' before '}' token
   43 |     cout<<ans
      |              ^
      |              ;
   44 | }
      | ~
Language: Java


import java.util.*;

//	import java.text.*;

public class helloworld{
	
	static int sch[][] = new int [105][10];
	
	static int pro[] = new int [1024];
	
	static int P[][] = new int [105][11];
	
	static int Y[] = new int [105];
	
	public static void main(String args[]) {
		
		Scanner scan = new Scanner(System.in); 
		
		int open[] = new int [10];
		
		int N,i,j,k;
		
		int max;
		
		N = scan.nextInt();
		
		for(i=0;i<N;i++)
			
			for(j=0;j<10;j++)
				
				sch[i][j] = scan.nextInt();
		
		for(i=0;i<N;i++)
			
			for(j=0;j<=10;j++)
				
				P[i][j] = scan.nextInt();
		
		for(i=1;i<1024;i++){
			
			for(k=0;k<N;k++)
				
			Y[k]=0;
			
			for(j=9;j>=0;j--){
				
				open[j]=(i>>(9-j))&1;
			}
			
			for(k=0;k<N;k++)
				
				for(j=0;j<10;j++)
					
					if(open[j]!=0&&sch[k][j]!=0) Y[k]++;
			
			for(k=0;k<N;k++)
				
			pro[i]+=P[k][Y[k]];
		}
		
		max=1;
		
		for(i=2;i<1024;i++)
			
			if(pro[max]<=pro[i]) max=i;
		
		System.out.println(pro[max]);
		
		scan.close();
		
		Runtime.getRuntime().exit(0);
			
	}
	
}



Compiler output:
Main.java:6: error: class helloworld is public, should be declared in a file named helloworld.java
public class helloworld{
       ^
1 error
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:11: fatal error:  cstdio : No such file or directory
    1 | # include < cstdio >
      |           ^~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main () {
  int N;
  cin >> N;
  vector<vector<int>> opendata(N,vector<int>(10));
  vector<vector<int>> valuedata(N,vector<int>(11));
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < 10; j++) {
      cin >> opendata.at(i).at(j);
    }
  }
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < 11; j++) {
      cin >> valuedata.at(i).at(j);
    }
  }
  vector<int> onoff{0,1};
  int ans = 0, counta, countb, countc, value;
  for(int a: onoff) {
    for(int b: onoff) {
      for(int c: onoff) {
        for(int d: onoff) {
          for(int e: onoff) {
            for(int f: onoff) {
              for(int g: onoff) {
                for(int h: onoff) {
                  for(int i: onoff) {
                    for(int j: onoff) {
                      value = 0,couta = 0, countb = 0, countc = 0;
                      vector<int> bin(10){a,b,c,d,e,f,g,h,i,j}
                      for(int k = 0; k < 10; i++) {
                        counta += opendata.at(0).at(k) * bin.at(k);
                        countb += opendata.at(1).at(k) * bin.at(k);
                        countc += opendata.at(2).at(k) * bin.at(k);
                      }
                      value = value.at(0).at(counta) + valuedata.at(0).at(countb) + valuedata.at(2).at(countc);
                      if (value > ans) ans = value
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:33: error: 'couta' was not declared in this scope; did you mean 'counta'?
   30 |                       value = 0,couta = 0, countb = 0, countc = 0;
      |                                 ^~~~~
      |                                 counta
a.cc:31:42: error: expected ',' or ';' before '{' token
   31 |                       vector<int> bin(10){a,b,c,d,e,f,g,h,i,j}
      |                                          ^
a.cc:37:37: error: request for member 'at' in 'value', which is of non-class type 'int'
   37 |                       value = value.at(0).at(counta) + valuedata.at(0).at(countb) + valuedata.at(2).at(countc);
      |                                     ^~
a.cc:38:51: error: expected ';' before '}' token
   38 |                       if (value > ans) ans = value
      |                                                   ^
      |                                                   ;
   39 |                     }
      |                     ~
Language: C++

#include <bits/stdc++.h>
using namespace std;

signed main(){
	int n,ma=-1000000000,ans;
	cin>>n;
	int f[n][10],p[n][10];
	vector<int>vec(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 i=1;i<(1<<10);i++){
		for(int i=0;i<n;i++){
			vec[i]=0;
		}
		int bit[10];
		for(int j=0;j<n;j++) bit[j]=(i/(1<<j))%2;
		for(int j=0;j<10;j++){
			if(bit[j]){
				for(int k=0;k<n;k++){
					if(f[k][j])vec[k]++;
				}
			}
		}
		ans=0;
		for(int j=0;j<n;j++){
			ans+=p[vec[j]];
		}
		ma=max(ma,ans);
	}
	cout<<ma<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:38: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   34 |                         ans+=p[vec[j]];
      |                                      ^
      |                                      |
      |                                      int*
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:11: fatal error: cstdio : No such file or directory
    1 | # include <cstdio >
      |           ^~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <iomanip>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string>
#include <tuple>
#include <vector>
#include <map>
#include <unordered_map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <cassert>
using namespace std;
#define LL long long
#define MP(a, b) make_pair(a, b)
#define POWER9 1000000000
#define MOD POWER9+7
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483647
#define INT_MAX 2147483647
#define LL_MIN (LL)-9223372036854775807
#define LL_MAX (LL)9223372036854775807
#define PI 3.14159265359

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << setprecision(9);
	
	int N;
	cin >> N;
	int F[100][10],P[100][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 = 0;
	for(int i=1; i<(1<<10); i++){
		int tmp = 0;
		for(int j=0; j<N; j++){
			int c = 0;
			for(int k=0; k<10; k++){
				if((i>>k)%2 == 1 && F[j][k] = 1) c++;
			}
			tmp += P[j][c];
		}
		ans = max(ans, tmp);
	}
	cout << ans << endl;

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:58:50: error: lvalue required as left operand of assignment
   58 |                                 if((i>>k)%2 == 1 && F[j][k] = 1) c++;
      |                                    ~~~~~~~~~~~~~~^~~~~~~~~~
Language: C

n = int(input())
f, p = [], []
scores = []
for i in range(n):
    f.append(int(int("".join(list(input().split())), 2)))
for i in range(n):
    p.append(list(map(int,input().split())))
for i in range(1,1024):
    score = 0
    for j in range(n):
        double = bin(i & f[j]).count("1")
        score += p[j][double]
    scores.append(score)
print(max(scores))

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | n = int(input())
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:1:5: error: expected expression before 'int'
    1 | n = int(input())
      |     ^~~
Language: C++

#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<map>
#include<numeric>
#include<set>
#include<string>
#include<utility>
#include<vector>

#define rep(i, a, n)  for(int i=a; i<n; i++)
#define per(i, a, n)  for(int i=n-1; i>=a; i--)
#define fill0(n)  setfill('0') << right << setw(n)
#define all(x)  (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define MAX 900000001
using namespace std;
typedef long long ll;

int ans = INT_MIN;
int n;
int f[100][10];
int p[100][11];
int a[10];
void calc(){
  int score = 0;
  int notAll0 = false;
  rep(i, 0, 10) if(a[i]&1) notAll0 = true;
  if(!notAll0)  return;
  rep(i, 0, n) {
    int c = 0;
    rep(j, 0, 10) {
      if(a[j]&f[i][j]) c++;
    }
    score += p[i][c];
  }
  ans = max(ans, score);
}

void dfs(int pos){
  if(pos==10){
    calc();
    return;
  }
  a[pos]=0; dfs(pos+1);
  a[pos]=1; dfs(pos+1);
}

int main(){
  cin >> n;
  rep(i, 0, n)  rep(j, 0, 10) cin >> f[i][j];
  rep(i, 0, n)  rep(j, 0, 11) cin >> p[i][j];
  dfs(0);
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc:22:11: error: 'INT_MIN' was not declared in this scope
   22 | int ans = INT_MIN;
      |           ^~~~~~~
a.cc:12:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   11 | #include<vector>
  +++ |+#include <climits>
   12 |
Language: C++

#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<map>
#include<numeric>
#include<set>
#include<string>
#include<utility>
#include<vector>

#define rep(i, a, n)  for(int i=a; i<n; i++)
#define per(i, a, n)  for(int i=n-1; i>=a; i--)
#define fill0(n)  setfill('0') << right << setw(n)
#define all(x)  (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define MAX 900000001
using namespace std;
typedef long long ll;

int ans = -MAX;
int n;
int f[100][10];
int p[100][11];
int a[10];
void calc(){
  int score = 0;
  int notAll0 = false;
  rep(i, 0, 10) if(a[i]&1) notAll0 = true;
  if(!notAll0)  return;
  rep(i, 0, n) {
    int c = 0;
    rep(j, 0, 10) {
      if(a[j]&f[i][j]) c++;
    }
    score += p[i][c];
  }
  ans = max(ans, score);
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++


#include<cmath>
#include<map>
#include<numeric>
#include<set>
#include<string>
#include<utility>
#include<vector>

#define rep(i, a, n)  for(int i=a; i<n; i++)
#define per(i, a, n)  for(int i=n-1; i>=a; i--)
#define fill0(n)  setfill('0') << right << setw(n)
#define all(x)  (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define MAX 900000001
using namespace std;
typedef long long ll;

int ans = -MAX;
int n;
int f[100][10];
int p[100][11];
int a[10];
void calc(){
  int score = 0;
  int notAll0 = false;
  rep(i, 0, 10) if(a[i]&1) notAll0 = true;
  if(!notAll0)  return;
  rep(i, 0, n) {
    int c = 0;
    rep(j, 0, 10) {
      if(a[j]&f[i][j]) c++;
    }
    score += p[i][c];
  }
  ans = max(ans, score);
}

void dfs(int pos){
  if(pos==10){
    calc();
    return;
  }
  a[pos]=0; dfs(pos+1);
  a[pos]=1; dfs(pos+1);
}

int main(){
  cin >> n;
  rep(i, 0, n)  rep(j, 0, 10) cin >> f[i][j];
  rep(i, 0, n)  rep(j, 0, 11) cin >> p[i][j];
  dfs(0);
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:3: error: 'cin' was not declared in this scope
   49 |   cin >> n;
      |   ^~~
a.cc:9:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    8 | #include<vector>
  +++ |+#include <iostream>
    9 | 
a.cc:53:3: error: 'cout' was not declared in this scope
   53 |   cout << ans << endl;
      |   ^~~~
a.cc:53:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:53:18: error: 'endl' was not declared in this scope
   53 |   cout << ans << endl;
      |                  ^~~~
a.cc:9:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    8 | #include<vector>
  +++ |+#include <ostream>
    9 |
Language: C

#include<stdio.h>
#include<string.h>
const int N = 1e5 + 10, INF = 0x3f3f3f3f ;

int a[N][15];
int b[N][15];
int temp[N];

int main(){
    int n,i;
    scanf("%d",&n);
    for(i = 0;i < n;i++) {
        for(int j = 0;j < 10;j++) {
            scanf("%d",&a[i][j]);
        }
    }
    for(int i = 0;i < n;i++) {
        for(int j = 0;j <= 10;j++) {
            scanf("%d",&b[i][j]);
        }
    }
    long long int 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(a[j][k] && ((1<<k)&i)) {
                    temp[j]++;
                }
            }
        }
        long long int t = 0;
        for(int j = 0;j < n;j++) {
            t += b[j][temp[j]];
        }
        if(res<t)
            res=t;
    }
    printf("%lld",res);
    return 0;
}

Compiler output:
main.c:5:5: error: variably modified 'a' at file scope
    5 | int a[N][15];
      |     ^
main.c:6:5: error: variably modified 'b' at file scope
    6 | int b[N][15];
      |     ^
main.c:7:5: error: variably modified 'temp' at file scope
    7 | int temp[N];
      |     ^~~~
Language: C++

#include <iostream>
using namespace std;
int main(int argc, char *argv[]) {
	int f[100][15],p[100][15],temp[100];
	int i,j,k,n,r,t;
	cin >> n;
	for(i=0;i<n;i++)
		for(j=0;j<10;j++)
			cin >> f[i][j];
	for(i=0;i<n;i++)
		for(j=0;j<=10;j++)
			cin >> p[i][j];
	r=-2147483647;
	for(i=1;i<(1<<10);i++){
		memset(temp,0,sizeof(temp));
		for(j=0;j<n;j++)
			for(k=0;k<10;k++)
				if((f[j][k])&&((i>>k)&1))
					temp[j]++;
		t=0;
		for(j=0;j<n;j++)
			t+=p[j][temp[j]];
		r=max(r,t);
	}
	cout << r;
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:15:17: error: 'memset' was not declared in this scope
   15 |                 memset(temp,0,sizeof(temp));
      |                 ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct open
{
    long period[10];
};
struct profits
{
    long momney[11];
};
int cmp(const void *a,const void *b)
{
    return *(int*)b-*(int*)a;
}
long ownpow(long x,long n)
{
    long i,result=1;
    for(i=1;i<=n;i++)
    {
        result*=x;
    }
    return result;
}
int main()
{
    long profit[1024],i,j,k,time[100],result,t,n;
    long p[1024][10];
    struct open shop[100];
    struct profits gain[100];
    for(n=1;n<1024;n++)
    {
        k=n;
        for(i=0;i<10;i++)
        {
            t=pow(2,9-i);
            if(k/t==1)
                p[n][i]=1;
            else(p[n][i]=0);
            k%=t;
        }
    }
   /* for(i=0;i<10;i++)
    {
        for(j=0;j<10;j++)
        {
            printf("%d ",p[i][j]);
        }
        printf("\n");
    }*/
    profit[0]=-25555;
    scanf("%ld",&k);
    for(i=0;i<k;i++)
    {
        for(j=0;j<10;j++)
        {
            scanf("%ld",&shop[i].period[j]);
        }
    }
    for(i=0;i<k;i++)
    {
        for(j=0;j<11;j++)
        {
            scanf("%ld",&gain[i].momney[j]);
        }
    }
    for(n=1;n<1024;n++)
    {
        for(i=0;i<k;i++)
        {
            time[i]=0;
        }
        for(i=0;i<10;i++)// 时段
        {
          for(j=0;j<k;j++)//店家
          {
              if(p[n][i]==1&&shop[j].period[i]==1)
                time[j]++;
          }
        }
        result=0;
        for(i=0;i<k;i++)
        {
            result+=gain[i].momney[time[i]];
        }
        profit[n]=result;
    }
    qsort(profit,1024,sizeof(profit[0]),cmp);
    printf("%ld\n",profit[0]);
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:36:15: error: 'pow' was not declared in this scope
   36 |             t=pow(2,9-i);
      |               ^~~
Language: C++

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct Stack
{
    int profit[10];
    int time[10];
    int top;
};
struct open
{
    int period[10];
};
struct profits
{
    int momney[11];
};
int cmp(const void *a,const void *b)
{
    return *(int*)b-*(int*)a;
}
int ownpow(int x,int n)
{
    int i,result=1;
    for(i=1;i<=n;i++)
    {
        result*=x;
    }
    return result;
}
int main()
{
    int profit[1024],i,j,k,time[100],result,t,n;
    int p[1024][10];
    struct open shop[100];
    struct profits gain[100];
    for(n=1;n<1024;n++)
    {
        k=n;
        for(i=0;i<10;i++)
        {
            t=pow(2,9-i);
            if(k/t==1)
                p[n][i]=1;
            else(p[n][i]=0);
            k%=t;
        }
    }
   /* for(i=0;i<10;i++)
    {
        for(j=0;j<10;j++)
        {
            printf("%d ",p[i][j]);
        }
        printf("\n");
    }*/
    profit[0]=-25555;
    scanf("%d",&k);
    for(i=0;i<k;i++)
    {
        for(j=0;j<10;j++)
        {
            scanf("%d",&shop[i].period[j]);
        }
    }
    for(i=0;i<k;i++)
    {
        for(j=0;j<11;j++)
        {
            scanf("%d",&gain[i].momney[j]);
        }
    }
    for(n=1;n<1024;n++)
    {
        for(i=0;i<k;i++)
        {
            time[i]=0;
        }
        for(i=0;i<10;i++)// 时段
        {
          for(j=0;j<k;j++)//店家
          {
              if(p[n][i]==1&&shop[j].period[i]==1)
                time[j]++;
          }
        }
        result=0;
        for(i=0;i<k;i++)
        {
            result+=gain[i].momney[time[i]];
        }
        profit[n]=result;
    }
    qsort(profit,1024,sizeof(profit[0]),cmp);
    printf("%d\n",profit[0]);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:15: error: 'pow' was not declared in this scope
   42 |             t=pow(2,9-i);
      |               ^~~
Language: Java

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <string>
#include <limits.h>
using namespace std;
typedef long long LL;

int shopdata[100][10];
int profitInfo[100][11];

int openPeriod[10];
int main()
{
	int N;
	cin >> N;
	for (int i = 0;i < N;i++) {
		for (int j = 0;j < 10;j++) {
			cin >> shopdata[i][j];
		}
	}
	for (int i = 0;i < N;i++) {
		for (int j = 0;j < 11;j++) {
			cin >> profitInfo[i][j];
		}
	}

	LL max = LLONG_MIN;
	for (int n = 1;n <= 1023;n++) {
		for (int k = 0;k < 10;k++) {
			openPeriod[k] = (n >> k) % 2;
		}//Generate every solution

		
		int collision[10] = { 0 };

		for (int i = 0;i < 10;i++) {//i is the period number
			if (openPeriod[i]) {
				for (int j = 0;j < N;j++) {
					if (shopdata[j][i])collision[j]++;
				}
			}
		}

		LL sum = 0;
		for (int i = 0;i < N;i++) {
			sum += profitInfo[i][collision[i]];
		}
		
		if (sum > max)max = sum;
	}
	cout << max;
	return 0;
}

Compiler output:
Main.java:1: error: illegal character: '#'
#define _CRT_SECURE_NO_WARNINGS
^
Main.java:2: error: illegal character: '#'
#include <iostream>
^
Main.java:3: error: illegal character: '#'
#include <algorithm>
^
Main.java:4: error: illegal character: '#'
#include <string>
^
Main.java:5: error: illegal character: '#'
#include <limits.h>
^
Main.java:7: error: class, interface, enum, or record expected
typedef long long LL;
^
Main.java:9: error: class, interface, enum, or record expected
int shopdata[100][10];
^
Main.java:10: error: class, interface, enum, or record expected
int profitInfo[100][11];
^
Main.java:12: error: class, interface, enum, or record expected
int openPeriod[10];
^
Main.java:16: error: not a statement
	cin >> N;
	    ^
Main.java:19: error: not a statement
			cin >> shopdata[i][j];
			    ^
Main.java:24: error: not a statement
			cin >> profitInfo[i][j];
			    ^
Main.java:35: error: not a statement
		int collision[10] = { 0 };
		                      ^
Main.java:52: error: not a statement
	cout << max;
	     ^
Main.java:13: error: unnamed classes are a preview feature and are disabled by default.
int main()
^
  (use --enable-preview to enable unnamed classes)
Main.java:35: error: ']' expected
		int collision[10] = { 0 };
		              ^
Main.java:35: error: ';' expected
		int collision[10] = { 0 };
		                       ^
17 errors
Language: C

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <string>
#include <limits.h>
using namespace std;
typedef long long LL;

int shopdata[100][10];
int profitInfo[100][11];

int openPeriod[10];
int main()
{
	int N;
	cin >> N;
	for (int i = 0;i < N;i++) {
		for (int j = 0;j < 10;j++) {
			cin >> shopdata[i][j];
		}
	}
	for (int i = 0;i < N;i++) {
		for (int j = 0;j < 11;j++) {
			cin >> profitInfo[i][j];
		}
	}

	LL max = LLONG_MIN;
	for (int n = 1;n <= 1023;n++) {
		for (int k = 0;k < 10;k++) {
			openPeriod[k] = (n >> k) % 2;
		}//Generate every solution

		
		int collision[10] = { 0 };

		for (int i = 0;i < 10;i++) {//i is the period number
			if (openPeriod[i]) {
				for (int j = 0;j < N;j++) {
					if (shopdata[j][i])collision[j]++;
				}
			}
		}

		LL sum = 0;
		for (int i = 0;i < N;i++) {
			sum += profitInfo[i][collision[i]];
		}
		
		if (sum > max)max = sum;
	}
	cout << max;
	return 0;
}

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

 #include <iostream>
using namespace std;
int main(int argc, char *argv[]) {
	int f[100][15],p[100][15],temp[100];
	int i,j,k,n,r,t;
	cin >> n;
	for(i=0;i<n;i++)
		for(j=0;j<10;j++)
			cin >> f[i][j];
	for(i=0;i<n;i++)
		for(j=0;j<=10;j++)
			cin >> p[i][j];
	r=-2147483647;
	for(i=1;i<(1<<10);i++){
		memset(temp,0,sizeof(temp));
		for(j=0;j<n;j++)
			for(k=0;k<10;k++)
				if((f[j][k])&&((i>>k)&1))
					temp[j]++;
		t=0;
		for(j=0;j<n;j++)
			t+=p[j][temp[j]];
		r=max(r,t);
	}
	cout << r;
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:15:17: error: 'memset' was not declared in this scope
   15 |                 memset(temp,0,sizeof(temp));
      |                 ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 |  #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;