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

#include<bits/stdc++.h>
using namespace std;
void recursive_comb(int *indexes, int s, int rest, std::function<void(int *)> f) {
  if (rest == 0) {
    f(indexes);
  } else {
    if (s < 0) return;
    recursive_comb(indexes, s - 1, rest, f);
    indexes[rest - 1] = s;
    recursive_comb(indexes, s - 1, rest - 1, f);
  }
}
 
// nCkの組み合わせに対して処理を実行する
void foreach_comb(int n, int k, std::function<void(int *)> f) {
  int indexes[k];
  recursive_comb(indexes, n - 1, k, f);
}
 
int main() {
  static int N, M, X;
  static int C[12][13], i,j,k;
  static int ca[12], Ans, te;
  
  cin >> N >> M >> X;
  for(j=0;j<N;j++)
    for(i=0;i<M+1;i++)
      cin >> C[j][i];
  
  for(i=1;i<=N;i++){
    Ans=0;
    foreach_comb(N, i, [](int *indexes) {
      for(j=0;j<M;j++){
        ca[j]=0;
        for(k=0;k<i;k++)
          ca[j]+=C[indexes[k]][j+1];
      }
      int p=0;
      for(j=0;j<M;j++)
        p+=(ca[j]>=X);
      if(p==M){
        for(te=j=0;j<i;j++)
          te+=C[indexes[j]][0];
        Ans = (Ans==0)?te:(Ans>te)?te:Ans;
      }
    });
    if(Ans){
      cout << Ans;
      return 0;
    }
  }
  cout << -1;
}

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++

#include<iostream>
#include<vector>
const int INF=1001001001;
using namespace std;
int main(){
  int n,m,x;
  cin>>n>>m>>x;
  int c[n],a[n][m];
  for(int i=0;i<n;i++){
     cin>>c[i];
    for(int j=0;j<m;j++){
      cin>>c[j];
    }
  }
  int ans=INF;
  for(int bit;bit<(1<<n);bit++){
    int cost=0;
    vector<int> d(m);
    for(int j=0;j<n;j++){
      if(bit>>j&1){
        cost+=c[i];
        for(int k=0;k<m;k++) d[k]+=a[j][k];
      }
    }
    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:21:17: error: 'i' was not declared in this scope
   21 |         cost+=c[i];
      |                 ^
Language: C++

#include<iostream>
#include<vector>
const int INF=1001001001;
using namespace std;
int main(){
  int n,m,x;
  cin>>n>>m>>x;
  int c[n],a[n][m];
  for(int i=0;i<n;i++){
     cin>>c[i];
    for(int j=0;j<m;j++){
      cin>>c[j];
    }
  }
  int ans=INF;
  for(int bit;bit<(1<<n);bit++){
    int cost=0;
    vector<int> d(m);
    for(int j=0;j<n;j++){
      if(bit>>i&1){
        cost+=c[i];
        for(int j=0;j<m;j++) 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:30:3: error: extended character 　 is not valid in an identifier
   30 |   else　cout<<ans<<endl;
      |   ^
a.cc: In function 'int main()':
a.cc:20:15: error: 'i' was not declared in this scope
   20 |       if(bit>>i&1){
      |               ^
a.cc:30:3: error: 'else\U00003000cout' was not declared in this scope
   30 |   else　cout<<ans<<endl;
      |   ^~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <cmath>
using namespace std;

int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n,m,x;
    cin>>n>>m>>x;
    
    vector<int> value(n);
    vector<vector<int>> book;
    for(int i=0;i<n;i++){
        int c;
        cin>>c;
        value[i]=c;
        vector<int> added;
        for(int j=0; j<m; j++){
            int e;
            cin>>e;
            added.push_back(e);
        }
        book.push_back(added);
    }
    
    int k = (int)pow(2, n);
    int ans = 2147483647;
    
    for(int i=1; i<k;i++){
        int index = n-1;
        vector<int> sum(m,0);
        int curr = 0;
        int f = i;
        while(f!=0){
            if(f%2){
                for(int j=0; j<m; j++){
                    sum[j]+=book[index][j];
                }
                curr+=value[index];
            }
            f/=2;
            index--;
        }
        bool valid = true;
        for(int j=0;j<m;j++){
            if(sum[j]<x){
                valid =false;
                break;
            }
        }
        if(valid){
            if(ans>curr)
                ans = curr;
               
        }
    }
    
    if(ans!=INT_MAX)
        cout<<ans<<endl;
    else
        cout<<-1<<endl;
    
    cout<<INT_MAX;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:13: error: 'INT_MAX' was not declared in this scope
   64 |     if(ans!=INT_MAX)
      |             ^~~~~~~
a.cc:7:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    6 | #include <cmath>
  +++ |+#include <climits>
    7 | using namespace std;
a.cc:69:11: error: 'INT_MAX' was not declared in this scope
   69 |     cout<<INT_MAX;
      |           ^~~~~~~
a.cc:69:11: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <cmath>
using namespace std;

int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n,m,x;
    cin>>n>>m>>x;
    
    vector<int> value(n);
    vector<vector<int>> book;
    for(int i=0;i<n;i++){
        int c;
        cin>>c;
        value[i]=c;
        vector<int> added;
        for(int j=0; j<m; j++){
            int e;
            cin>>e;
            added.push_back(e);
        }
        book.push_back(added);
    }
    
    int k = (int)pow(2, n);
    int ans = INT_MAX;
    
    for(int i=1; i<k;i++){
        int index = n-1;
        vector<int> sum(m,0);
        int curr = 0;
        int f = i;
        while(f!=0){
            if(f%2){
                for(int j=0; j<m; j++){
                    sum[j]+=book[index][j];
                }
                curr+=value[index];
            }
            f/=2;
            index--;
        }
        bool valid = true;
        for(int j=0;j<m;j++){
            if(sum[j]<x){
                valid =false;
                break;
            }
        }
        if(valid){
            if(ans>curr)
                ans = curr;
               
        }
    }
    
    if(ans!=INT_MAX)
        cout<<ans<<endl;
    else
        cout<<-1<<endl;
    
    
    return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
int main() {
  ll n, m, x; cin>>n>>m>>x;
  vector<ll> c(n);
  vector<vector<ll>> a(n, vector<ll>(m));
  rep(i, n) {
    cin>>c.at(i);
    rep(j, m) {
      cin>>a.at(i).at(j);
    }
  }
  ll ans=99999999999;
  for(int bit=0; bit<(1<<n); i++) {
    int cost=0;
    vector<ll> skill(m);
    for(int j=0; j<n; j++) {
      if(bit>>j&1) {
        cost+=c.at(j);
        rep(h, m) skill.at(h)+=a.at(j).at(h);
      }
    }
    bool ok=true;
    rep(i, m) {
      if(skill.at(i)<x) ok=false;
    }
    if(ok) ans=min(ans, cost);
  }
  if (ans==99999999999) cout << -1;
  else cout << ans;  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:30: error: 'i' was not declared in this scope
   16 |   for(int bit=0; bit<(1<<n); i++) {
      |                              ^
a.cc:29:19: error: no matching function for call to 'min(ll&, int&)'
   29 |     if(ok) ans=min(ans, cost);
      |                ~~~^~~~~~~~~~~
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:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:29:19: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   29 |     if(ok) ans=min(ans, cost);
      |                ~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281: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:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:29:19: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   29 |     if(ok) ans=min(ans, cost);
      |                ~~~^~~~~~~~~~~
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 pii = pair<int,int>;

const int INF = 2e9;

int main(){
    int n,m,x;
    cin >> n >> m >> x;
    vector<vector<int>> a(n,vector<int>(m));
    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 = ture;
        rep(j,m) if(d[j] < k) ok = false;
        if(ok) ans = min(ans,cost);
    }
    if(ans == INF) cout << -1 << endl;
    else cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:41: error: expected ';' before '}' token
   25 |                 rep(j,m) d[j] += a[i][j]
      |                                         ^
      |                                         ;
   26 |             }
      |             ~                            
a.cc:28:19: error: 'ture' was not declared in this scope
   28 |         bool ok = ture;
      |                   ^~~~
a.cc:29:28: error: 'k' was not declared in this scope
   29 |         rep(j,m) if(d[j] < k) ok = false;
      |                            ^
Language: C++

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

int main() {
	int N, M, X;
	int A[12][12];
	int C[12];
	cin >> N >> M >> X;
	for (int n = 0; n < N; n++) {
		cin >> C[n];
		for (int m = 0; m < M; m++) {
			cin >> A[n][m];
		}
	}

	for (int m = 0; m < M; m++) {
		int sum = 0;
		for (int n = 0; n < N; n++) {
			sum += A[n][m];
		}
		if (sum < X) {
			cout << "-1" << endl;
			return 0;
		}
	}
	bool is_brought[12];
	int max = pow(2, N);
	int ans = 100000 * 12;
	for (int k = 1; k <= max; k++) {
		int cost = 0;
		vector<int> sumA(M);
		for (int n = 0; n < N; n++) {

			if (((k >> n) & 1)== 1) {
				cost += C[n];
				for (int m = 0; m < M; m++) {
					sumA[m] += A[n][m];
				}
			}
		}

		// 理解度X以上
		bool can_understand = true;
		for (int m = 0; m < M; m++) {
			if (sumA[m] < X) {
				can_understand = false;
			}
		}
		if (can_understand == true && cost < ans) {
			ans = cost;
		}
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:19: error: 'pow' was not declared in this scope
   28 |         int max = pow(2, N);
      |                   ^~~
Language: C++

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

int main() {
	int N, M, X;
	int A[12][12];
	int C[12];
	cin >> N >> M >> X;
	for (int n = 0; n < N; n++) {
		cin >> C[n];
		for (int m = 0; m < M; m++) {
			cin >> A[n][m];
		}
	}

	for (int m = 0; m < M; m++) {
		int sum = 0;
		for (int n = 0; n < N; n++) {
			sum += A[n][m];
		}
		if (sum < X) {
			cout << "-1";
			return 0;
		}
	}
	bool is_brought[12];
	int max = pow(2, N);
	int ans = 100000 * 12;
	for (int k = 1; k <= max; k++) {
		int cost = 0;
		vector<int> sumA(M);
		for (int n = 0; n < N; n++) {

			if (((k >> n) & 1)== 1) {
				cost += C[n];
				for (int m = 0; m < M; m++) {
					sumA[m] += A[n][m];
				}
			}
		}

		// 理解度X以上
		bool can_understand = true;
		for (int m = 0; m < M; m++) {
			if (sumA[m] < X) {
				can_understand = false;
			}
		}
		if (can_understand == true && cost < ans) {
			ans = cost;
		}
	}
	cout << ans;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:19: error: 'pow' was not declared in this scope
   28 |         int max = pow(2, N);
      |                   ^~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
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);
  rep(i,n) {
    cin >> c[i];
    rep(j,m) cin >> a[i][j];
  }
  
  int ans = INF;
  rep(i,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: In function 'int main()':
a.cc:23:11: error: 's' was not declared in this scope
   23 |       if (s>>i&1) {
      |           ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
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);
  rep(i,n) {
    cin >> c[i];
    rep(j,m) cin >> a[i][j];
  }
  
  int ans = INF;
  rep(i,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: In function 'int main()':
a.cc:23:11: error: 's' was not declared in this scope
   23 |       if (s>>i&1) {
      |           ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
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);
  rep(i,n) {
    cin >> c[i];
    rep(j,m) cin >> a[i][j]
  }
  
  int ans = INF;
  rep(i,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: In function 'int main()':
a.cc:15:28: error: expected ';' before '}' token
   15 |     rep(j,m) cin >> a[i][j]
      |                            ^
      |                            ;
   16 |   }
      |   ~                         
a.cc:23:11: error: 's' was not declared in this scope
   23 |       if (s>>i&1) {
      |           ^
Language: C++

#include <bits/stdc++.h>
#define ll long long
using namespace std;
 
int main() {
  int n, m, x; cin >> n >> m >> x;
  vector<vector<int>> data(n, vector<int>(m));
  vector<int>c(n)
  int ans=100001;
  int cost=0;
  for (int i = 0; i < n; i++) {
    cin >> c.at(i);
    for (int j = 0; j < m; j++) {
      cin >> data.at(i).at(j);
    }
  }

  for (int tmp = 0; tmp < (1 << n); ++tmp) {
    vector<int> ver(m);
    for(int i=0; i<n; i++){
      if(tmp & (1 << i)){
        cost += c.at(i)
        for(int j=0; j<m; j++){
          ver.at(j) += data.at(i).at(j);
        }
      }
    }
    bool ok=true;
    for(int j=0; j<m; j++){
      if(ver.at(j)<x) ok=false;
    }
    if(ok) ans = min(ans,cost);
  }
  if(ans==100001) cout << -1;
  else cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected ',' or ';' before 'int'
    9 |   int ans=100001;
      |   ^~~
a.cc:22:24: error: expected ';' before 'for'
   22 |         cost += c.at(i)
      |                        ^
      |                        ;
   23 |         for(int j=0; j<m; j++){
      |         ~~~             
a.cc:23:22: error: 'j' was not declared in this scope
   23 |         for(int j=0; j<m; j++){
      |                      ^
a.cc:32:12: error: 'ans' was not declared in this scope; did you mean 'abs'?
   32 |     if(ok) ans = min(ans,cost);
      |            ^~~
      |            abs
a.cc:34:6: error: 'ans' was not declared in this scope; did you mean 'abs'?
   34 |   if(ans==100001) cout << -1;
      |      ^~~
      |      abs
Language: C++

#include <bits/stdc++.h>
#define ll long long
using namespace std;
 
int main() {
  int n, m, x; cin >> n >> m >> x;
  vector<vector<int>> data(n, vector<int>(m));
  vector<int>c(n)
  int ans=100001;
  int cost=0;
  for (int i = 0; i < n; i++) {
    cin >> c.at(i)
    for (int j = 0; j < m; j++) {
      cin >> data.at(i).at(j);
    }
  }

  for (int tmp = 0; tmp < (1 << n); ++tmp) {
    vector<int> ver(m);
    for(int i=0; i<n; i++){
      if(tmp & (1 << i)){
        cost += c.at(i)
        for(int j=0; j<m; j++){
          ver.at(j) += data.at(i).at(j);
        }
      }
    }
    bool ok=true;
    for(int j=0; j<m; j++){
      if(ver.at(j)<x) ok=false;
    }
    if(ok) ans = min(ans,cost);
  }
  if(ans==100001) cout << -1;
  else cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected ',' or ';' before 'int'
    9 |   int ans=100001;
      |   ^~~
a.cc:12:19: error: expected ';' before 'for'
   12 |     cin >> c.at(i)
      |                   ^
      |                   ;
   13 |     for (int j = 0; j < m; j++) {
      |     ~~~            
a.cc:13:21: error: 'j' was not declared in this scope
   13 |     for (int j = 0; j < m; j++) {
      |                     ^
a.cc:22:24: error: expected ';' before 'for'
   22 |         cost += c.at(i)
      |                        ^
      |                        ;
   23 |         for(int j=0; j<m; j++){
      |         ~~~             
a.cc:23:22: error: 'j' was not declared in this scope
   23 |         for(int j=0; j<m; j++){
      |                      ^
a.cc:32:12: error: 'ans' was not declared in this scope; did you mean 'abs'?
   32 |     if(ok) ans = min(ans,cost);
      |            ^~~
      |            abs
a.cc:34:6: error: 'ans' was not declared in this scope; did you mean 'abs'?
   34 |   if(ans==100001) cout << -1;
      |      ^~~
      |      abs
Language: C++

#include <bits/stdc++.h>
#define ll long long
using namespace std;
 
int main() {
  int n, m, x; cin >> n >> m >> x;
  vector<vector<int>> data(n, vector<int>(m));
  int ans=0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> data.at(i).at(j);
    }
  }

  for (int tmp = 0; tmp < (1 << n); ++tmp) {
    vector<int> ver(4);
    for(int i=0; i<n; ++i){
      if(tmp & (1 << i)){
        ver += data.at(i)
      }
    }
    if(ans < ver.at(0) && vec.at(1)>x && vec.at(2)>x && vec.at(3)>x){
      ans=ver.at(0);
    }
  }  
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:13: error: no match for 'operator+=' (operand types are 'std::vector<int>' and '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'})
   19 |         ver += data.at(i)
      |         ~~~~^~~~~~~~~~~~~
a.cc:22:27: error: 'vec' was not declared in this scope; did you mean 'ver'?
   22 |     if(ans < ver.at(0) && vec.at(1)>x && vec.at(2)>x && vec.at(3)>x){
      |                           ^~~
      |                           ver
Language: C++

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

int n, m, x;
std::vector<std::vector<int>> vec;
std::vector<int> book_prices;

int main() {
    std::cin >> n >> m >> x;
    book_prices.assign(n, 0);
    vec.assign(n, std::vector<int>(m, 0));
    for (int i = 0; i < n; i++) {
        std::cin >> book_prices[i];
        for (int j = 0; j < m; j++) {
            std::cin >> vec[i][j];
        }
    }
    for (int i = 0; i < (2 << n); i++) {
        std::vector<int> skill(n, 0);
        int total_price = 0;
        for (int j = 0; j < n; j++) {
            if ((i >> j) & 1) {
                total_price += book_prices[j];
                for (int k = 0; k < m; k++) {
                    skill[k] += vec[j][k];
                }
            }
        }
        int min_skill = *std::min_element(skill.begin(), skill.end())
        if (min_skill >= x) {
            res.push_back(total_price);
        }
        
    }
    std::cout << *std::min_element(res.begin(), res.end()) << std::endl;
    
    
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:9: error: expected ',' or ';' before 'if'
   31 |         if (min_skill >= x) {
      |         ^~
a.cc:36:36: error: 'res' was not declared in this scope
   36 |     std::cout << *std::min_element(res.begin(), res.end()) << std::endl;
      |                                    ^~~
Language: C++

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

int main(){
    int N, M, X;
    cin >> N >> M >> X;
    int algo[N][M];
    int cost[N];
    for(int i = 0; i < N; i++){
        cin >> cost[i];
        for(int j = 0; j < M; j++)cin >> algo[i][j];
    }
    int ans = 12345678;
    int all = 1<<N;
    for(int mask = 0; mask < all; mask++){
        int level[M]={};
        int tmp_cost = 0;
        for(int i = 0; i < N; i++){
            if((mask>>i)&1){
                tmp_cost += cost[i];
                for(int j = 0; j < M; j++){
                    level[j] += algo[i][j];
                }
            }
        }
        bool flag = true;
        for(int j = 0; j < M; j++){
            if(level[j] < X) flag = false;
        }
        if(flag) ans = min(ans,cost);
    }
    if(ans == 12345678) cout << -1 << endl;
    else cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:27: error: no matching function for call to 'min(int&, int [N])'
   32 |         if(flag) ans = min(ans,cost);
      |                        ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:32:27: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'int [N]')
   32 |         if(flag) ans = min(ans,cost);
      |                        ~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:32:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   32 |         if(flag) ans = min(ans,cost);
      |                        ~~~^~~~~~~~~~
Language: C++

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

int main(){
    int N, M, X;
    cin >> N >> M >> X;
    int algo[N][M];
    int cost[N];
    for(int i = 0; i < N; i++){
        cin >> cost[i];
        for(int j = 0; j < M; j++)cin >> algo[i][j];
    }
    int ans = 12345678;
    int all = 1<<N;
    for(int mask = 0; mask < all; mask++){
        int level[M]={};
        int tmp_cost = 0;
        for(int i = 0; i < N; i++){
            if((mask>>i)&1){
                tmp_cost += cost[i];
                for(int j = 0; j < M; j++){
                    level[j] += algo[i][j];
                }
            }
        }
        bool flag = true;
        for(int j = 0; j < M; j++){
            if(level[j] < X) flag = false;
        }
        if(flag) ans = min(ans,cost);
    }
    if(ans == 12345678) cout << -1 << endl;
    else cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:27: error: no matching function for call to 'min(int&, int [N])'
   31 |         if(flag) ans = min(ans,cost);
      |                        ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:31:27: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'int [N]')
   31 |         if(flag) ans = min(ans,cost);
      |                        ~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  //入力
  int N,M,X;
  cin>>N>>M>>X;
  int C[N];
  int A[N][M];
  
  for(int i=0;i<N;i++) {
    cin>>C[i];
    for(int j=0;j<M;j++){
      cin>>A[i][j];
    }
  }
  
  bool judge;
  int ans=100010;
  
  for(int tmp=0;tmp<(1<<12);tmp++) {
    bitset<12> s(tmp);
    judge=true;
    
    int sum[M];
    int cost=0;
    for(int i=0;i<N;i++) {
      for(int j=0;j<M;j++) {
        if(s.test(i)){
          sum[j]+=A[i][j];
          cost+=C[i];
        }
      }
    }
      
      for(int i=0;i<M;i++){
        if(sum[i]<X){
          judge=false;
          break;
        }
      }
    cost=/M;
      if(judge){
        ans=min(ans,cost);
      }
    }
  if(judge){
    cout<<ans<<endl;
  }
  else{
    cout<<"-1"<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:10: error: expected primary-expression before '/' token
   41 |     cost=/M;
      |          ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  //入力
  int N,M,X;
  cin>>N>>M>>X;
  int C[N];
  int A[N][M];
  
  for(int i=0;i<N;i++) {
    cin>>C[i];
    for(int j=0;j<M;j++){
      cin>>A[i][j];
    }
  }
  bool judge;
  int ans=100010;
  
  for(int tmp=0;tmp<(1<<N);tmp++) {
    bitset<12> s(tmp);
    judge=true;
    
    int sum[M];
    int cost=0;
    for(int j=0;j<M;j++) {
      sum[j]=0;
    }
    
    for(int i=0;i<M;i++) {
      for(int j=0;j<N;j++) {
        if(tmp & (1<<j){
          sum[i]+=A[j][i];
        }
      }
      if(s.test(i)){
        cost+=C[i];
      }
    }
      
      for(int i=0;i<M;i++){
        if(sum[i]<X){
          judge=false;
          break;
        }
      }
    if(judge){
      ans=min(ans,cost);
    }
  }
  
  if(judge){
    cout<<ans<<endl;
  }
  else{
    cout<<-1<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:24: error: expected ')' before '{' token
   31 |         if(tmp & (1<<j){
      |           ~            ^
      |                        )
a.cc:34:7: error: expected primary-expression before '}' token
   34 |       }
      |       ^
Language: C

#include<stdio.h>
using namespace std ;
int n,m,x,X[20],S=0,d[20][20],sum=99999999;
void F(int i)
{
    if(i>n)return ;
    int j,flag;
    F(i+1);
    for(j=1;j<=m;j++)
    {
        X[j]+=d[i][j];
    }
    S+=d[i][0];
    for(j=1,flag=1;j<=m;j++)
    if(X[j]<x){flag=0;break;}
    if(flag==1){if(S<sum)sum=S;}
    F(i+1);
    for(j=1;j<=m;j++)
    {
        X[j]-=d[i][j];
    }
    S-=d[i][0];
}
int main()
{
    int i,j;
    scanf("%d%d%d",&n,&m,&x);
    for(i=1;i<=n;i++)
    {
        scanf("%d",&d[i][0]);
        for(j=1;j<=m;j++)scanf("%d",&d[i][j]);
    }
    F(1);
    if(sum==99999999)printf("-1\n");
    else printf("%d\n",sum);
}



Compiler output:
main.c:2:1: error: unknown type name 'using'
    2 | using namespace std ;
      | ^~~~~
main.c:2:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    2 | using namespace std ;
      |                 ^~~
Language: C++

#include<iostream>
#include<vector>
const int INF=1001001001;
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=INF;
  for(int bit=0;bit<(1<<n);bit++){
     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 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:21:10: error: 's' was not declared in this scope
   21 |       if(s>>i&1){
      |          ^
Language: C++

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


const int INF=11000;
int main(){
  int books,arugos,mokuhyou;
  cin>>books>>arugos>>mokuhyou;
  vector<int>kinhyou(books);

  vector<vector<int>>arugohyou(books,vector<int>(arugos,0));
  for(int i=0;i<books;i++){
   cin>>kinhyou[i];
      for(int j=0;j<arugos;j++){
          cin>>arugohyou[i][j];
      }
  }
  
  int ans=INF;
  for(int i=0;i<(1<<books);i++){
      int kingaku=0;
      vector<int>rikaidos(arugos);
      for(int s=0;s<arugos;s++){
          if(s>>i&1){
              kingaku+=kinhyou[s];
              for(int h=0;h<arugos;h++){
                  rikaidos[h]+=arugohyou[s][h];

              }

          }
          bool ok=true;
          for(int i=0;i<arugos;i++){
              if(rikaidos[i]<mokuhyou){
                  ok=false;
              }
          }
          if(ok)ans=min(ans,kingaku);
      }
      if (ans==INF) cout<<-1<<endl;
      cout<<ans<<endl;
      return 0;


      
      


      

      
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:53:4: error: expected '}' at end of input
   53 |   }
      |    ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: C++

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


const int INF=11000101000;
int main(){
  int books,arugos,mokuhyou;
  cin>>books>>arugos>>mokuhyou;
  vector<int>kinhyou(books);

  vector<vector<int>>arugohyou(books,vector<int>(arugos,0));
  for(int i=0;i<books;i++){
   cin>>kinhyou[i];
      for(int j=0;j<arugos;j++){
          cin>>arugohyou[i][j];
      }
  }
  
  int ans=INF;
  for(int i=0;i<(1<<books);i++){
      int kingaku=0;
      vector<int>rikaidos(arugos);
      for(int s=0;s<arugos;s++){
          if(s>>i&1){
              kingaku+=kinhyou[s];
              for(int h=0;h<arugos;h++){
                  rikaidos[h]+=arugohyou[s][h];

              }

          }
          bool ok=true;
          for(int i=0;i<arugos;i++){
              if(rikaidos[i]<mokuhyou){
                  ok=false;
              }
          }
          if(ok)ans=min(ans,kingaku);
      }
      if (ans==INF) cout<<-1<<endl;
      cout<<ans<<endl;
      return 0;


      
      


      

      
  }

Compiler output:
a.cc:6:15: warning: overflow in conversion from 'long int' to 'int' changes value from '11000101000' to '-1884800888' [-Woverflow]
    6 | const int INF=11000101000;
      |               ^~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:53:4: error: expected '}' at end of input
   53 |   }
      |    ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: C++

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

const int INF = 100000000;


int main()
{
     int N,M,X;
     int hekaku =INF;
     cin>>N>>M>>X;
      int c[N];
      int A[N][M];
     
  
      for(int i=0;i<N;i++)
      {
         cin>>c[i];
         for(int j=0;j<M;j++)
         {
             cin>>A[i][j];
         }
      }

    
  
     for(int bit =0;bit<(1<<N))
     {
        int sum =0;
        int m=0;
          for(int i=0;i<N;i++)
          {
               if(bit&(1<<i))
               {
                   sum += c[i];
                 
                   for(int j=0;j<M;j++)
                   {
                       m += A[i][j];
                   }
               } 
          }
       
       if(m >=X) 
       {
         hekaku = min(hekaku,sum);
       }     
     }

  if(hekaku!=INF)
  {
        cout<<hekaku<<endl;
  }
  else
  {
      cout<<"-1"<<endl;    
  }
  
  
  returm 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:31: error: expected ';' before ')' token
   27 |      for(int bit =0;bit<(1<<N))
      |                               ^
      |                               ;
a.cc:60:3: error: 'returm' was not declared in this scope
   60 |   returm 0;
      |   ^~~~~~
Language: C++

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

long ans;
int n, m, x, skill[15][15];
vector<int> costs;

void subsequences(vector<int> arr, int index,  
                       vector<int> subarr) 
{ 
    // Print the subsequence when reach 
    // the leaf of recursion tree 
    if (index == arr.size()) 
    { 
        if(subarr.size())
        {
            long algo[m] = {0}, cost = 0;
            int flag = 1;
    
            for (int i = 0; i < l; i++)
            {
                cost += costs[arr[i]];
                for(int j = 0 ; j < m ; j++)
                    algo[j] +=  skill[arr[i]][j];
            }

            for(int j = 0 ; j < m ; j++)
                if(algo[j] < x)
                {
                    flag = 0;
                    break;
                }

            if(flag)
                ans = cost < ans ? cost : ans;
        }
    } 
    else
    { 
        // Subsequence without including 
        // the element at current index 
        subsequences(arr, index + 1, subarr); 
  
        subarr.push_back(arr[index]); 
  
        // Subsequence including the element 
        // at current index 
        subsequences(arr, index + 1, subarr); 
    } 
    return; 
} 

int main()
{
    vector<int> arr;
    scanf("%d %d %d",&n, &m, &x);
    
    for(int i = 0 ; i < n ; i++)
    {
        int ci;
        scanf("%d", &ci);
        costs.push_back(ci);
        arr.push_back(i);
        for(int j = 0 ; j < m ; j++)
            scanf("%d",&skill[i][j]);
        //printf("\n");
    }
    
    ans = LONG_MAX;
    //printf("%ld",ans);
    vector<int> b; 
    subsequences(arr, 0, b); 
    
    ans = (ans == LONG_MAX) ? -1 : ans;
    printf("%ld",ans);
    
    return 0;
  
}


Compiler output:
a.cc: In function 'void subsequences(std::vector<int>, int, std::vector<int>)':
a.cc:21:33: error: 'l' was not declared in this scope
   21 |             for (int i = 0; i < l; i++)
      |                                 ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define pb			push_back
#define vi  		vector<int>
#define all(a)		(a).begin(),(a).end()
#define F 			first
#define S 			second
#define endl		"\n"
#define fast 		ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define int 		long long int
#define mod			1000000007
#define test		int t;cin>>t;while(t--)
#define REP(i,a,b)  for(int i=a,i<=b;i++)


int mn=INT_MAX;
void solve(int arr[], int n,vector<vector<int>> a,
	vector<int> c,int x) 
{ 
	int cost=0;
	int m=a[0].size();
	vector<int> reqd(m,x);
    for (int i = 0; i < n; i++) { 
    	// cout<<arr[i]<<" ";
        if(arr[i]){
        	cost+=c[i];
        	for(int j=0;j<m;j++){
        		reqd[j]-=a[i][j];
        	}
        } 
    } 
    // cout<<endl;
    int flag=0;
    for(auto p:reqd){
    	if(p > 0){
    		// cout<<p<<" "<<endl;
    		flag=1;
    		break;
    	}
    }
    // cout<<cost<<endl;
    if(flag==0){
    	mn=min(mn,cost);
    	// cout<<mn<<endl;
    }
} 
  
void generate(int n, int arr[], int i,vector<vector<int>> a,
			vector<int> c,int x)
{ 
    if (i == n) { 
        solve(arr, n,a,c,x); 
        return; 
    } 
 
    arr[i] = 0; 
    generate(n, arr, i + 1,a,c,x); 
  
    arr[i] = 1; 
    generate(n, arr, i + 1,a,c,x); 
} 

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

	vector<vector<int>> a(n,vector<int> (m));
	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 val=m;
	int arr[m];
	generate(n,arr,0,a,c,x);

	if(mn==INT_MAX)
		cout<<-1<<endl;
	else
		cout<<mn<<endl;
	return 0;
}

Compiler output:
a.cc:10:35: error: '::main' must return 'int'
   10 | #define int             long long int
      |                                   ^~~
a.cc:63:1: note: in expansion of macro 'int'
   63 | int main()
      | ^~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: 'i' was not declared in this scope
   17 |     for(i = 0; i < n; i++){
      |         ^
a.cc:20:13: error: 'j' was not declared in this scope
   20 |         for(j = 0; j < m; j++){
      |             ^
Language: C++

#include<iostream>
#include<vector>
const int INF=1001001001;
using namespace std;
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 i=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 j=0;j<m;j++) 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:11:17: error: 'j' was not declared in this scope
   11 |     for(int i=0;j<m;j++){
      |                 ^
a.cc:12:12: error: 'a' was not declared in this scope
   12 |       cin>>a[i][j];
      |            ^
a.cc:22:36: error: 'a' was not declared in this scope
   22 |         for(int j=0;j<m;j++) d[j]+=a[i][j];
      |                                    ^
Language: C++

#include <iostream>
#include <cstdio>
using namespace std;
int main() {
	int i, j, k;
	cin >> n >> m >> x;
	for(i=0; i<n; i++) {
		cin >> c[i];
		for(j=0; j<m; j++) cin >> a[i][j];
	}
	for(k=0; k<1<<n; k++) {
		int sc=0, sa[15]={};
		for(i=0; i<n; i++) {
			if(k>>i & 1) {
				sc += c[i];
				for(j=0; j<m; j++) sa[j] += a[i][j];
			}
		}
		for(j=0; j<m; j++) if(sa[j] < x) break;
		if(j==m) mn = min(mn, sc);
	}
	cout << (mn==1e9 ? -1 : mn);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:16: error: 'n' was not declared in this scope
    6 |         cin >> n >> m >> x;
      |                ^
a.cc:6:21: error: 'm' was not declared in this scope
    6 |         cin >> n >> m >> x;
      |                     ^
a.cc:6:26: error: 'x' was not declared in this scope
    6 |         cin >> n >> m >> x;
      |                          ^
a.cc:8:24: error: 'c' was not declared in this scope
    8 |                 cin >> c[i];
      |                        ^
a.cc:9:43: error: 'a' was not declared in this scope
    9 |                 for(j=0; j<m; j++) cin >> a[i][j];
      |                                           ^
a.cc:15:39: error: 'c' was not declared in this scope; did you mean 'sc'?
   15 |                                 sc += c[i];
      |                                       ^
      |                                       sc
a.cc:16:61: error: 'a' was not declared in this scope; did you mean 'sa'?
   16 |                                 for(j=0; j<m; j++) sa[j] += a[i][j];
      |                                                             ^
      |                                                             sa
a.cc:20:26: error: 'mn' was not declared in this scope
   20 |                 if(j==m) mn = min(mn, sc);
      |                          ^~
a.cc:22:18: error: 'mn' was not declared in this scope
   22 |         cout << (mn==1e9 ? -1 : mn);
      |                  ^~
Language: C++

#include <iostream>
#include <cstudio>
using namespace std;
int main() {
	int i, j, k;
	cin >> n >> m >> x;
	for(i=0; i<n; i++) {
		cin >> c[i];
		for(j=0; j<m; j++) cin >> a[i][j];
	}
	for(k=0; k<1<<n; k++) {
		int sc=0, sa[15]={};
		for(i=0; i<n; i++) {
			if(k>>i & 1) {
				sc += c[i];
				for(j=0; j<m; j++) sa[j] += a[i][j];
			}
		}
		for(j=0; j<m; j++) if(sa[j] < x) break;
		if(j==m) mn = min(mn, sc);
	}
	cout << (mn==1e9 ? -1 : mn);
	return 0;
}

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

#include <iostream>
#include <cstudio>
int main() {
	int i, j, k;
	cin >> n >> m >> x;
	for(i=0; i<n; i++) {
		cin >> c[i];
		for(j=0; j<m; j++) cin >> a[i][j];
	}
	for(k=0; k<1<<n; k++) {
		int sc=0, sa[15]={};
		for(i=0; i<n; i++) {
			if(k>>i & 1) {
				sc += c[i];
				for(j=0; j<m; j++) sa[j] += a[i][j];
			}
		}
		for(j=0; j<m; j++) if(sa[j] < x) break;
		if(j==m) mn = min(mn, sc);
	}
	cout << (mn==1e9 ? -1 : mn);
	return 0;
}

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

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

int main(){
    int n,m,x;
    cin>>n>>m>>x;
    vector<vector<int>> a(n,vector<int> (m));
    vector<int> c(n);

    rep(i,n){
        cin>>c[i];
        rep(j, m){
            cin>>a[i][j];
        }
    }

    int ans =12345678;
    int all = 1<<n;
    rep(mask, all){
        vector<int> level(m);
        int cost = 0;
        rep(i,n){
            if((mask>>i)&1){
                cost += c[i];
                rep(j, m){
                    level[i] += a[i][j];
                }
            }
        }
        bool ok = true;
        
        rep(j, m) {
            if(level[j] < x) ok = false;
        }

        if(ok) ans = min(ans,cost);
    }

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

}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'cin' was not declared in this scope
    9 |     cin>>n>>m>>x;
      |     ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <vector>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:42:26: error: 'cout' was not declared in this scope
   42 |     if (ans == 12345678) cout << -1 << endl;
      |                          ^~~~
a.cc:42:26: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:42:40: error: 'endl' was not declared in this scope
   42 |     if (ans == 12345678) cout << -1 << endl;
      |                                        ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include <vector>
  +++ |+#include <ostream>
    2 | using namespace std;
a.cc:43:10: error: 'cout' was not declared in this scope
   43 |     else cout << ans << endl;
      |          ^~~~
a.cc:43:10: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:43:25: error: 'endl' was not declared in this scope
   43 |     else cout << ans << endl;
      |                         ^~~~
a.cc:43:25: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: Java

class Main {
  final static int INF = 1001001001;

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

    // 入力データを変数に格納する
    int n = sc.nextInt();
    int m = sc.nextInt();
    int x = sc.nextInt();
    int[][] a = new int[12][12];
    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 s = 0; s < 1<<n; s++) {
      int cost = 0;         // このs番目の組み合わせのコスト
      int[] d = new int[m]; // このs番目の組み合わせでの各アルゴリズムの理解度

      // ２進数で各ビットが1になっているかどうか調べる
      for (int i = 0; i < n; i++) {

        // 右からi番目のビットが1になっていれば、購入する参考書としてコストとアルゴリズムを加算する
        if ( (s & 1<<i) == 1<<i) {
          // コストを足す
          cost += c[i];

          // 各アルゴリズムの理解度に足す
          for (int j = 0; j < m; j++) {
            d[j] += a[i][j];
          }
        }
      }

      // 全てのアルゴリズムの理解度がxを超えているかチェックする
      boolean ok = true;
      for (int j = 0; j < m; j++) {
        if (d[j] < x) ok = false; // １つでもx未満があれば。
      }
      // チェックOKであれば、そのコストが最小値を更新するかどうか。
      if (ok) ans = Math.min(ans, cost);

    }

    // 全てのアルゴリズムの理解度がxを超えるパターンが１つもない場合はansがINFのままになってる
    if (ans == INF) System.out.println(-1);
    else System.out.println(ans);

  }
}

Compiler output:
Main.java:5: error: cannot find symbol
    Scanner sc = new Scanner(System.in);
    ^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
    Scanner sc = new Scanner(System.in);
                     ^
  symbol:   class Scanner
  location: class Main
2 errors