criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.util.Scanner;
import java.util.Arrays;
 
public class Main {
  public static void main(final String[] args) {
      final int INF = 1001001001;
      final Scanner sc = new Scanner(System.in);
      int n, m, x;
      n = sc.nextInt();
      m = sc.nextInt();
      x = sc.nextInt();
      final int a[][] = new int[n][m];
      final int c[] = new int[n];
      for (int i = 0; i < n; i++) {
          c[i] = sc.nextInt();
          for (int j = 0; j < m; j++) {
              a[i][j] = sc.nextInt();
          }
      }
      sc.close();
      int ans = INF;
      for (int i = 0; i < (1 << n); i++) {
          int cost = 0;
          final int[] skill = new int[m];
          // Arrays.fill(skill, 0);
          for (int j = 0; j < n; j++) {
              if (i >> j & 0b1) {
                  cost += c[j];
                  for (int k = 0; k < m; k++) {
                      skill[k] += a[j][k];
                  }
              }
          }
          boolean ok = true;
          for (final int j : skill) {
            if(skill[j]<x){
                ok = false;
                break;
            }
        }
        if (ok) ans = Math.min(ans, cost);
    }
    //System.out.println(A+B+C+K);
    if (ans == INF) {
      System.out.println(-1);
    } else {
      System.out.println(ans);
    }
  }
}

Compiler output:
Main.java:27: error: incompatible types: int cannot be converted to boolean
              if (i >> j & 0b1) {
                         ^
1 error
Language: Java

import java.util.Scanner;
import java.util.Arrays;
 
public class Main {
  public static void main(final String[] args) {
      final int INF = 1001001001;
      final Scanner sc = new Scanner(System.in);
      int n, m, x;
      n = sc.nextInt();
      m = sc.nextInt();
      x = sc.nextInt();
      final int a[][] = new int[n][m];
      final int c[] = new int[n];
      for (int i = 0; i < n; i++) {
          c[i] = sc.nextInt();
          for (int j = 0; j < m; j++) {
              a[i][j] = sc.nextInt();
          }
      }
      sc.close();
      int ans = INF;
      for (int i = 0; i < (1 << n); i++) {
          int cost = 0;
          final int[] skill = new int[m];
          // Arrays.fill(skill, 0);
          for (int j = 0; j < n; j++) {
              if ((i >> j) & 1) {
                  cost += c[j];
                  for (int k = 0; k < m; k++) {
                      skill[k] += a[j][k];
                  }
              }
          }
          boolean ok = true;
          for (final int j : skill) {
            if(skill[j]<x){
                ok = false;
                break;
            }
        }
        if (ok) ans = Math.min(ans, cost);
    }
    //System.out.println(A+B+C+K);
    if (ans == INF) {
      System.out.println(-1);
    } else {
      System.out.println(ans);
    }
  }
}

Compiler output:
Main.java:27: error: incompatible types: int cannot be converted to boolean
              if ((i >> j) & 1) {
                           ^
1 error
Language: Java

import java.util.Scanner;
import java.util.Arrays;
 
public class Main {
  public static void main(final String[] args) {
      final int INF = 1001001001;
      final Scanner sc = new Scanner(System.in);
      int n, m, x;
      n = sc.nextInt();
      m = sc.nextInt();
      x = sc.nextInt();
      final int a[][] = new int[n][m];
      final int c[] = new int[n];
      for (int i = 0; i < n; i++) {
          c[i] = sc.nextInt();
          for (int j = 0; j < m; j++) {
              a[i][j] = sc.nextInt();
          }
      }
      sc.close();
      int ans = INF;
      for (int i = 0; i < (1 << n); i++) {
          int cost = 0;
          final int[] skill = new int[m];
          // Arrays.fill(skill, 0);
          for (int j = 0; j < n; j++) {
              if (i >> j & 1) {
                  cost += c[j];
                  for (int k = 0; k < m; k++) {
                      skill[k] += a[j][k];
                  }
              }
          }
          boolean ok = true;
          for (final int j : skill) {
            if(skill[j]<x){
                ok = false;
                break;
            }
        }
        if (ok) ans = Math.min(ans, cost);
    }
    //System.out.println(A+B+C+K);
    if (ans == INF) {
      System.out.println(-1);
    } else {
      System.out.println(ans);
    }
  }
}

Compiler output:
Main.java:27: error: incompatible types: int cannot be converted to boolean
              if (i >> j & 1) {
                         ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
//解説写し
const int INF=1001001001;
int a[12][12];

int main() {
  int n,m,x;
  cin>>n>>m>>x;
  vector<int>c(n);
  rep(i,n){
    cin>>c[i];
    rep(j,m)cin>>a[i][j];
  }
  int ans =INF;
  rep(s,1<<n){
    int cost=0;
    vector<int>d(m);
    rep(i,n){
   if (bit & (1<<i)) {
        cost+=c[i];
        rep(j,m)d[j]+=a[i][j];
      }
    }
    bool ok=true;
    rep(j,m)if(d[j]<x)ok=false;
    if(ok)ans=min(ans,cost);
  }
  if(ans==INF)cout<<-1<<endl;
  else cout<<ans<<endl;
  return 0;
}
          


Compiler output:
a.cc: In function 'int main()':
a.cc:21:8: error: 'bit' was not declared in this scope
   21 |    if (bit & (1<<i)) {
      |        ^~~
Language: C

#include <iostream>
#include <vector>
#include<list>
#include <algorithm>
#include <string>
#include <math.h>
#include<map>
#include <utility>
#include <iomanip>
#include<queue>
#include <iomanip>
#include<set>
using namespace std;
#define REP(i,k,n) for(ll i=k;i<n;i++)
 
#define INF 1844674407370955161
typedef long long int ll;
#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))
#define MOD 1000000007


struct range{
    ll cost;
    ll num;
};

int main()
{
    int N,M,X;
    cin>>N>>M>>X;

    int C[N];
    int A[N][M];
    REP(i,0,N){
        cin>>C[i];
        REP(j,0,M){
            cin>>A[i][j];
        }
    }
    int ans=INT32_MAX;
    bool enable=false;

    REP(i,0,(1<<N+1)){
        int vv[M];
        int cost=0;
        REP(j,0,M){
            vv[j]=0;
        }
        REP(j,0,N){
            if(i&(1<<j)){
                REP(k,0,M){
                    vv[k]+=A[j][k];
                }
                cost+=C[j];
            }
        }
        bool flag=true;
        REP(j,0,N){
            if(vv[j]<X){
                flag=false;
            }
        }
        if(flag){
            ans=min(ans,cost);
            enable=true;
        }
    }

    if(enable){
        cout<<ans<<endl;
    }else{
        cout<<-1<<endl;
    }

    return 0;
}

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

#include<algorithm>//sort,二分探索,など
//#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<iterator>//集合演算(積集合,和集合,差集合など)
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列
#define CO(a, b, c) ((a)?(b):(c))
#define rep(i, n) for(int i = 0; i < (n); ++i)

using namespace std;
typedef long long ll;

int main(void)
{
	
	int n, m, x;
	cin >> n >> m >> x;
	vector<int> c(n);
	vector<vector<int>> book(n, vector<int>(m));
	for (int i = 0; i < n; i++)
	{
		cin >> c[i];
		for (int j = 0; j < m; j++)
		{
			cin >> book[i][j];
		}
	}
	int ans = INT_MAX;
	bool flg = false;
	for (int bit = 0; bit < (1<<n); ++bit)
	{
		vector<int> und(m, 0), buy;
		int tmp = 0;

		for (int i = 0; i < n; ++i)
		{
			if (bit & (1<<i))
			{
				tmp += c[i];
				for (int j = 0; j < m; j++)
				{
					und[j] += book[i][j];
				}
			}
		}
		if (*min_element(und.begin(), und.end()) >= x)
		{
			ans = min(ans, tmp);
			int sum = 0;
			for (auto &&i : buy)
			{
				sum += c[i];
			}
		}
	}
	
	cout << (flg?ans:-1) << endl;
	

	return 0;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:19: error: 'INT_MAX' was not declared in this scope
   41 |         int ans = INT_MAX;
      |                   ^~~~~~~
a.cc:19:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   18 | #include<utility>//pair
  +++ |+#include <climits>
   19 | #include<vector>//可変長配列
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define pii pair<int,int>
#define sorted(a) sort(a.begin(),a.end())
#define rsorted(a) sort(a.rbegin(),a.rend())
#define test(val) cout<<val<<endl;
#define test1(val) cout<<val<<" ";

struct node{
	int cost;
	int arr[20];
};

int required_level;
ll min_cost = 1e14;
void backtrack(node books[], int start, vector<ll>level,int n, int m, ll current_cost){
	if(start>=n) return;

	for(int i=start;i<n;i++){

		current_cost+=books[i].cost;
		for(int j=0;j<m;j++) level[j]+=books[i].arr[j];

		for(int k=0;k<m;k++){
			if(level[k]<required_level){
				break;
			}
			if(k==m-1){ min_cost = min(min_cost,current_cost); }
		}

		backtrack(books,i+1,level,n,m,current_cost);
		for(int j=0;j<m;j++) level[j]-=books[i].arr[j];
		current_cost-=books[i].cost;
	}
	return;
}

void solve(){
	global_flag=0;
	int n,m,x;
	cin>>n>>m>>x;
	required_level=x;
	node books[n];
	vector<ll>level(m,0);
	for(int i=0;i<n;i++){
		cin>>books[i].cost;
		for(int j=0;j<m;j++)
			cin>>books[i].arr[j];
	}
	backtrack(books,0,level,n,m,0ll);
	if(min_cost!=1e14)
	cout<<min_cost<<flush;
	else
	cout<<-1<<flush;
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int t=1;
	// cin>>t;
	while(t--){
		solve();
	}

return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:41:9: error: 'global_flag' was not declared in this scope
   41 |         global_flag=0;
      |         ^~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int a[ 12 ][ 12 ];
    int n, m, x;
    cin >> n >> m >> x;

    vector< int > c( n );

    for( int i = 0; i < n; i++ )
    {
        cin >> c[ i ];
        for( int j = 0; j < m; j++ )
            cin >> a[ i ][ j ];
    }

    int ans = INT_MAX;
    
    for( int s = 0; i < ( 1 << n ); i++ )
    {
        int cost = 0;
        vector< int > d( m );

        for( int i = 0; i < n; i++ )
        {
            if( s >> ( i & 1 ))
            {
                cost += c[ i ];
                for( int j = 0; j < m; j++ )
                    d[ j ] += a[ i ][ j ];
            }
        }

        bool flag = true;
        for( int j = 0; j < m; j++ )
            if( d[ j ] < x )
            {
                flag = false;
                break;
            }
        
        if( flag )
            ans = mi( cost, ans );
    }

    if( ans == INT_MAX )
        cout << -1 << endl;
    else
        cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:21: error: 'i' was not declared in this scope
   22 |     for( int s = 0; i < ( 1 << n ); i++ )
      |                     ^
a.cc:46:19: error: 'mi' was not declared in this scope; did you mean 'm'?
   46 |             ans = mi( cost, ans );
      |                   ^~
      |                   m
Language: Java

import java.util.Map.Entry;
import java.util.*;
import java.math.*;
import org.w3c.dom.css.Counter;


public class D {
    public static void main(final String[] args){
        final Scanner s = new Scanner(System.in);
        final int N = Integer.parseInt(s.next());
        final int M = Integer.parseInt(s.next());
        final int X = Integer.parseInt(s.next());
        //final HashSet<Integer> bookInfo= new HashSet<Integer>();
        final HashMap<Integer,ArrayList<Integer>> bookList= new HashMap<Integer,ArrayList<Integer>>();
       for(int i = 0;i<N;i++){
        ArrayList<Integer> bookInfo= new ArrayList<Integer>();
            for( int i2=0; i2<M+1; i2++){
                bookInfo.add(Integer.parseInt(s.next()));
            } 
        bookList.put(i,bookInfo);
       }
       long price =999999999;
       //ビット全検索
       for(int Mnum=0;Mnum<(1<<N);Mnum++){
           int tmpPrice = 0;
           int testFirst =0;
           ArrayList<Integer> targetBookInfo;
            for (int j=0; j<N; j++) {
                //ビットが１かの確認
                if ((1 & Mnum>>j) == 1) {
                        //アルゴリズムA1の習熟度だけ調査
                        targetBookInfo = bookList.get(j);
                        Iterator<Integer> hoge = targetBookInfo.iterator();
                        tmpPrice += hoge.next();
                        testFirst += hoge.next();
                };
            }
            //A1の習熟度が十分な場合,あと安いとき.本格的な計算
            if(testFirst >= X && tmpPrice<price){
                boolean Hoge = false;
                int argoChecker=0;
                //一つの学習度に着目して
                for(int targetArgo = 2;targetArgo <M;targetArgo++){
                    //bitが１かの確認
                    for (int j=0; j<N; j++) {
                        if ((1 & Mnum>>j) == 1) {
                            argoChecker += bookList.get(j).get(targetArgo);
                        }
                    }
                    //学習度がXを超えてるかの確認
                    if(argoChecker <X){
                        argoChecker=0;
                        Hoge = true;
                        break;
                    }else{
                        argoChecker=0;
                    }
                }
                //無事全条件をクリアしたので更新
                if(tmpPrice<price && Hoge ==false){
                    price = tmpPrice;
                }
            }
        }
        if(price == 999999999){
            price =-1;
        }
    System.out.println(price);
    }
}

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

int n,m,x;
int c[20],a[20][20];
int ans,now,f;
int rt[20];

int main()
{
	cin>>n>>m>>x;
	ans=inf;
	for(int i=1;i<=n;i++)
	{
		cin>>c[i];
		for(int j=1;j<=m;j++)
		{
			cin>>a[i][j];
		}	
	}
	for(int i=0;i<=(1<<n)-1;i++)
	{
		memset(rt,0,sizeof(rt));
		now=0;
		f=0;
		for(int j=0;j<=n-1;j++)
		{
			if(i&(1<<j))
			{
				now+=c[j+1];
				for(int k=1;k<=m;k++) rt[k]+=a[j+1][k];
			}
		}
		for(int j=1;j<=m;j++) if(rt[j]<x) f=1;
		if(!f) ans=min(ans,now); 
	}
	if(ans>2e9) printf("-1\n");
	else printf("%d\n",ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'cin' was not declared in this scope
    8 |         cin>>n>>m>>x;
      |         ^~~
a.cc:9:13: error: 'inf' was not declared in this scope; did you mean 'int'?
    9 |         ans=inf;
      |             ^~~
      |             int
a.cc:20:17: error: 'memset' was not declared in this scope
   20 |                 memset(rt,0,sizeof(rt));
      |                 ^~~~~~
a.cc:1:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
  +++ |+#include <cstring>
    1 | int n,m,x;
a.cc:32:28: error: 'min' was not declared in this scope; did you mean 'main'?
   32 |                 if(!f) ans=min(ans,now);
      |                            ^~~
      |                            main
a.cc:34:21: error: 'printf' was not declared in this scope
   34 |         if(ans>2e9) printf("-1\n");
      |                     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int n,m,x;
a.cc:35:14: error: 'printf' was not declared in this scope
   35 |         else printf("%d\n",ans);
      |              ^~~~~~
a.cc:35:14: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

int n,m,x;
int c[20],a[20][20];
int ans,now,f;
int rt[20];

int main()
{
	read(n),read(m),read(x);
	ans=inf;
	for(int i=1;i<=n;i++)
	{
		read(c[i]);
		for(int j=1;j<=m;j++)
		{
			read(a[i][j]);
		}	
	}
	for(int i=0;i<=(1<<n)-1;i++)
	{
		memset(rt,0,sizeof(rt));
		now=0;
		f=0;
		for(int j=0;j<=n-1;j++)
		{
			if(i&(1<<j))
			{
				now+=c[j+1];
				for(int k=1;k<=m;k++) rt[k]+=a[j+1][k];
			}
		}
		for(int j=1;j<=m;j++) if(rt[j]<x) f=1;
		if(!f) ans=min(ans,now); 
	}
	if(ans>2e9) printf("-1\n");
	else printf("%d\n",ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'read' was not declared in this scope
    8 |         read(n),read(m),read(x);
      |         ^~~~
a.cc:9:13: error: 'inf' was not declared in this scope; did you mean 'int'?
    9 |         ans=inf;
      |             ^~~
      |             int
a.cc:20:17: error: 'memset' was not declared in this scope
   20 |                 memset(rt,0,sizeof(rt));
      |                 ^~~~~~
a.cc:1:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
  +++ |+#include <cstring>
    1 | int n,m,x;
a.cc:32:28: error: 'min' was not declared in this scope; did you mean 'main'?
   32 |                 if(!f) ans=min(ans,now);
      |                            ^~~
      |                            main
a.cc:34:21: error: 'printf' was not declared in this scope
   34 |         if(ans>2e9) printf("-1\n");
      |                     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int n,m,x;
a.cc:35:14: error: 'printf' was not declared in this scope
   35 |         else printf("%d\n",ans);
      |              ^~~~~~
a.cc:35:14: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C

#include<bits/stdc++.h>
using namespace std;
using ll  = long long;
using vvl = vector<vector<ll>>;
using vl  = vector<ll>;
#define _GLIBCXX_DEBUG
#define acc_io cin.tie(0);ios::sync_with_stdio(false)
#define all(x) x.begin(),x.end()
#define rep(i,sta,end) for(ll i=sta;i<end;i++)
#define lcm(a,b) (a)/__gcd((a),(b))*(b)
#define pb push_back
const ll MOD = 1000000007;
const double PI = acos(-1);  
//name[i]   -> vl  name(i)
//name[i][j]-> vvl name(i,vl(j))
//or-> ||
//map<int,int>mp

ll n,m,x;
ll c[12];
ll a[12][12];
ll ans;
//string s;
void dfs(int i,ll mny,ll skl[12]){

	if(i==n){
		return;
	}
//	cout<<i<<" "<<mny<<" "<<endl;
//	rep(i,0,m) cout<<skl[i]<<" ";
//	cout<<endl;

	int ok=1;
	ll skl_tmp[m];
	ll mny_tmp;
	mny_tmp=mny+c[i];
	rep(k,0,m){
		skl_tmp[k]=skl[k]+a[i][k];
		if(skl_tmp[k]<x) ok=0;
	}
	if(ok){
		if(ans>mny_tmp) ans=mny_tmp;
	}
    dfs(i+1,mny,skl);
    dfs(i+1,mny_tmp,skl_tmp);
	return;
}

signed main(){
	acc_io;
	cin>>n>>m>>x;
	rep(i,0,n){
		cin>>c[i];
		rep(j,0,m){
			cin>>a[i][j];
		}
	}
	ans=1e9;
	ll skl[12]={0};
	dfs(0,0,skl);
	if(ans==1e9) ans=-1;
	cout<<ans<<endl;
	return 0;
}


Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

3 3 10
100 3 1 4
100 1 5#include<bits/stdc++.h>
using namespace std;
int n,m,x;
int a[105][105],c[105],now[105];
int cal(int state){
    int res=0;
    for(int i=1;i<=m;i++)now[i]=0;
    for(int i=0;i<n;i++){
        if(state&(1<<i)){
            res+=c[i];
            for(int i0=1;i0<=m;i0++)
            {
                now[i0]+=a[i][i0];
            }
        }
    }
    for(int i0=1;i0<=m;i0++)
    {
        if(now[i0]<x)return INT_MAX;
    }
    return res;
}
int main()
{
    scanf("%d %d %d",&n,&m,&x);
    for(int i=0;i<n;i++)
    {
        scanf("%d",&c[i]);
        for(int i0=1;i0<=m;i0++)
        {
            scanf("%d",&a[i][i0]);
        }
    }
    int ans=INT_MAX;
    for(int i=0;i<(1<<n);i++)
    {
        ans=min(ans,cal(i));
    }
    if(ans==INT_MAX)ans=-1;
    printf("%d\n",ans);
    return 0;
}

Compiler output:
a.cc:3:8: error: stray '#' in program
    3 | 100 1 5#include<bits/stdc++.h>
      |        ^
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 3 3 10
      | ^
a.cc: In function 'int cal(int)':
a.cc:21:29: error: 'INT_MAX' was not declared in this scope
   21 |         if(now[i0]<x)return INT_MAX;
      |                             ^~~~~~~
a.cc:1:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
  +++ |+#include <climits>
    1 | 3 3 10
a.cc: In function 'int main()':
a.cc:27:5: error: 'scanf' was not declared in this scope
   27 |     scanf("%d %d %d",&n,&m,&x);
      |     ^~~~~
a.cc:36:13: error: 'INT_MAX' was not declared in this scope
   36 |     int ans=INT_MAX;
      |             ^~~~~~~
a.cc:36:13: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
a.cc:39:13: error: 'min' was not declared in this scope; did you mean 'main'?
   39 |         ans=min(ans,cal(i));
      |             ^~~
      |             main
a.cc:42:5: error: 'printf' was not declared in this scope
   42 |     printf("%d\n",ans);
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | 3 3 10
Language: C++

#include <iostream>
#include<bitset>
using namespace std;

int main(){
	int n,m,x;
	cin >> n >> m >> x;
	
	int c[12];
	int a[12][12];
	
	for(int i=0;i<12;i++){
		c[i]=0;
		for(int j=0;j<12;j++){
			a[i][j]=0;
		}
	}
	
	for(int i=0;i<n;i++){
		cin >> c[i];
		for(int j=0;j<m;j++){
			cin >> a[i][j];
		}
	}
	
	int cost,money=999999999;
	for(int i=0;i<(1<<n);i++){
		vector<int> A(m,0);
		cost=0;
		for(int j=0;j<n;j++){
			if(i&(1<<j)){
				cost+=c[j];
				for(int k=0;k<m;k++){
					A[k]+=a[j][k];
				}
			}
		}
		bool ok=true;
		for(int k=0;k<m;k++){
			if(A[k]<x)ok=false;
		}
		if(ok)money=min(money,cost);
	}
  
	if(money==999999999){
		cout << "-1" << endl;
		return 0;
	}
	cout << money << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:17: error: 'vector' was not declared in this scope
   28 |                 vector<int> A(m,0);
      |                 ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include<bitset>
  +++ |+#include <vector>
    3 | using namespace std;
a.cc:28:24: error: expected primary-expression before 'int'
   28 |                 vector<int> A(m,0);
      |                        ^~~
a.cc:34:41: error: 'A' was not declared in this scope
   34 |                                         A[k]+=a[j][k];
      |                                         ^
a.cc:40:28: error: 'A' was not declared in this scope
   40 |                         if(A[k]<x)ok=false;
      |                            ^
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for (int i=0;i<(n);++i)
using namespace std;
using ll = long long;
using p = pair<int, int>;

const int INF 1001001001;

int main(){
  int N,M,X;
  cin >> N >> M >> X;
  vector<int> C(N);
  vector<vector<int>> A(N,vector<int>(M));
  int max = 0;
  rep(i,N){
    cin >> C.at(i);
    if(max < C.at(i)){
      max = C.at(i);
    }
    rep(j,M){
      int tmp;
      cin >> tmp;
      A.at(i).at(j) = tmp;
    }
  }

  int min = INF;
  for(int bit = 0;bit < (1<<N);++bit){
    int sum = 0;
    vector<int> tmp(M);
    for(int i=0;i<N;i++){
      if(bit & (1<<i)){
        sum += C.at(i);
        rep(j,M){
          tmp.at(j) += A.at(i).at(j);
        }
      }
    }
    bool ok = true;
    rep(i,M) if(tmp.at(i) < X) ok = false;
    if(ok) min = min(min,sum);
  }
  if(min==INF){
    cout << "-1" <<endl;
  }else{
    cout << min << endl;
  }
  return 0;
}

Compiler output:
a.cc:7:15: error: expected initializer before numeric constant
    7 | const int INF 1001001001;
      |               ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:27:13: error: 'INF' was not declared in this scope
   27 |   int min = INF;
      |             ^~~
a.cc:41:21: error: 'min' cannot be used as a function
   41 |     if(ok) min = min(min,sum);
      |                  ~~~^~~~~~~~~
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int N = Integer.parseInt(sc.next());
        int M = Integer.parseInt(sc.next());
        int X = Integer.parseInt(sc.next());

        int[] C = new int[N];

        int[][] CA = new int[N][M];

        int ans = 0;

        for(int i = 0; i < N; i++){
            C[i] = Integer.parseInt(sc.next());
            for(int j = 0; j < M; j++){
                CA[i][j] = Integer.parseInt(sc.next());
            }
        }

        boolean judge;
        for(int i = 0; i < N-1; i++){
            judge = true;
            C[i + 1] += C[i];
            ans = C[i + 1];

            for(int j = 0; j < M; j++){
                CA[i + 1][j] += CA[i][j];
                if(CA[i + 1][j] < X)
                    judge = false;
            }
            
            if(judge)
                break;
            if(!judge)
                continue;
        }

        if(judge)
            System.out.println(ans);
        if(!judge)
            System.out.println(-1);
    }
}

Compiler output:
Main.java:42: error: variable judge might not have been initialized
        if(judge)
           ^
1 error
Language: Java

import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int N = Integer.parseInt(sc.next());
        int M = Integer.parseInt(sc.next());
        int X = Integer.parseInt(sc.next());

        int[] C = new int[N];
        int[] A = new int[M];

        int[][] CA = new int[N][M];

        int ans;

        for(int i = 0; i < N; i++){
            C[i] = Integer.parseInt(sc.next());
            for(int j = 0; j < M; j++){
                CA[i][j] = Integer.parseInt(sc.next());
            }
        }

        boolean judge = true;
        for(int i = 0; i < N-1; i++){
            C[i + 1] += C[i];
            ans = C[i + 1];

            for(int j = 0; j < M; j++){
                CA[i + 1][j] += CA[i][j];
                if(CA[i + 1][j] < 10)
                    judge = false;
            }
            
            if(judge)
                break;
            if(!judge)
                continue;
        }

        if(judge)
            System.out.println(ans);
        if(!judge)
            System.out.println(-1);
    }
}

Compiler output:
Main.java:43: error: variable ans might not have been initialized
            System.out.println(ans);
                               ^
1 error
Language: C++

#include<iostream>
#include<vector>
using namespace std;
const int INF=1001001001;
int a[12][12];

int main(){
int n,m,x;
  cin>>n>>m>>x;
  vector<int>c(n);
  for(int i=0;i<n;i++){
    cin>>c[i];
    for(int j=0;j<m;j++){
      cin>>a[i][j];
    }
  }
  int ans=INF;
  for(int s=0;s<(1<<n);s++){
    int cost=0;
    vector<int> d(m);
    for(int i=0;i<n;i++){
      if(s>>i&1){
        cost+=c[i];
        for(int i=0;i<m;i++) d[j]+=a[i][j];
      }
    }
    bool ok=true;
    for(int j=0;j<m;j++){
      if(d[j]<x) ok=false;
      if(ok) ans=min(ans,cost);
    }
  }
    if(ans==INF) cout<<-1<<endl;
    else cout<<ans<<endl;
    return 0;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:32: error: 'j' was not declared in this scope
   24 |         for(int i=0;i<m;i++) d[j]+=a[i][j];
      |                                ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
static const int INF=1000000000;
int main(){
int N,M,X;
  cin>>N>>M>>X;
  vector<int>C(N);
  int A[N][M];
  for(int i=0;i<N;i++){
  cin>>C.at(i);
    for(int j=0;j<M;j++)
      cin>>A[i][j];
  } int ans=INF;
  for(int bit=0;bit<(1<<N);bit++){
      int c=0;
    vector<int>B(M);
    for(int i=0;i<N;i++){
    if(bit &(1<<i)){
      c+=C.at(i);
      for(int j=0;j<M;j++)
        B[j]+=A[i][j];
    
    
    }
  
  }bool x=true;
    for(int j=0;j<Mji++)
      if(B[j]<X)
        false;
    if(x){if(c<ans) ans=c;}
  
  }if(ans==INF)
    cout<<-1<<endl;
  else
    cout<<ans<<endl;
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:19: error: 'Mji' was not declared in this scope
   27 |     for(int j=0;j<Mji++)
      |                   ^~~
a.cc:27:24: error: expected ';' before ')' token
   27 |     for(int j=0;j<Mji++)
      |                        ^
      |                        ;
Language: C++

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

int main(){
  int n,m,x;
  cin >> n >> m >> x;
  vector<int> c(n),b(m);
  vector<vector<int>> a(n,vector<int>(m));
  for(int i=0;i<n;i++){
    cin >> c.at(i);
    for(int j=0;j<m;j++){
      cin >> a.at(i).at(j);
      b.at(j) += a.at(i).at(j);
    }
  }
  
  int yes=0;
  for(int i=0;i<m;i++){
    if(b.at(i) < x){
      yes = -1;
      break;
    }
  }
  if(yes == -1) cout << -1 << endl;
  else {
    vector<int> t(n),k(5000);
    for(int i=0;i<5000;i++){
      vector<int> b(m);
      t.at(0) +=1;
      for(int j=0;j<n-1;j++){
        if(t.at(j) == 2){
          t.at(j+1) +=1;
          t.at(j) = 0;
        }
      }
      
      for(int j=0;j<n;j++){
        if(t.at(j) == 1){
          k.at(i) += c.at(j);
          for(int h=0;h<m;h++){
            b.at(h) += a.at(j).at(h);
          }
        }
      }
      for(int h=0;h<m;h++){
        if(b.at(h) < x){
          yes = -1;
          break;
        }
      }
      if(yes == -1) k.at(i) = 0;
      yes = 0;
      for(int i=0;i<n;i++){
        if(t.at(i) == 1) yes++;
      }
      if(yes == n) break;
      else yes = 0;
    }
  }
  sort(k.begin(),k.end());
  for(int i=0;i<5000;i++){
    if(k.at(i) > 0){
      cout << k.at(i) << endl;
      break;
    }
  }
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:60:8: error: 'k' was not declared in this scope
   60 |   sort(k.begin(),k.end());
      |        ^
Language: C++

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

int main(){
  int n,m,x;
  cin >> n >> m >> x;
  vector<int> c(n),b(m);
  vector<vector<int>> a(n,vector<int>(m));
  for(int i=0;i<n;i++){
    cin >> c.at(i);
    for(int j=0;j<m;j++){
      cin >> a.at(i).at(j);
      b.at(j) += a.at(i).at(j);
    }
  }
  
  int yes=0;
  for(int i=0;i<m;i++){
    if(b.at(i) < x){
      yes = -1;
      break;
    }
  }
  if(yes == -1) cout << -1 << endl;
  else {
    vector<int> t(n);k(5000);
    for(int i=0;i<5000;i++){
      vector<int> b(m);
      t.at(0) +=1;
      for(int j=0;j<n-1;j++){
        if(t.at(j) == 2){
          t.at(j+1) +=1;
          t.at(j) = 0;
        }
      }
      
      for(int j=0;j<n;j++){
        if(t.at(j) == 1){
          k.at(i) += c.at(j);
          for(int h=0;h<m;h++){
            b.at(h) += a.at(j).at(h);
          }
        }
      }
      for(int h=0;h<m;h++){
        if(b.at(h) < x){
          yes = -1;
          break;
        }
      }
      if(yes == -1) k.at(i) = 0;
      yes = 0;
      for(int i=0;i<n;i++){
        if(t.at(i) == 1) yes++;
      }
      if(yes == n) break;
      else yes = 0;
    }
  }
  sort(k.begin(),k.end());
  for(int i=0;i<5000;i++){
    if(k.at(i) > 0){
      cout << k.at(i) << endl;
      break;
    }
  }
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:22: error: 'k' was not declared in this scope
   26 |     vector<int> t(n);k(5000);
      |                      ^
a.cc:60:8: error: 'k' was not declared in this scope
   60 |   sort(k.begin(),k.end());
      |        ^
Language: C++

/* 
 * Created on: May 11, 2020 time: 1:43:52 PM 
 *      Author: null_ptr
 */

#include<iostream>
#include<vector>

using namespace std;

int main()
{
	int n,m,x;
	cin>>n>>m>>x;
	int ans=INT_MAX;
	vector<vector<int>>nums(n,vector<int>(m));
	vector<int>cnt(n);
	for(int i=0;i<n;++i)
	{
		cin>>cnt[i];
		for(int j=0;j<m;++j)
			cin>>nums[i][j];
	}
	for(int i=0;i<(1<<n);++i)
	{
		int price=0;
		vector<int>tmp(m);
		for(int j=0;j<n;++j)
		{
			if((i & (1<<j))>0)
			{
				price+=cnt[j];
				for(int k=0;k<m;++k)
					tmp[k]+=nums[j][k];
			}
		}
		bool ok=true;
		for(int j=0;j<m;++j)
			if(tmp[j]<x)ok=false;

		if(ok)
		{
			ans=min(ans,price);
		}
	}
	cout<<(ans==INT_MAX?-1:ans);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 'INT_MAX' was not declared in this scope
   15 |         int ans=INT_MAX;
      |                 ^~~~~~~
a.cc:8:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    7 | #include<vector>
  +++ |+#include <climits>
    8 |
Language: C++

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

#define rep(i,n) for(int i;i<n;i++)
using namespace std;
using ll = Long long;
using P = pair<int, int>;

int a[12][12];
const int INF = 1001001001;

int main() {
    int n, m, x;
    cin >> n >> m >> x;
    vector<int> c(n);
    
    rep(i,n) {
        cin >> c[i]];
        rep(j,m) cin >> a[i][j];
    }

    int ans = INF;

    rep(s, 1<<n) {
        int cost = 0;
        vector<int> d(m);
        rep(i,n){
            if(s>>i&1) {
                cost += c[i];
                rep(j,m) d[j] += a[i][j];
            }
        }
        bool ok = true;
        rep(j,m) if (d[j] < x) ok = false;
        if (ok) ans = min(ans, cost);
    }
    if (ans == INF) cout << -1 << endl;
    else cout << ans << endl;
    
    return 0;
}

Compiler output:
a.cc:8:12: error: 'Long' does not name a type; did you mean 'long'?
    8 | using ll = Long long;
      |            ^~~~
      |            long
a.cc: In function 'int main()':
a.cc:20:20: error: expected ';' before ']' token
   20 |         cin >> c[i]];
      |                    ^
      |                    ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
const int INF = 1001001001
int a[12][12];


int main(){
  int n, m, x, i, j;
  scanf("%d %d %d", &n, &m, &x);
  vector<int> c(n);
  for(i = 0; i < n; i++){
    scanf("%d", c.at(i));//参考書の代金
    for(j = 0; j < m; j++) scanf("%d", a[i][j]);//身に付くスキル
  }

  int ans = INF;
  for(i = 0; 1 << n){
    int cost = 0;
    vector<int> d(m);
    for(i = 0; i < n; i++){
      if(s << i&1){
        cost += c[i];
        for(j = 0;j < m; j++)d[j] += a[i][j];
      }
    }
    bool ok = true;
    for(j =0; j < m; j++) if(d[j] < x) ok = false;
    if(ok) ans = min(ans, cost);
  }
  if (ans == INF)cout << -1 << endl;
  else cout << ans << endl;
  return 0;
}


Compiler output:
a.cc:4:1: error: expected ',' or ';' before 'int'
    4 | int a[12][12];
      | ^~~
a.cc: In function 'int main()':
a.cc:13:40: error: 'a' was not declared in this scope
   13 |     for(j = 0; j < m; j++) scanf("%d", a[i][j]);//身に付くスキル
      |                                        ^
a.cc:17:20: error: expected ';' before ')' token
   17 |   for(i = 0; 1 << n){
      |                    ^
      |                    ;
a.cc:21:10: error: 's' was not declared in this scope
   21 |       if(s << i&1){
      |          ^
a.cc:23:38: error: 'a' was not declared in this scope
   23 |         for(j = 0;j < m; j++)d[j] += a[i][j];
      |                                      ^
Language: C++

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

#define rep( i, n, m ) for(int i = ( n ); i < ( m ); i++)
#define rep_d( i, n, m ) for(int i = ( n ) - 1; i >= ( m ); i--)
#define sort_asc( X ) sort(( X ).begin(), ( X ).end())
#define sort_desc( X ) sort(( X ).begin(), ( X ).end(), greater <>())
#define endl "\n"

template <class T> bool chmax( T& a, T b );
template <class T> bool chmin( T& a, T b );
int* eratosthenes( int N );
bool bit_search( int pattern, int N );
void initialize( void );

const ll INF = 1LL << 60;
const int k_mod = 1e9 + 7;
template <typename T, typename K> struct P {
	T a; K b;
};
typedef struct {
	vector <int> to;
	int cost;
} edge;
func( int pattern, int N, int M, int X, vector <int> &cost, vector <vector <int> > &skill ){
	int cnt = 0;
	vector <int> experience( N, 0 );
	int pay = 0;
	rep( bit, 0, N ){
		if (pattern & ( 1 << bit )){
			pay += cost[ bit ];
			rep( i, 0, M )
			experience[ i ] += skill[ bit ][ i ];
		}
	}
	rep( i, 0, M ){
		if (experience[i] < X){
			return k_mod;
		}
	}
	return pay;
}
int main( void ){
	// initialize();
	int N, M, X;
	cin >> N >> M >> X;
	vector <int> cost( N );
	vector <vector <int> > skill( N, vector <int>( M ));
	rep( i, 0, N ){
		cin >> cost[ i ];
		rep( j, 0, M ){
			cin >> skill[ i ][ j ];
		}
	}
	int minimum = k_mod;
	int lim = pow( 2, N );
	rep( i, 0, lim ){
		minimum = min( minimum, func( i, N, M, X, cost, skill ));
	}
	cout << (( minimum != k_mod ) ? minimum : ( -1 )) << endl;
}

template <class T> bool chmax( T& a, T b ) {
	if (a < b){
		a = b; return true;
	}
	return false;
}
template <class T> bool chmin( T& a, T b ) {
	if (a > b){
		a = b; return true;
	}
	return false;
}
int* eratosthenes( int N ){
	int* prime_array = new int[ N + 1 ];
	int lim = N;
	prime_array[ 0 ] = 0;
	prime_array[ 1 ] = 0;
	rep( i, 2, N + 1 ){
		prime_array[ i ] = 1;
	}
	rep( i, 2, lim ){
		if (prime_array[ i ] == 0)
			continue;
		lim = N / i;
		for(int j = i * 2; j < N + 1; j += i){
			prime_array[ j ] = 0;
		}
	}
	return prime_array;
}
bool bit_search( int pattern, int N ){
	int cnt = 0;
	rep( bit, 0, N ){
		if (pattern & ( 1 << bit )){
			cnt++;
		}
	}
	return true;
}
void initialize( void ){
	cout << fixed << setprecision( 10 );
}


Compiler output:
a.cc:26:1: error: ISO C++ forbids declaration of 'func' with no type [-fpermissive]
   26 | func( int pattern, int N, int M, int X, vector <int> &cost, vector <vector <int> > &skill ){
      | ^~~~
Language: C++

#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
    
#define endl '\n'
//#define int long long

const int INF = 100000000;

using namespace std;
signed main() {
    ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    int n, m, x;
    cin >> n >> m >> x;
    int books[i][m + 1];
    for (int i = 0; i < n; i++) {
        for (int j = 0; j <= m; j++) {
            cin >> books[i][j];
        }
    }
    int ans = INF;
    for (int mask = 0; mask < (2 << n); mask++) {
        int tc = 0;
        vector<int> tp(m, 0);
        for (int i = 0; i < n; i++) {
            if ((mask >> i) % 2) {
                tc += books[i][0];
                for (int j = 1; j <=m; j++) {
                    tp[j - 1] += books[i][j];
                }
            }
        }
        bool ha = true;
        for (int i = 0; i < m; i++) {
            if (tp[i] < x) {ha = false; break;}
        }
        if (ha) ans = min(ans, tc);
    }

    if (ans == INF) cout << -1;
    else cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:15: error: 'i' was not declared in this scope
   16 |     int books[i][m + 1];
      |               ^
a.cc:19:20: error: 'books' was not declared in this scope
   19 |             cin >> books[i][j];
      |                    ^~~~~
a.cc:28:23: error: 'books' was not declared in this scope
   28 |                 tc += books[i][0];
      |                       ^~~~~
Language: C++

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

int main(){
int n,m,x;
cin >> n >> m >> x;

int a[15],cost;
int inf = 1100000000;
int ans = inf;

int v[15][15];

rep(i,n){
  rep(j,m+1) cin >> v[i][j];
}

rep(bit,1<<n){
  int cost =0;
  vector<int> d(m)
  rep(i,n){
    if(bit&1<<i){
      cost +=v[i][0];
      rep(j,m) d[j]+=v[i][j+1];
    }
  }
  bool ok = true;
  rep(i,m){
    if(d[i]<x) ok = false;
  }
  if(ok) ans = min(cost,ans);
 

}

if(ans == inf) cout << -1 <<endl;
else cout << ans << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:19: error: expected ',' or ';' before 'for'
    3 | #define rep(i,n)  for(int i=0;i<(n);i++)
      |                   ^~~
a.cc:22:3: note: in expansion of macro 'rep'
   22 |   rep(i,n){
      |   ^~~
a.cc:22:7: error: 'i' was not declared in this scope
   22 |   rep(i,n){
      |       ^
a.cc:3:31: note: in definition of macro 'rep'
    3 | #define rep(i,n)  for(int i=0;i<(n);i++)
      |                               ^
Language: C++

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


int main(){
  
  int n,m,x;
  cin >> n >> m >> x;
  vector<int> p(n);
  vector<vector<int>> v(n,vector<int>(m));
  for(int i=0;i<n;++i){
    cin >> p[i];
    for(int j=0;j<m;++j){
      cin >> v[i][j];
    }
  }
  int mini = INT_MAX;
  for(int i=0;i <(1<<n);++i){
    vector<int> ans(m,0);
    int curr = 0;
    
    for(int j=0;j<(n);++j){
      if(i && (1<<j){
        for(int k=0;k<m;++k){
          ans[k] += v[j][k];
          curr+=p[j];
        }
      }
     }
         
     for(auto a : ans){
       if(a < x){
         break;
       }
     }
     mini = min(mini,curr);
   }
         
   if(mini == INT_MAX){
     cout << -1 << "\n";
   }
    else{
      cout << mini << "\n";
    }
  
  
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:21: error: expected ')' before '{' token
   23 |       if(i && (1<<j){
      |         ~           ^
      |                     )
a.cc:29:6: error: expected primary-expression before '}' token
   29 |      }
      |      ^
Language: C++

#include <cstdio>
#include <vector>
#include <algorithm>

int main() {
  using namespace std;
  int best = 0x3f3f3f3f, n, m, x;

  scanf("%d%d%d", &n, &m, &x);
  vector<int> cost(n);
  vector<vector<int> > addition(n, vector<int>(m));

  for (int i = 0; i < n; ++i) {
    scanf("%d", &cost[i]);
    for (int j = 0; j < m; ++j) scanf("%d", &addition[i][j]);
  }

  for (int i = 0, e = 1 << n; i < e; ++i) {
    [=](int v) {
      int cur = 0;
      vector<int> ability(m);
      for (int i = 0; i < n; ++i) {
        if (v >> i & 1) {
          cur += cost[i];
          if (cur >= best) return;
          for (int j = 0; j < m; ++j)
            ability[j] += addition[i][j];
        }
      }
      for (int i = 0; i < m; ++i)
        if (ability[i] < x) return;
      best = min(cur, best);
    }(i);
  }

  printf("%d\n", best == 0x3f3f3f3f ? -1 : best);
}

Compiler output:
a.cc: In lambda function:
a.cc:32:12: error: assignment of read-only variable 'best'
   32 |       best = min(cur, best);
      |       ~~~~~^~~~~~~~~~~~~~~~
Language: C++

#include <cstdio>
#include <vector>
#include <algorithm>

int main() {
  using namespace std;
  int best = 0x3f3f3f3f, n, m, x;
  vector<int> cost(n);
  vector<vector<int> > addition(n, vector<int>(m));

  scanf("%d%d%d", &n, &m, &x);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &cost[i]);
    for (int j = 0; j < m; ++j) scanf("%d", &addition[i][j]);
  }

  for (int i = 0, e = 1 << n; i < e; ++i) {
    [=](int v) {
      int cur = 0;
      vector<int> ability(m);
      for (int i = 0; i < n; ++i) {
        if (v >> i & 1) {
          cur += cost[i];
          if (cur >= best) return;
          for (int j = 0; j < m; ++j)
            ability[j] += addition[i][j];
        }
      }
      for (int i = 0; i < m; ++i)
        if (ability[i] < x) return;
      best = min(cur, best);
    }(i);
  }

  printf("%d\n", best == 0x3f3f3f3f ? -1 : best);
}

Compiler output:
a.cc: In lambda function:
a.cc:31:12: error: assignment of read-only variable 'best'
   31 |       best = min(cur, best);
      |       ~~~~~^~~~~~~~~~~~~~~~
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc =new Scanner(System.in);
    int N =sc.nextInt();
    double m =Math.pow(2,N);int n =(int) m ;
    int M =sc.nextInt();
    long X =sc.nextLong();
    long C[][] =new long[N][M+1];
    for(int i=0;i<N;i++){
      for(int j=0;j<=M;j++){
        C[i][j]=sc.nextLong();}
    }
    long D[] =new long[N];
    long E[] =new long[M+1];
    long x =0;
    long min=5000000000;
    for(int k=0;k<n;k++){
      String K =Integer.toBinaryString(k);
      String R[] =K.split("",0);
      int r =K.length();
      for(int l=0;l<r;l++){
        D[l]=Integer.parseInt(R[l]);
        for(int p=1;p<=M;p++){
          E[p]=E[p]+D[r-l-1]*C[l][p];}
        x=x+D[r-l-1]*C[l][0];}
      for(int q=1;q<=M;q++){
        if(E[q]<X){x=-1;}
      E[q]=0;}
      if(x>0){min =Math.min(x,min);}
      x=0;
    }
    if(min==5000000000){System.out.println(-1);}
    else{System.out.println(min);}
  }
}


Compiler output:
Main.java:17: error: integer number too large
    long min=5000000000;
             ^
Main.java:33: error: integer number too large
    if(min==5000000000){System.out.println(-1);}
            ^
2 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
#define sz(x) int(x.size())
using ll = long long;
using P = pair<int,int>;
const ll LLINF = numeric_limits<long long>::max();
const int mod = 1000000007;
const int INF = 1001001001;
 
int main()
{
    int N,M,X;
    cin >> N >>M >>X;
    vector <int> C(N);
    int  A[N][M];
    int W[M];
    for(int i=0;i<N;i++){
        cin >> C[i];
        for(int j=0;j<M;j++){
             cin >> A[i][j];
             W[i] = 0;
        }
    }
    ll ans = INF
    
    int n=N;
    int co=1;
    
    rep(div,1<<(N)) {
        int g = 0;
        vector<int> id(M);
        bool flag = true;
        ll cos=0; 
        //cout << "sss"<<div << endl;
        rep(i,N) {
        // cout << div;
        int d = div;
            if (d>>i&1){
                for(int j=0;j<M;j++){
                    //cout << "j " << j  << endl;
                    //cout << "a "<<A[i][j] << endl;
                    id[j] += A[i][j];
                    //cout << "id "<<id[j] << endl;
                    
                    
                    
                }
                cos += C[i];
        
                
            }
        }
        for(int j=0;j<M;j++){
            //cout << id[j] << " ";  
            if(id[j] < X){
                flag=false;
            }
        }
        //cout << endl;
        if(flag){
            ans = min(ans, cos);
        }
    }   
    if(ans == INF){
        ans =-1;
    }
    cout << ans;
 
 
 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:5: error: expected ',' or ';' before 'int'
   29 |     int n=N;
      |     ^~~
Language: Java

package abc167;
import java.util.Scanner;
public class C2 {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt(); //n冊
		int m = stdIn.nextInt(); //アルゴリズム数
		
		int x = stdIn.nextInt(); 
		
		int[] c = new int[n];
		
		int[][] a = new int[n][m];
		
		for(int i = 0; i < n; i++) {
			c[i] = stdIn.nextInt();
			for(int j = 0; j < m; j++) {
				a[i][j] = stdIn.nextInt();
			}
		}
      
		//まず達成可能か見る
		boolean flag = true;
		int min = Integer.MAX_VALUE;
		int boolcheck = 0;
					
Outer:	for(int bit = 0; bit < (1 << n); bit++) {
			int[] check = new int[m];
			int ans = 0;
			
			for(int j = 0; j < n; j++ ) {
				if(((bit>>j)&1)==1){
					ans += c[j];
					
					
					for(int k = 0; k < m; k++) {
						check[k]+= a[j][k];
					}
					
					
				}
				
				
			}
			
			for(int k = 0; k < m; k++) {
				if(check[k] < x) {
					boolcheck++;
					continue Outer;
				}
			}
			
			min = Math.min(ans, min);
			
			
			
		}
		
		if(boolcheck==(1<<n)) {
			System.out.println(-1);
		}else {
			System.out.println(min);
		}		
	}

}


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