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

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<set>
#include<vector>
#include<cstring>
#define INF 1000000000
using namespace std;
int n,m,x,yes=1,al[13],money[13],y,t,score[13][13],ans,mark[13][13],cash[13],gone[13],sum;
void dfs(int i,int time){
    if(i==n){
        return;
    }
    for(int g=i+1;g<=n;g++){
        t=1;
            for(int l=1;l<=m;l++)
        {
            if(gone[g])
                break;
            mark[l][time]=mark[l][time-1]+score[l][g];
            if(mark[l][time]<x)
                t=0;
            cash[time]=cash[time-1]+money[g];
            if(t&&l==m){
                ans=min(ans,cash[time]);
            }
            if(l==m){
                gone[g]=1;
                dfs(g,time+1);
                gone[g]=0;
            }
            
        }
    }
}
int main(){
    ans=INF;
    cin>>n>>m>>x;
    for(int i=1;i<=12;i++){
        mark[i][0]=0;
        cash[i]=0;
    }
    for(int g=1;g<=n;g++){
        cin>>money[g];
    for(int i=1;i<=m;i++)
        cin>>score[i][g];
    }
    dfs(0,1);
    for(int i=1;i<=m;i++){
        if(ans==INF){
            yes=0;
            break;
        }
    }
    if(yes)
    cout<<ans;
    else
        cout<<-1;


Compiler output:
a.cc: In function 'int main()':
a.cc:59:18: error: expected '}' at end of input
   59 |         cout<<-1;
      |                  ^
a.cc:37:11: note: to match this '{'
   37 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
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(n);
    rep(i,n){
      if(s>>i&1){
        cost += c[i];
        rep(j,m) d[j] += d[i][j];
      }
    }
    bool ok = true;
    rep(j,m) if(d[j] < x) ok = false;
    rep(ok) ans = min(ans,cost);
  }
  if(ans == INF) cout << -1 << endl;
  else cout << ans << endl;
  return 0;
}

Compiler output:
a.cc:28:11: error: macro "rep" requires 2 arguments, but only 1 given
   28 |     rep(ok) ans = min(ans,cost);
      |           ^
a.cc:2:9: note: macro "rep" defined here
    2 | #define rep(i,n) for (int i = 0; i < (n); ++i)
      |         ^~~
a.cc:6:10: error: expected identifier before numeric constant
    6 | int a = [12][12]
      |          ^~
a.cc: In lambda function:
a.cc:6:13: error: expected '{' before '[' token
    6 | int a = [12][12]
      |             ^
a.cc: At global scope:
a.cc:6:13: error: no match for 'operator[]' (operand types are '<lambda()>' and 'int')
Language: C++

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

int a[20][20],c[20];
#define REP(i,n) for(int i=0;i<n;i++)
void chmin(int &a,int b){
  if(a>b)a=b;
}

int main(){
  int n,m,x,ans=1e9;cin>>n>>m>>x;
  REP(i,n){
    cin>>c[i];
    REP(j,m)cin>>a[i][j];
  }
  REP(bit,1<<n){
    int res=0;
    vector<int> tmp(m,0);
    REP(i,n){
      if((bit>>i)&1){
        res+=c[i];
        REP(j,m)tmp[j]+=a[i][j];
      }
    }
    REP(j,m)if(tmp[j]<x)res=1e9;
    chmin(ans,res)
  }
  cout<<ans<<endl;
}
    


Compiler output:
a.cc: In function 'int main()':
a.cc:26:19: error: expected ';' before '}' token
   26 |     chmin(ans,res)
      |                   ^
      |                   ;
   27 |   }
      |   ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
typedef long long ll ;
const ll INF = 9999999999;

int main(){
    ll N, M, X;
    cin >> N >> M >> X;
    ll C[N];
    ll A[N][M];
    for(int i=0; i<N; i++){
        cin >> C[i];
        for(int j=0; j<M; j++){
            cin >> A[i][j];   
        }
    }
    ll ans = INF;
for(int s = 0; s < (1LL<<N); s++){
    ll Csum = 0;
    Ajsum[M];
    for(int i = 0; i < (N); i++){
      if (s&((1LL)<<i)) {
        Csum += C[i];
        for(int j = 0; j < M; j++) {
            Ajsum[j] += A[i][j];
        }
      }
    }
    bool flag = true;
    for(int j = 0; j < M; j++){
        if (Ajsum[j] < X) flag = false;
    }
    if (flag) ans = min(ans, Csum);
  }
if(ans==INF)ans=-1;
cout << ans << endl;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: 'Ajsum' was not declared in this scope
   21 |     Ajsum[M];
      |     ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll ans=-1;
ll n,m,x;
void dfs(ll h,vector<ll>k,ll sum)
{
    bool f=0;
    for (ll i=0;i<m;i++)
        if (k[i]<x)
    {
        f=1;
        break;
    }
    if (!f)
    {
        if (ans==-1)
            ans=sum;
        ans=min(ans,sum);
        return;
    }
    for (ll i=h;i<n;i++)
    {
        vector<ll>l;
        l=k;
        for (ll j=1;j<=m;j++)
            l[j-1]+=b[i][j];
        dfs(i+1,l,sum+b[i][0]);
    }
}
int main()
{
 cin>>n>>m>>x;
 vector<vector<ll> >b(n,vector<ll>(m+1));
 for (ll i=0;i<n;i++)
 {
     for (ll j=0;j<m+1;j++)
        cin>>b[i][j];
 }
 vector<ll>k(m);
 dfs(0,k,0);
 cout<<ans;
    return 0;
}


Compiler output:
a.cc: In function 'void dfs(long long int, std::vector<long long int>, long long int)':
a.cc:27:21: error: 'b' was not declared in this scope
   27 |             l[j-1]+=b[i][j];
      |                     ^
a.cc:28:23: error: 'b' was not declared in this scope
   28 |         dfs(i+1,l,sum+b[i][0]);
      |                       ^
Language: C++

#include <bits/stdc++.h>
#include <cstdlib>
#include <cmath>
#define rep(i,n) for (long long i=0; i < (n); ++i)
#define rep2(i,n,m) for(long long i=n;i<=m;i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
const ll INF=1e18 ;
inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b){a=min(a,b);}
int main() {
 int n ,m ,x ;
 cin >>n >> m>> x ;
 int c[n] ;
 int a[n][m] ;
 
 int ans = 2000000 ;
 
 int sum[m] ;
 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] ;
  } 
  }
  int seigo =0 ;
  rep(i,m) if(d[i]<x) seigo= 1 ;
  if(seigo==0) ans =min(ans,cost) ;
 }

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

Compiler output:
a.cc:35:10: error: extended character 　 is not valid in an identifier
   35 |   cout <<　ans <<endl ;
      |          ^
a.cc: In function 'int main()':
a.cc:35:10: error: '\U00003000ans' was not declared in this scope
   35 |   cout <<　ans <<endl ;
      |          ^~~~~
Language: C++

#include <bits/stdc++.h>
#include <cstdlib>
#include <cmath>
#define rep(i,n) for (long long i=0; i < (n); ++i)
#define rep2(i,n,m) for(long long i=n;i<=m;i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
const ll INF=1e18 ;
inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b){a=min(a,b);}
int main() {
 int n ,m ,x ;
 cin >>n >> m>> x ;
 int c[n] ;
 int a[n][m] ;
 
 int min = 2000000 ;
 
 int sum[m] ;
 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] ;
  } 
  }
  int seigo =0 ;
  rep(i,m) if(d[i]<x) seigo= 1 ;
  if(seigo==0) ans =min(ans,cost) ;
 }

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

Compiler output:
a.cc:35:10: error: extended character 　 is not valid in an identifier
   35 |   cout <<　ans <<endl ;
      |          ^
a.cc: In function 'int main()':
a.cc:32:16: error: 'ans' was not declared in this scope; did you mean 'abs'?
   32 |   if(seigo==0) ans =min(ans,cost) ;
      |                ^~~
      |                abs
a.cc:32:24: error: 'min' cannot be used as a function
   32 |   if(seigo==0) ans =min(ans,cost) ;
      |                     ~~~^~~~~~~~~~
a.cc:35:10: error: '\U00003000ans' was not declared in this scope
   35 |   cout <<　ans <<endl ;
      |          ^~~~~
Language: C++

#include <bits/stdc++.h>
#define endl "\n"
using namespace std;
 
#define ll long long
const long long llINF = 1LL << 60;
const int iINF = 0x20000000;
template<class T> inline bool chmin(T& a, T b) { if (b < a) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
#define rep(i,n) for (int i = 0; i < (n); ++i)
 
void execute();
int main() 
{
    cin.tie(nullptr);
    ios::sync_with_stdio(false);// cin と scanfの併用禁止
    cout << fixed << setprecision(15);
    execute();
    return 0;
}
 
 
void execute()
{
  int a[12][12];
  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 = iINF;
  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 == iINF) cout << -1 << endl;
  else cout << ans << endl;
}


#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 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 (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:5:12: error: expected nested-name-specifier before 'long'
    5 | #define ll long long
      |            ^~~~
a.cc:56:7: note: in expansion of macro 'll'
   56 | using ll = long long;
      |       ^~
a.cc:63:5: error: redefinition of 'int main()'
   63 | int main() {
      |     ^~~~
a.cc:13:5: note: 'int main()' previously defined here
   13 | int main()
      |     ^~~~
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<map>
#include<utility>
#include<algorithm>
#include<queue>
#include<cmath>
#include<iomanip>
#define REP(i, n) for(ll i = 0; i < n; i++)
#define REPR(i, n) for(ll i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(ll i = m; i <= n; i++)
#define FORR(i, m, n) for(ll i = m; i >= n; i--)
#define SORT(v, n) sort(v, v+n)
#define MAX 100000
#define inf 1000000007
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;

ll n, m, x, ans;

void isSkill(ll bit, vvll a){//今回の組の計算
    bool flag = true;
    vll now(m+1, 0);
    ll money = 0;
    for(ll num : tmp){//今回の組の理解度を算出
        FOR(i, 1, m) now[i] += a[num][i];
        money += a[num][0];
    }
    FOR(i, 1, m){//今回の組がいけているか判断
        if (now[i] < x){
            flag = false;
            break;
        }
    }
    if(flag) ans = min(ans, money);
    return;
}

int main() {
    //cin高速化
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n >> m >> x;
    ans = inf;
    vvll a(n+1, vll(m+1, 0));
    //input
    FOR(i, 1, n) REP(j, m+1) cin >> a[i][j];
    //bit full search
    REP(bit, 1 << N) isSkill(bit, a);

    if(ans == inf) ans = -1;

    cout << ans <<"\n";
	return 0;
}

Compiler output:
a.cc: In function 'void isSkill(ll, vvll)':
a.cc:29:18: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   29 |     for(ll num : tmp){//今回の組の理解度を算出
      |                  ^~~
      |                  tm
a.cc: In function 'int main()':
a.cc:53:19: error: 'N' was not declared in this scope
   53 |     REP(bit, 1 << N) isSkill(bit, a);
      |                   ^
a.cc:10:37: note: in definition of macro 'REP'
   10 | #define REP(i, n) for(ll i = 0; i < n; i++)
      |                                     ^
Language: C++

#include <bits/stdc++.h>
#define endl "\n"
using namespace std;
 
#define ll long long
const long long llINF = 1LL << 60;
const int iINF = 1 << 20;
template<class T> inline bool chmin(T& a, T b) { if (b < a) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
#define rep(i,n) for (int i = 0; i < (n); ++i)
 
void execute();
int main() 
{
    cin.tie(nullptr);
    ios::sync_with_stdio(false);// cin と scanfの併用禁止
    cout << fixed << setprecision(15);
    execute();
    return 0;
}
 
 
void execute()
{
  int a[12][12];
  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 = iINF;
  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;
}


Compiler output:
a.cc: In function 'void execute()':
a.cc:48:14: error: 'INF' was not declared in this scope; did you mean 'iINF'?
   48 |   if (ans == INF) cout << -1 << endl;
      |              ^~~
      |              iINF
Language: C++

#include <bits/stdc++.h>
#define endl "\n"
using namespace std;
 
#define ll long long
const long long llINF = 1LL << 60;
const int iINF = 1 << 20;
template<class T> inline bool chmin(T& a, T b) { if (b < a) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
#define rep(i,n) for (int i = 0; i < (n); ++i)
 
void execute();
int main() 
{
    cin.tie(nullptr);
    ios::sync_with_stdio(false);// cin と scanfの併用禁止
    cout << fixed << setprecision(15);
    execute();
    return 0;
}
 
 
void execute()
{
  int a[12][12];
  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;
}


Compiler output:
a.cc: In function 'void execute()':
a.cc:34:13: error: 'INF' was not declared in this scope; did you mean 'iINF'?
   34 |   int ans = INF;
      |             ^~~
      |             iINF
Language: C++

#include <bits/stdc++.h>
#define endl "\n"
using namespace std;
 
#define ll long long
const long long llINF = 1LL << 60;
const int iINF = 1 << 20;
template<class T> inline bool chmin(T& a, T b) { if (b < a) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
#define rep(i,n) for (int i = 0; i < (n); ++i)
 
void execute();
int main() 
{
    cin.tie(nullptr);
    ios::sync_with_stdio(false);// cin と scanfの併用禁止
    cout << fixed << setprecision(15);
    execute();
    return 0;
}
 
 
void execute()
{
  int a[12][12];
  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: In function 'void execute()':
a.cc:34:13: error: 'INF' was not declared in this scope; did you mean 'iINF'?
   34 |   int ans = INF;
      |             ^~~
      |             iINF
a.cc:50:10: error: return-statement with a value, in function returning 'void' [-fpermissive]
   50 |   return 0;
      |          ^
Language: Java

import java.util.*;
public class Main {
    public static void main(String[] args){
      Scanner s = new Scanner(System.in);
      Integer N = s.nextInt();
      Integer M = s.nextInt();
      Integer X = s.nextInt();
      int[] C = new int[N];
      int[][] A = new int[N][M];
      for(int i = 0; i < N; i++) {
    	  C[i] = s.nextInt();
    	  for(int j = 0; j < M; j++) {
    		  A[i][j] = s.nextInt();
    	  }
      }
      
      int resultPrice = 0;
      int[] resultParam = new int[M];
      for(int k = 0; k < (1<<N); k++) {
    	  int currentPrice = 0;
    	  int[] currentParam = new int[M];
    	  for(int m = 0; m < N; m++) {
    		  if(((k>>m) & 1 )== 1) {
    			  addArrays(currentParam, A[m]);
    			  currentPrice += C[m];
    		  }
    	  }
    	  if(check(currentParam, X)) {
    		  resultPrice = resultPrice > currentPrice || resultPrice == 0 ? currentPrice : resultPrice;
    	  }
      }
      System.out.println(resultPrice);
    }
}

Compiler output:
Main.java:24: error: cannot find symbol
    			  addArrays(currentParam, A[m]);
    			  ^
  symbol:   method addArrays(int[],int[])
  location: class Main
Main.java:28: error: cannot find symbol
    	  if(check(currentParam, X)) {
    	     ^
  symbol:   method check(int[],Integer)
  location: class Main
2 errors
Language: Java

import java.util.*;
public class Main {
    public static void main(String[] args){
      Integer N = s.nextInt();
      Integer M = s.nextInt();
      Integer X = s.nextInt();
      int[] C = new int[N];
      int[][] A = new int[N][M];
      for(int i = 0; i < N; i++) {
    	  C[i] = s.nextInt();
    	  for(int j = 0; j < M; j++) {
    		  A[i][j] = s.nextInt();
    	  }
      }
      
      int resultPrice = 0;
      int[] resultParam = new int[M];
      for(int k = 0; k < (1<<N); k++) {
    	  int currentPrice = 0;
    	  int[] currentParam = new int[M];
    	  for(int m = 0; m < N; m++) {
    		  if(((k>>m) & 1 )== 1) {
    			  addArrays(currentParam, A[m]);
    			  currentPrice += C[m];
    		  }
    	  }
    	  if(check(currentParam, X)) {
    		  resultPrice = resultPrice > currentPrice || resultPrice == 0 ? currentPrice : resultPrice;
    	  }
      }
      System.out.println(resultPrice);
    }
}



Compiler output:
Main.java:4: error: cannot find symbol
      Integer N = s.nextInt();
                  ^
  symbol:   variable s
  location: class Main
Main.java:5: error: cannot find symbol
      Integer M = s.nextInt();
                  ^
  symbol:   variable s
  location: class Main
Main.java:6: error: cannot find symbol
      Integer X = s.nextInt();
                  ^
  symbol:   variable s
  location: class Main
Main.java:10: error: cannot find symbol
    	  C[i] = s.nextInt();
    	         ^
  symbol:   variable s
  location: class Main
Main.java:12: error: cannot find symbol
    		  A[i][j] = s.nextInt();
    		            ^
  symbol:   variable s
  location: class Main
Main.java:23: error: cannot find symbol
    			  addArrays(currentParam, A[m]);
    			  ^
  symbol:   method addArrays(int[],int[])
  location: class Main
Main.java:27: error: cannot find symbol
    	  if(check(currentParam, X)) {
    	     ^
  symbol:   method check(int[],Integer)
  location: class Main
7 errors
Language: Java

import java.util.*;
import java.io.*;
public class C
{
    static BufferedReader br;
    static BufferedWriter bw;
    static void solve()throws Exception
    {
        int nmx[] = Arrays.stream(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
        int n = nmx[0];
        int m = nmx[1];
        int x = nmx[2];
        int A[][] = new int[n][m+1];
        for(int i=0;i<n;i++)
        {
            A[i] = Arrays.stream(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
        }
        int ans = Integer.MAX_VALUE;
        for(int i=0;i<(1<<n);i++)
        {
            ArrayList<Integer> al = new ArrayList<Integer>();
            for(int j=0;j<n;j++)
            {
                if(((i>>j)&1)==1)
                al.add(j);
            }
            int a=0,b=0,c=0;
            int cost = 0;
            for(int j =0 ;j<al.size();j++)
            {
                int temp = al.get(j);
                a += A[temp][1];
                b +=A[temp][2];
                c +=A[temp][3];
                cost+=A[temp][0];
            }
            if(a>=x && b>=x && c>=x)
            ans = Math.min(ans,cost);
        }
        if(ans == Integer.MAX_VALUE)
        ans = -1;
        bw.write(Integer.toString(ans));
    }
    public static void main(String []args)throws Exception
    {
        br = new BufferedReader(new InputStreamReader(System.in));
        bw = new BufferedWriter(new OutputStreamWriter(System.out));
        solve();
        br.close();
        bw.close();
    }
}

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

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

ll a,b,c,n,m,q,x;
ll ans=100000000000;

string s;

ll v[12][12];   // 本によるスキルアップ

int check(vector<int> l){
  rep(i,l.length()){
    if(l[i]<x)return 0;
  }
  return 1;
}

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

  cin>>n>>m>>x;
  vector<int> c(n);    // 価格
  vector<int> s(n,0);  // セレクト
  s[0]=1;
  ll ans=10000000000;
  rep(i,n){
    cin>>c[i];
    rep(j,m)cin>>v[i][j];
  }
  ll last = n-1, shift=0;
  while(1){
    vector<int> l(m,0);  // スキル
    ll money=0; // 料金
    rep(j,n){
      if(s[j]==1){
        money += c[j];
        rep(k,m){
          l[k] += v[j][k];
        }
      }
    }
    if(check(l)==1){
      if(ans>money)ans=money;
    }
    if(s[last]==1){
      shift=0;   
      s[shift]=1;
      last--;
    } else {
      s[shift++]=0;
      s[shift]=1;
    }
    if(last<0)break;
  }
  if(ans==10000000000)ans=-1;
  cout<<ans<<endl;
  

  return 0;
}

Compiler output:
a.cc: In function 'int check(std::vector<int>)':
a.cc:17:11: error: 'class std::vector<int>' has no member named 'length'
   17 |   rep(i,l.length()){
      |           ^~~~~~
a.cc:4:34: note: in definition of macro 'rep'
    4 | #define rep(i,n) for (int i=0; i<n; i++)
      |                                  ^
Language: C++

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

int main(void)
{
    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 (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: In function 'int main()':
a.cc:10:19: error: 'n' was not declared in this scope
   10 |     vector<int> c(n);
      |                   ^
a.cc:14:20: error: 'A' was not declared in this scope
   14 |             cin >> A[i][j];
      |                    ^
a.cc:21:23: error: 'm' was not declared in this scope
   21 |         vector<int> d(m);//各アルゴリズムの理解度を保存する用の配列
      |                       ^
Language: C++

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

int main()
{
	int n,m,x;
	cin >> n>>m>>x;
	vector<vector<int>> lib;
	for (int i = 0; i < n; i++)
	{
		vector<int> book;
		for (int i = 0; i < m+1; i++)
		{
			int a;
			cin >> a;
			book.push_back(a);
		}
		lib.push_back(book);
	}
	long min_cost = pow(10,5)*12+1;
	for (int i = 1; i < (1<<n+1); i++)
	{
		int cost = 0;
		vector<int> skills;
		for (int t = 0; t < m+1; t++)
		{
			skills.push_back(0);
		}
		for (int j = 0; j < n; j++)
		{
			if (i&(1<<j))
			{
				cost += lib[j][0];
				for (int r=1; r<m+1; r++)
				{
					skills[r] += lib[j][r];
				}
			}
		}
		int count = 0;
		for (int s = 1; s < m+1; s++)
		{
			if (skills[s]>=x)
			{
				count += 1;
			}
		}
		if (count==m and cost<min_cost)
		{
			min_cost = cost;
		}
	}
	cout << ((min_cost== pow(10, 5) * 12 + 1)?-1:min_cost);
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:21:25: error: 'pow' was not declared in this scope
   21 |         long min_cost = pow(10,5)*12+1;
      |                         ^~~
Language: C++

#include<bits/stdc++.h>
#define ll long long
using namespace std;
int c[15],a[15][15],b[15];
int n,m,x,sum=0;
void dfs(int k,int sum)
{
	if(sum>=ans) return ;
	if(k>n) 
	{
		for(int i=1;i<=m;++i)
		if(b[i]<x) return ;
		ans=sum;
		return;
	}
	dfs(k+1,sum);
	for(int i=1;i<=m;++i)
	b[i]+=a[x][i];
	dfs(k+1,sum+c[k])
	for(int i=1;i<=m;++i)
	b[i]-=a[k][i] 
}
int main()
{
	scanf("%d%d%d",&n,&m,&x);
	for(int i=1;i<=n;++i)
	{
		scanf("%d",&c[i]);
		for(int j=1;j<=m;j++)
		{
		scanf("%d",&a[i][j]);b[j]+=a[i][j];
		}
	}
	for(int i=1;i<=n;++i)
	{
		if(b[i]<x) 
		{
			printf("-1");return 0;
		}
	}
	ans=0x3f3f3f3f3f;memset(b,0,sizeof(b));
	dfs(1,0);printf("%d",ans);
}

Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:8:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
    8 |         if(sum>=ans) return ;
      |                 ^~~
      |                 abs
a.cc:13:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |                 ans=sum;
      |                 ^~~
      |                 abs
a.cc:19:26: error: expected ';' before 'for'
   19 |         dfs(k+1,sum+c[k])
      |                          ^
      |                          ;
   20 |         for(int i=1;i<=m;++i)
      |         ~~~               
a.cc:20:21: error: 'i' was not declared in this scope
   20 |         for(int i=1;i<=m;++i)
      |                     ^
a.cc: In function 'int main()':
a.cc:41:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   41 |         ans=0x3f3f3f3f3f;memset(b,0,sizeof(b));
      |         ^~~
      |         abs
Language: Java

import java.util.Scanner;

public class QuestionC {

	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[N][M];
		int cost = Integer.MAX_VALUE;
		for(int i = 0; i < N; i++) {
			C[i] = Integer.parseInt(sc.next());
			for(int j = 0; j < M; j++) {
				A[i][j] = Integer.parseInt(sc.next());
			}
		}
		sc.close();

		//ビット全探索
		//各参考書が2進数の各桁に一致
		for(int i = 0; i < (1 << N); i++) {
			int tmpCost = 0;
			int[] satisfaction = new int[M];
			for(int j = 0; j < N; j++) {
				//各参考書を買うか買わないかで条件分岐
				if((i >> j & 1) == 1) {
					tmpCost += C[j];
					for(int k = 0; k < M; k++) {
						satisfaction[k] += A[j][k];
					}
				}
			}
			boolean check = true;
			//各アルゴリズムの理解度の確認
			for(int j = 0; j < M; j++) {
				if(satisfaction[j] < X) {
					check = false;
				}
			}

			//コストの比較
			if(check) {
				cost = Math.min(cost, tmpCost);
			}
		}
		//答えを出力
		System.out.println(cost != Integer.MAX_VALUE ? cost : -1);
	}
}

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

import java.util.*;

class Main {
	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[] C = new int[N];
        int[][] A = new int[N][M];

        for(int i=0;i<N;i++) {
            C[i] = sc.nextInt();
            for(int j=0;j<M;j++) {
                A[i][j] = sc.nextInt();
            } 
        }

        //出力の値(ダメな時 -1)
        int out = 0;

        //不可能チェック
        boolean f = true;
        //全アルゴリズム別に得点を全て累計
        for(int i=0; i<M; i++) {
            int tmp = 0;
            for(int j=0; j<N; j++) {
                tmp += a[j][i];
            }
            if(tmp < x) {
                check = false;
                break;
            }
        }
        if(check == false) {
            out = -1;
        } else {
            //最小金額の初期値
            int min = 0;
            for(int i=0; i<N; i++) {
                min += C[i];
            }

            //全通り(N冊)
            int ptn = (int)Math.pow(2,N); 
            for(int i=0; i<ptn; i++) {
                int cost = 0;
                int[] score = new int[M];
                for(int j=0; j<N; j++) {
                    if(((i)&(int)Math.pow(2,j)) != 0) {
                        cost += C[j];
                        for(int k=0; k<M; k++) {
                            score[k] += A[j][k];
                        }
                    }
                }
                //scoreチェック
                boolean scheck = true;
                for(int l = 0; l<M; l++) {
                    if(score[l] < X) {
                        scheck = false;
                        break;
                    }
                }
                if(scheck == true) {
                    if(cost < min) {
                        min = cost;
                    }
                }
            }
            out = min;
        }
        // 出力
        System.out.println(out);
        /*int[] score = new int[M];

        for(int i=0;i<N;i++) {
            for(int j=0;j<M;j++) {
                score[j] += A[i][j]; 
                if(score[j] < M) 
                    f = false; //もし，スコアがM以下なら(一つでもあればfalse)
                cost = Math.min(cost,C[i]);
            }
            
        }
        if(f = false) System.out.println(-1);
        else System.out.println(sum);
        */
    }
}

Compiler output:
Main.java:29: error: cannot find symbol
                tmp += a[j][i];
                       ^
  symbol:   variable a
  location: class Main
Main.java:31: error: cannot find symbol
            if(tmp < x) {
                     ^
  symbol:   variable x
  location: class Main
Main.java:32: error: cannot find symbol
                check = false;
                ^
  symbol:   variable check
  location: class Main
Main.java:36: error: cannot find symbol
        if(check == false) {
           ^
  symbol:   variable check
  location: class Main
4 errors
Language: C++

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

using namespace std;

const ll mod = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;

//#define DEBUG

#ifdef DEBUG
#define PRINT(A) std::cout << (#A) << ":" << (A) << std::endl;
#else
#define PRINT(A)
#endif

typedef pair<int, int> P;
typedef pair<ll, ll> PL;

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

const ll N_MAX = 12;
const ll M_MAX = 12;

vector<ll> A[N_MAX];

ll Asum[M_MAX];

vector<ll> C;

ll N, M, X;

signed main() {

    cin >> N >> M >> X;

    rep(i, N) {
        ll c;
        cin >> c;
        C.push_back(c);
        rep(j, M) {
            ll m;
            cin >> m;
            A[i].push_back(m);
        }
    }

    ll cost = INF;
    rep(i, 1 << N) {
        bool res = true;
        ll costBuf = 0;
        rep(j, N) {
            if (i >> j & 1) {
                costBuf += C[j];
                rep(k, M) { Asum[k] += A[j][k]; }
            }
        }
        rep(j, N){
            if(Asum[j] < X){
                res = false;
            } 
            Asum[j] = 0;
        }
        if (res) {
            PRINT(cost)
            PRINT(costBuf)
            chmin(cost, costBuf);
        }
    }

    cout << cost << endl;

    return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
bool Isvalid(vector<pair<int,int>>out,int x){
    int sum=0;
    for(auto it:out)sum+=it.first;
    return sum>=x;
}
bool Valid(int arr[][12],vector<pair<int,int>>v,int x,int m){
    for(int i=2;i<m;i++){
        int sum=0;
        for(auto it:v){
            sum+=arr[it.second][i];
        }
        if(sum<x)return false;
    }
    return true;
}
void Allsubset(vector<int>v,int arr[][12],vector<pair<int,int>>out,int x,int i,int n,int m,int &ans){
    if(i==n){
        if(Isvalid(out,x)){
            if(Valid(arr,out,x,m)){
                int sum=0;
                for(auto it:out){
                   sum+=arr[it.second][0];
                }
                ans=min(ans,sum);
            }
        }
        return;
    }
    out.push_back(make_pair(v[i],i));
    Allsubset(v,arr,out,x,i+1,n,m,ans);
    out.pop_back();
    Allsubset(v,arr,out,x,i+1,n,m,ans);
    return;
}
int main(){
    int n,m,x;
    cin>>n>>m>>x;
    int arr[12][13];
    for(int i=0;i<n;i++){
        for(int j=0;j<m+1;j++)cin>>arr[i][j];
    }
    vector<int>v;
    for(int i=0;i<n;i++)v.push_back(arr[i][1]);
    vector<pair<int,int>>out;
    int ans=INT_MAX;
    Allsubset(v,arr,out,x,0,n,m+1,ans);
    if(ans==INT_MAX)cout<<-1;
    else cout<<ans;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:48:17: error: cannot convert 'int (*)[13]' to 'int (*)[12]'
   48 |     Allsubset(v,arr,out,x,0,n,m+1,ans);
      |                 ^~~
      |                 |
      |                 int (*)[13]
a.cc:18:33: note:   initializing argument 2 of 'void Allsubset(std::vector<int>, int (*)[12], std::vector<std::pair<int, int> >, int, int, int, int, int&)'
   18 | void Allsubset(vector<int>v,int arr[][12],vector<pair<int,int>>out,int x,int i,int n,int m,int &ans){
      |                             ~~~~^~~~~~~~~
Language: C++

#include<iostream>
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 s;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<<ans<<endl;
      return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> c(n);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> c(n);
      |          ^~~
a.cc:9:10: error: 'c' was not declared in this scope
    9 |     cin>>c[i];
      |          ^
a.cc:15:11: error: 'INF' was not declared in this scope
   15 |   int ans=INF;
      |           ^~~
a.cc:18:12: error: expected primary-expression before 'int'
   18 |     vector<int> d(m);
      |            ^~~
a.cc:21:15: error: 'c' was not declared in this scope
   21 |         cost+=c[i];
      |               ^
a.cc:23:11: error: 'd' was not declared in this scope
   23 |           d[j]+=a[i][j];
      |           ^
a.cc:29:12: error: 'd' was not declared in this scope
   29 |         if(d[j]<x) ok=false;
      |            ^
Language: C++

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

#define REP(i, n) for(int64_t i = 0; i < n; i++)
#define REPR(i, n) for(int64_t i = n; i >= 0; i--)
#define FOR(i, m, n) for(int64_t i = m; i < n; i++)
#define FORR(i, m, n) for(int64_t i = m; i >= n; i--)
#define ALL(v) v.begin(), v.end()
typedef long long ll;
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    fill( (T*)array, (T*)(array+N), val );
}
template<class T>
inline bool chmax(T &a, T b) {if(a < b) {a = b;return true;}return false;}
template<class T>
inline bool chmin(T &a, T b) {if(a > b) {a = b;return true;}return false;}
const ll INF= 1ll << 60;
const ll MOD = 1000000007;
double EPS = 1e-10;
//----------------------------------------------------------

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

Compiler output:
a.cc: In function 'int main()':
a.cc:39:23: error: invalid types 'int[int64_t {aka long int}]' for array subscript
   39 |                 c += c[i];
      |                       ^
Language: C++

#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>

#define ll long long
#define ull unsigned long long

using namespace std;

const int INF = 100100100;

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

	vector <int> C(N);
	vector<vector<int>> A(N, vector <int> (M));
	for (int ii = 0; ii < N; ++ii){
		cin >> C[ii];
		for (int jj = 0; jj < M; ++jj){
			cin >> A[ii][jj];
		}
	}

	int ans = INF;
	for (int ii = 0; ii < 1<<N; ++ii){
		int cost = 0;
		vector <int> v(M, 0);
		for (int jj = 0; jj < N; ++jj){
			if ((jj>>ii) & 1){
				for (int kk = 0; kk < M; ++kk){
					v[kk] += A[jj][kk];
				}
				cost += C[jj];
			}
		}

		bool OK = true;
		for (int jj = 0; jj < M; ++jj){
			if (v[jj] < X){
				OK = false;
				break;
			}
		}
		if (OK){
			ans = min(cost, ans);
		}
	}

	cout << (ans < INF) ? ans : -1 << "\n"

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:49:40: error: invalid operands of types 'int' and 'const char [2]' to binary 'operator<<'
   49 |         cout << (ans < INF) ? ans : -1 << "\n"
      |                                     ~~ ^~ ~~~~
      |                                     |     |
      |                                     int   const char [2]
Language: C++

#include <iostream>
#include <math.h>
#include <algorithm>
#include <queue>
#include <map>
#include <list>
//#include <bits/stdc++.h>

using namespace std;

#define FOR(i, a, b) for (int i = (a), i##formax = (b); i < i##formax; i++)
typedef long long ll;

int n, m, x;
vector<vector<int>> ca;
vector<vector<int>> sum;

vector<int> ans(0);

void dfs(vector<int> log, vector<int> sum)
{
    bool ok = true;
    FOR(i, 0, m) {
        if(sum[i] < x) ok = false;
    }
    if (ok || log.size() > 12) {
        ans.push_back(sum[0]);
        return;
    }

    vector<int> copy = sum;
    log.push_back(0);
    FOR(i, 0, 12)
    {
        copy = sum;
        bool isUsed = false;
        for(int a : log) { if(i == a) isUsed = true; break; }

        if (!isUsed) {
            log.back() = i;
            log.push_back(i);
            
            FOR(j, 0, m) {
                copy[j] += ca[i][j];
            }
            dfs(log, copy);
        }
    }
}

int main()
{
    cin >> n >> m >> x;
    FOR(i, 0, n) {
        FOR(j, 0, m + 1) { cin >> ca[i][j]; }
    }

    // vector<int> x(1);
    dfs(vector<int>(0), vector<int>(m, 0));
    if(ans.size != 0){ sort(ans.begin(), ans.end()); cout << ans[0] << endl; }
    else cout << -1 << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:60:12: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int]' (did you forget the '()' ?)
   60 |     if(ans.size != 0){ sort(ans.begin(), ans.end()); cout << ans[0] << endl; }
      |        ~~~~^~~~
      |                ()
Language: C++

#include <iostream>
#include <math.h>
#include <algorithm>
#include <queue>
#include <map>
#include <list>
//#include <bits/stdc++.h>

using namespace std;

#define FOR(i, a, b) for (int i = (a), i##formax = (b); i < i##formax; i++)
typedef long long ll;

int n, m, x;
vector<vector<int>> ca;
vector<vector<int>> sum;

vector<int> ans(0);

void dfs(vector<int> log, vector<int> sum)
{
    bool ok = true;
    FOR(i, 0, m) {
        if(sum[i] < x) ok = false;
    }
    if (ok || log.size() > 12) {
        ans.push_back(sum[0]);
        return;
    }

    vector<int> copy = sum;
    log.push_back(0);
    FOR(i, 0, 12)
    {
        copy = sum;
        bool isUsed = false;
        for(int a : log) { if(i == a) isUsed = true; break; }

        if (!isUsed) {
            log.back() == i;
            log.push_back(i);
            
            FOR(j, 0, m) {
                copy[j] += ca[i][j];
            }
            dfs(log, copy);
        }
    }
}

int main()
{
    cin >> n >> m >> x;
    FOR(i, 0, n) {
        FOR(j, 0, m + 1) { cin >> ca[i][j]; }
    }

    // vector<int> x(1);
    dfs(vector<int>(0), vector<int>(m, 0));
    if(ans.size != 0){ sort(ans.begin(), ans.end()); cout << ans[0] << endl; }
    else cout << -1 << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:60:12: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int]' (did you forget the '()' ?)
   60 |     if(ans.size != 0){ sort(ans.begin(), ans.end()); cout << ans[0] << endl; }
      |        ~~~~^~~~
      |                ()
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 a[12][12];

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

  int ans = INF;
  rep(s,i<<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:20:9: error: 'i' was not declared in this scope
   20 |   rep(s,i<<n) {
      |         ^
a.cc:2:38: note: in definition of macro 'rep'
    2 | #define rep(i,n) for (int i = 0; i < n; ++i)
      |                                      ^
Language: C++

#include<iostream>
#include<cmath>
#include<numeric>
#include<functional>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<n;i++)
#define ll long long
using namespace std;
using Graph=vector<vector<int>>;

int main(){
  int n,m,x; cin>>n>>m>>x;
  int cost[n]; int a[n][m];
  rep(i,n){
    cin>>cost[i];
    rep(j,m){
      cin>>a[i][j];
    }
  }
  int powerof2[n];
  powerof2[0]=1;
  rep1(i,n){
    powerof2[i]=2*powerof2[i-1];
  }
  int ans=1000000;
  for(int y=0;y<2*powerof2[n-1];y++){
    int rikai[m]={}; int money=0;
    rep(i,n){
      if((y&powerof2[i])!=0){
        money+=cost[i];
        rep(j,m){
          rikai[j]+=a[i][j];
        }
      }
    }
    int f=1;
    rep(i,m){
      if(r[i]<x){
        f=0;
      }
    }
    if(f==1){
      ans=min(ans,money);
    }
  }
  if(ans==1000000){
    cout<<-1;
  }else{
    cout<<ans;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:10: error: 'r' was not declared in this scope
   43 |       if(r[i]<x){
      |          ^
Language: C++

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

int main() {
  ll N, M, X, sumprice = 0, min = 10000000;
  cin >> N >> M >> X;
  vector<ll> C(12, 0), sum(M, 0);
  vector<vector<ll>> A(12, vector<ll>(M));
  bool judge = 1;
  for(ll i = 0; i < N; i++) {
    cin >> C.at(i);
    sumprice += C.at(i);
    for(ll j = 0; j < M; j++) {
      cin >> A.at(i).at(j);
      sum.at(j) += A.at(i).at(j);
      if((i == N - 1) && (sum.at(j) < X)) judge = 0;
    }
  }
  if(judge == 0) cout << -1 << endl;
  else {
    vector<ll> sumcharge(M);
    ll sumpricecharge;
    for(ll i = 0; i < M; i++) sumcharge.at(i) = sum.at(i);
    sumpricecharge = sumprice;
    for(ll i = 0; i < pow(2, N); i++) {
      for(ll k = 0; k < M; k++) sum.at(k) = sumcharge.at(k);
      sumprice = sumpricecharge;
      for(ll l = 0; l < 12; l++) {
        if((i / pow(2, l)) % 2 == 1) {
          for(ll j = 0; j < M; j++) sum.at(j) -= A.at(l).at(j);
          sumprice -= C.at(l);
        }
      }
      for(ll j = 0; j < M; j++) {
        if(sum.at(j) < X) break;
        if((j == M - 1) && (sumprice < min)) min = sumprice;
      }
    }
    cout << min << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:28: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
   32 |         if((i / pow(2, l)) % 2 == 1) {
      |            ~~~~~~~~~~~~~~~ ^ ~
      |               |              |
      |               |              int
      |               __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep0(i, n) for (long long i = 0; i < (long long)(n); i++)
#define rep1(i,n) for(long long i=1;i<=(long long)(n);i++)
#define all(v) v.begin(),v.end()
#define Sort(v) sort(all(v))
#define Reverse(v) reverse(all(v))
#define Rsort(v) sort(all(v),greater)
#define pub(v) push_back(v)
#define pob(v) pop_back(v)
typedef long long ll;
typedef vector<ll> vel;
typedef vector<vector<ll>> vel2d;
typedef string str;
typedef pair<ll,ll> pal;
typedef vector<str> ves;
typedef vector<char> vech;


int main() {
    ll N,M,X;cin>>N>>M>>X;
    vel C(N);vel2d A(N,vel(M));
    rep0(i,N){
        cin>>C[i];
        rep0(j,M){
            cin>>A[i][j];
        }
    }
    ll sum=0;
    rep0(i,M){
        rep0(j,N){sum+=A[j][i];}
        if(sum<X){cout<<-1<<endl;return 0;}
    }
    ll ans=1001001001;
    vel D(M);
    for(ll tmp=0;tmp<(1<<N);tmp++){
        bitset<12> s(tmp);
        ll sum2=0;
        //cout<<s<<endl;
        
        for(ll i=0;i<N;i++){
            if(s.test(i)){
                sum2+=C[i];
                rep0(j,M){D[j]+=A[i][j];}
            }
        }
        bool flag=true;
        //cout<<sum2<<endl;
        rep0(j,M){if(D[j]<x){flag=false;}}
        //rep0(j,M){cout<<D[j]<<endl;}
        if(flag){ans=min(ans,sum2);}
        //cout<<ans<<endl;
        rep0(j,M){D[j]=0;}
    }
    cout<<ans<<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:49:27: error: 'x' was not declared in this scope
   49 |         rep0(j,M){if(D[j]<x){flag=false;}}
      |                           ^