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

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define pb push_back
#define mp make_pair
#define deb(x) cout<< #x << " " << x << "\n";
#define INF 9223372036854775807
const ll mod=1e9+7;


int main() {
    
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    ll a,b,c,k;
    cin>>a>>b>>c>>k;
    ll ans=a-max(0ll,(k-a-b))
    cout<<ans;


    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:5: error: expected ',' or ';' before 'cout'
   20 |     cout<<ans;
      |     ^~~~
Language: C++

#define _GLIBCXX_DEBUG
#include<algorithm>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<iostream>
#include<vector>
#include<queue>
#include<deque>
#include<stack>
#include<set>
#include<map>
#include<string>
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define rep2(i,s,n) for(int i=s;i< (int)n; i++)
#define ll long long 
#define all(v) v.begin(),v.end()
using namespace std;
int main(){
  ll a,b,c,k;
  cin >>a>>b>>c>>k;
  if(k<=a){
    cout <<k <<endl;
    return 0;
  }
  if(k<a+b){
    cout <<a<<endl;
    return 0;
  }
  co

Compiler output:
a.cc: In function 'int main()':
a.cc:31:3: error: 'co' was not declared in this scope; did you mean 'c'?
   31 |   co
      |   ^~
      |   c
a.cc:31:5: error: expected '}' at end of input
   31 |   co
      |     ^
a.cc:20:11: note: to match this '{'
   20 | int main(){
      |           ^
Language: C++

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

int main() {
  long a,b,c,s;
  cin>>a>>b>>c>>n;
  if(a>=n){
    cout<<n;
  }else if(a+b>=n){
    cout<<a;
  }else{
    cout<<a-(n-(a+b));
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:17: error: 'n' was not declared in this scope
    6 |   cin>>a>>b>>c>>n;
      |                 ^
Language: C++

 #include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A;
  int B;
  int C;
  int K;
  cin >> A;
  cin >> B;
  cin >> C;
  cin >> K;
  answer = A;
  if ( K <= ( A + B ) ) {
    cout << ( A ) << endl;
  }
  else {
    cout << ( A - ( K - A - B ) ) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: 'answer' was not declared in this scope
   13 |   answer = A;
      |   ^~~~~~
Language: C++

#include<vector>
#include<map>
#include<algorithm>
#include<set>
#include<iostream>
#include<string>
#include<set>
#include<queue>
#include<random>

using namespace std;

/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> st;*/

#pragma GCC optimize("Ofast")
#pragma GCC optimize("fast-math")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native")

#define pb push_back
#define ld long double
#define int long long

mt19937 rnd(51);

int32_t main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int a, b, c, k;
	cin >> a >> b >> c >> k;
	int ans = 0;
	ans += min(a, k);
	k -= min(a, k);
	k -= b;
	ans -= max(0l, min(k, c));
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int32_t main()':
a.cc:44:19: error: no matching function for call to 'max(long int, const long long int&)'
   44 |         ans -= max(0l, min(k, c));
      |                ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:62,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:44:19: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
   44 |         ans -= max(0l, min(k, c));
      |                ~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:44:19: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   44 |         ans -= max(0l, min(k, c));
      |                ~~~^~~~~~~~~~~~~~~
Language: C

#include<iostream>
#define rep(i,cc,n) for(int i=cc;i<=n;++i)
using namespace std;

int main() {
  int A, B, C, K;
  cin >> A >> B >> C >> K;

  int ans = 0;
  if (K <= A) {
    ans = A;
  } else if (K <= A + B) {
    ans = A;
  } else {
    ans = A - (K - A - B);
  }

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


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

#include <bits/stdc++.h>
#define REP(i, n) for(int i=0; i<(int)(n); i++)
#define REP1(i,a,b) for(int i=a; i<=(int)(b); i++)
#define ALL(x) begin(x),end(x)
#define PB push_back
using namespace std;
typedef int64_t LL;
typedef vector<int> VI;
typedef pair<int,int> PII;

template<class T> inline bool chmax( T &a, const T &b ) { return b>a ? a=b,true : false; }
template<class T> inline bool chmin( T &a, const T &b ) { return b<a ? a=b,true : false; }
template<class T> using MaxHeap = priority_queue<T>;
template<class T> using MinHeap = priority_queue<T, vector<T>, greater<T>>;
template<class T, class F=less<T>> void sort_uniq( vector<T> &v, F f=F() ) {
    sort(begin(v),end(v),f);
    v.resize(unique(begin(v),end(v))-begin(v));
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    LL a,b,c,k;
    cin >> a >> b >> c >> k;
    LL ans=min(a,k);
    LL rem=max(0LL, k-a-b);
    cout << ans-rem << '\n';
    return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define fastIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long int
#define pb push_back
#define ff first
#define ss second
#define all(v) (v).begin(), (v).end()
#define mod (int)(998244353)
#define debugVec(vec) cout<<(#vec)<<": "; for (auto& i: vec) cout<<i<<" "; cout<<endl
#define trace(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args);cout << endl; }
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cerr << *it << " = " << a << " ";
    err(++it, args...);
}

signed main(){

    fastIO

   	int a, b, c, d;
   	cin >> a >> b >> c >> d;
   	int sum = 0;
   	if (d > a)
	   	d-=a;
	   	sum += a; 
	else{
		sum += a - d;
		d = 0;
	}
	if (d == 0){
		cout << sum << endl;
		exit(0);
	}
	if (d > b){
		d-=b;
	}else{
		d = 0;
	}
	if (d == 0){
		cout << sum << endl;
		exit(0);
	}
	sum -= c - d;
	cout << sum << endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:9: error: 'else' without a previous 'if'
   30 |         else{
      |         ^~~~
Language: C++

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

int main() {
  int A,B,C,K;
  cin >> A >> B >> C >> K;
  if (A >=K ){
    cout << K << endl;
  }
  else if (A+B>=K){
    cout << A << endl;
  }
  else {
    cout A-(K-A-B) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: expected ';' before 'A'
   14 |     cout A-(K-A-B) << endl;
      |         ^~
      |         ;
Language: C

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

int main()
{
  int a, b, c, k, ans;
  cin >> a >> b >> c >> k;
  ans = min(a, k);
  k -= a;
  if (0 < k)
    k -= b;
  if (0 < k)
  {
    ans -= k;
  }
  cout << ans << endl;
}

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

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

#ifdef LOCAL
#include "dump.hpp"
#else
#define dump(...)
#define dumpv(...)
#endif

#define rep(i, n) for (int i = 0; i < (n); i++)
#define mins(x, y) (x = min(x, y))
#define maxs(x, y) (x = max(x, y))
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using P = pair<int, int>;
const int MOD = 1e9 + 7;
const int INF = 1001001001;
const ll LINF = 1001002003004005006ll;

void solve() {
  int a, b, c, k;
  cin >> a >> b >> c >> k;
  ll ans = 0;
  if (a < k) {
    ans += a;
    k -= a;
    if (b < k) {
      k -= b;
      if (0 < k) {
        ans -= k;
      } else {
      }
    } else {
    }
  } else {
    ans += k;
  }
  cout << ans << endl;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  // freopen("temp.1", "r", stdin);
  solve();
  return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
#define ALL(obj) obj.begin(),obj.end()
#define SORT(obj) sort(obj.begin(),obj.end())#define pb(obj) push_back(obj)
#define REP(i,N) for(int i=0;i<N;i++)
typedef long long ll;
ll const MOD=1e9+7;

int main(){
  int a,b,c,k;
  cin>>a>>b>>c>>k;
  if(k<=a){
    cout<<k<<endl;
  }
  else if(a<k&&k<=a+b){
    cout<<a<<endl;
  }
  else if(a+b<k){
    cout<<2*a-k<<endl;
  }
}


Compiler output:
a.cc:4:17: error: '#' is not followed by a macro parameter
    4 | #define SORT(obj) sort(obj.begin(),obj.end())#define pb(obj) push_back(obj)
      |                 ^
Language: C++

#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("O3")
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define EPS (1e-9)
#define INF (1e17)
#define PI (acos(-1))
//const double PI = acos(-1);
//const double EPS = 1e-15;
//long long INF=(long long)1E17;
#define i_7 (long long)(1e9+7)
//#define i_7 998'244'353
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
long long po(long a, long b){
    if(b==0){
        return 1;
    }
    
    long long z = po(a,b/2);
    z = mod(z*z);
    if(b%2!=0){
        z = mod(a*z);
    }
    return z;
}
 
bool prime_(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=std::sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}
 
long long gcd_(long long a, long long b){
  if(a<b){
    std::swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd_(b,a%b);
  }
}
 
long long lcm_(long long x, long long y){
  return (x/gcd_(x,y))*y;
}
 
//using namespace std;
//using namespace boost::multiprecision;
//using namespace __gnu_pbds;

int main(){
  using namespace std;
  long long a, b, c, k;
  cin>>a>>b>>c>>k;
  long long ans = 0;
  if(k > 0){
    if(k >= a){
      ans += a;
      k -= a;
    }else{
      ans += k
      k = 0;
    }
  }
  if(k > 0){
    if(k >= b){
      k -= b;
    }else{
      k = 0;
    }
  }
  if(k > 0){
    if(k >= c){
      k -= c;
      ans -= c;
    }else{
      ans -= k;
      k = 0;
    }
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:79:15: error: expected ';' before 'k'
   79 |       ans += k
      |               ^
      |               ;
   80 |       k = 0;
      |       ~
Language: C++

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

#define ALL(x) (x).begin(), (x).end()
#define REP(i, n) for (size_t i = 0; i < (size_t) (n); i++)

using namespace std;
using ll = long long;

int main(void) {
  int a b c;
  ll k;
  cin >> a >> b >> c >> k;

  if (a >= k) {
    cout << k << endl;
  } else if (a + b >= k) {
    cout << a << endl;
  } else {
    cout << a - (k - a - b) << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: expected initializer before 'b'
   13 |   int a b c;
      |         ^
a.cc:15:10: error: 'a' was not declared in this scope
   15 |   cin >> a >> b >> c >> k;
      |          ^
a.cc:15:15: error: 'b' was not declared in this scope
   15 |   cin >> a >> b >> c >> k;
      |               ^
a.cc:15:20: error: 'c' was not declared in this scope
   15 |   cin >> a >> b >> c >> k;
      |                    ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	int s=0,a,b,c,k;
	cin>>a>>b>>c>>k;;
	k-=a;
	if(k<0)s+=k;
	else{
		s+=a1 2 3 4;
		k-=b;
		if(k>0)s-=k;
	}
	cout<<s;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: 'a1' was not declared in this scope; did you mean 'a'?
    9 |                 s+=a1 2 3 4;
      |                    ^~
      |                    a
Language: C++

#include<bits/stdc++.h>
#define ll         long long
#define fl(i,n)    for(i=0;i<n;i++)
#define fld(i,a,b) for(i=a;i>b;i--)
#define fli(i,a,n) for(i=a;i<n;i++)
#define inp(i,a,n) for(i=0;i<n;i++) {cin>>a[i];}
#define op(i,a,n)  for(i=0;i<n;i++) {cout<<a[i]<<" ";}
#define pb         push_back
#define mp         make_pair
#define F          first 
#define S          second
#define mod        998244353
#define all(x)     x.begin(),x.end()    
#define speedup    ios_base::sync_with_stdio(false),cin.tie(0)
using namespace std;
void comp() {
	ll i,j,k,m,n;
	ll a,b,c,k;
	cin>>a>>b>>c>>k;
	ll ans=0;
	ans+=1*min(a,k);
	k-=min(a,k);
	k-=min(b,k);
	ans-=1*min(c,k);
	cout<<ans<<"\n";
}

int main() {
    speedup;
    ll i=0,t;
    t=1;
    //cin>>t;
    while(t--) {
        comp();
    }
    return 0;
}

Compiler output:
a.cc: In function 'void comp()':
a.cc:18:18: error: redeclaration of 'long long int k'
   18 |         ll a,b,c,k;
      |                  ^
a.cc:17:16: note: 'long long int k' previously declared here
   17 |         ll i,j,k,m,n;
      |                ^
Language: C

// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<unordered_map>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(long long i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define FOR(i,a) for(auto i:a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define show1d(v) {rep(_,v.size())cout<<" "<<v[_];cout<<endl;}
#define show2d(v) {rep(__,v.size())show1d(v[__]);}
using namespace std;
//kaewasuretyuui
typedef long long ll;
#define int ll
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
#define mt make_tuple
typedef tuple<int,int,int> tp;
typedef vector<tp> vt;
typedef vector<vt>vvt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
int dx[]={-1,0,1,0};
int dy[]={0,1,0,-1};
#define yes cout<<"Yes\n"
#define no cout<<"No\n"

//nCr mod m
#define MOD 998244353
#define M 220000
vector<ll> fact;
bool h=false;
void init(){
	h=true;
	fact=vector<ll>(M);
	fact[0]=fact[1]=1;
	loop(i,2,M)fact[i]=fact[i-1]*i%MOD;
}
// a^b mod MOD
ll powmod(ll a,ll b,ll m=MOD){
	ll out=1;
	ll p=a%m;
	while(b){
		if(b&1)out=out*p%m;
		p=p*p%m;
		b>>=1;
	}
	return out;
}
//nCr
ll nCr(ll n,ll r,ll m=MOD){
	if(!h)init();
	if(n<0||r<0||n<r)return 1;//??????
	ll out=fact[n]*powmod(fact[r]*fact[n-r]%m,m-2,m)%m;
	return out;
}
int gcd(int a,int b){
	if(b==0)return a;
	return gcd(b,a%b);
}
int lcm(int a,int b){
	return a/gcd(a,b)*b;
}
vi dp(1000,-1);
int f(int a){
	if(dp[a]+1)return dp[a];
	return dp[a]=powmod(fact[a],MOD-2,MOD);
}
signed main(){
	ios::sync_with_stdio(false);
	cin.tie(0);

	int a,b,c,d;
	cin>>a>>b>>c>>d;
	int t=0;
	t+=min(a,d);
	d-=min(a,d);
	d-=min(b,d);
	t-=min(c,d);
	cout<<t<<endl;

}


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

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

# define C continue;
# define R return

# define D double
# define I insert
# define ll long long
# define ld long double

# define ull unsigned long long
# define ui unsigned int

# define pb push_back
# define pf push_front

# define vi vector < int >
# define vc vector < char >
# define vs vector < string >
# define vb vector < bool >
# define vd vector < D >
# define vll vector < ll >
# define vull vector < ull >
# define vld vector < ld >
# define PQ priority_queue

# define vvi vector < vector < int > >
# define vvb vector < vector < bool > >
# define vvc vector < vector < char > >
# define vvs vector < vs >
# define vvll vector < vector < ll > >
# define vvd vector < vector < D > >
# define vvld vector < vector < ld > >

# define all(v) (v).begin() , (v).end()
# define allrev(v) (v).rbegin() , (v).rend()
# define allcomp(v) v.begin() , v.end() , comp
# define allrevcomp(v) v.rbegin() , v.rend() , comp

# define pii pair < int , int >
# define pll pair < ll , ll >
# define pld pair < ld , ld >
# define pDD pair < D , D >

# define vpld vector < pld >
# define vpii vector < pii >
# define vpll vector < pll >
# define vpDD vector < pDD >

# define vvpii vector < vector < pii > >
# define F first
# define S second
# define mp make_pair

# define dist(a,b,p,q) sqrt((p-a)*(p-a) + (q-b)*(q-b))

# define pp(n) printf("%.10Lf",n);
# define line cout<<"\n";
# define fast ios_base::sync_with_stdio(false) ; cin.tie(0) ; cout.tie(0);

string vow = "aeiou";
int month[] = {-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

const int dxhorse[] = {-2, -2, -1, -1, 1, 1, 2, 2};
const int dyhorse[] = {1, -1, 2, -2, 2, -2, 1, -1};

const int dx[] = { -1 , 0 , 1 , 0 } ;
const int dy[] = { 0 , 1 , 0 , -1 } ;

const ld pie = 3.1415926535897932384626 ;
const ll mod = 1e9 + 7 ;

/// Tip : If a and b are positive integers ; we may say - ceil (a/b) = 1 + floor ( (a-1)/b ) .

void solve ( int test_case )
{
    ll a , b , c , k ;
    cin >> a >> b >> c >> k ;

    ll t = min ( a , k ) ;

    k -= t ;
    ans = t ;

    t = min ( k , b ) ;

    k -= t ;

    t = min ( k , c ) ;
    k -= t ;
    ans -= t ;

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

int main()
{
    int t = 1;
    // cin >> t;

    for ( int i = 1 ; i <= t ; i ++ )
    {
        solve ( i ) ;
    }

    return 0;
}


Compiler output:
a.cc: In function 'void solve(int)':
a.cc:84:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   84 |     ans = t ;
      |     ^~~
      |     abs
Language: C++

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


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

	int A , B , C , K;
	cin >> A >> B >> C >> K;
	cout<<min(A , K) - max(0 , K - A - B)<<endl;
}

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

         /*"Success isn't permanent, failure isn't fatal,
                                      it's the courage to continue that counts"*/
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
using namespace std;
//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define ll long long 
#define scn(n) scanf("%d",&n)
#define lscn(n) scanf("%lld",&n)
#define lpri(n) printf("%lld",n)
#define pri(n) printf("%d",n)
#define pln() printf("\n")
#define priln(n) printf("%d\n",n)
#define lpriln(n) printf("%lld\n",n)
#define rep(i,init,n) for(int i=init;i<n;i++)
#define pb push_back     
#define mp make_pair
#define F first
#define S second
#define gcd __gcd
#define inf INT_MAX
#define ninf INT_MIN
const int mod=1e9+7;         
const int N=1e5+4;

int main()
{
	int a,b,c;

	cin>>a>>b>>c;

	int ans=0;

	if(k<=a+b)
	ans=min(k,a+b);
	else
	ans=a-(k-(a+b));

	pri(ans);
	
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:12: error: 'k' was not declared in this scope
   36 |         if(k<=a+b)
      |            ^
Language: C++

//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
//#pragma GCC target("avx,avx2")
//#pragma GCC target("avx2")
//#pragma GCC optimize("O3")

//# include <x86intrin.h>
# include <bits/stdc++.h>

# include <ext/pb_ds/assoc_container.hpp>
# include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;
 
template<typename T> using ordered_set = tree <T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define _USE_MATH_DEFINES_
#define ll long long
#define ld long double
#define Accepted 0
#define pb push_back
#define mp make_pair
#define sz(x) (int)(x.size())
#define every(x) x.begin(),x.end()
#define F first
#define S second
#define lb lower_bound
#define ub upper_bound
#define For(i,x,y)  for (ll i = x; i <= y; i ++) 
#define FOr(i,x,y)  for (ll i = x; i >= y; i --)
#define SpeedForce ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
// ROAD to...                                                                                                                                                                                                                Red

inline void Input_Output () {
	//freopen(".in", "r", stdin);
   //freopen(".out", "w", stdout);
}

const double eps = 0.000001;
const ld pi = acos(-1);
const int maxn = 1e7 + 9;
const int mod = 1e9 + 7;
const ll MOD = 1e18 + 9;
const ll INF = 1e18 + 123;
const int inf = 2e9 + 11;
const int mxn = 1e6 + 9;
const int N = 6e5 + 123;                                          
const int M = 22;
const int pri = 997;
const int Magic = 2101;

const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
int n, m, k;
int cnt[N];
string s;
int a[N];
vector < int > g[N];
int u[N];
int ans, res;
int cur;



int main () {
	SpeedForce;
	cin >> A >> B >> C >> k;

	if (k <= A + B) {
		cout << min(A, k);
		exit(0);
	}

	cout << A - (k-A-B);
	
	return Accepted;
}

// B...a

Compiler output:
a.cc: In function 'int main()':
a.cc:69:16: error: 'A' was not declared in this scope
   69 |         cin >> A >> B >> C >> k;
      |                ^
a.cc:69:21: error: 'B' was not declared in this scope
   69 |         cin >> A >> B >> C >> k;
      |                     ^
a.cc:69:26: error: 'C' was not declared in this scope
   69 |         cin >> A >> B >> C >> k;
      |                          ^
Language: C++

ng ll=long long;
using namespace std;
int main(){
 int n,m,x;
  cin>>n>>m>>x;
  ll c[n];
  ll a[n][m];
  ll ans=10000000;
  rep(i,n){
  cin>>c[i];//i;参考書 各々の金額を格納
    rep(j,m){
    cin>>a[i][j];
    }
  }
 /* rep(i,n){
    cin>>c[i];
  }
  rep(i,n) rep(j,m){
    cin>>a[i][j];
    }*/
  
 // int und[m];//各々のアルゴリズムの理解度をカウント
  int mon;//金額をカウント
  rep(mi,1<<n){
     mon=0;//金額カウントを初期化
    int und[m]={0};//理解度を初期化
   rep(i,n){//ある参考書パターンに対し
    
    if(mi>>i&1){//i番目は買ってる
    rep(j,m){
    und[j]+=a[i][j];//i番目の参考書に対する各々の理解度を足す
    }
      mon+=c[i];
      
    }
   //  cout<<mon<<endl;
    //買ってなかったら足さない
  }
    //理解度が超えているか判定
    int jud=0;
    rep(j,m){
    if(und[j]>=x){
    ++jud;
    }
   // cout<<und[j]<<endl;
    }
  //cout<<jud<<endl;
    if(jud==m){//全部習得できていたら 金額を更新するかも？
    if(ans>=mon){
      ans=mon;
      
    }
    }
    //cout<<ans<<endl;
  //  cout<<mon<<endl;
  }
  if(ans==10000000){
  cout<<"-1"<<endl;
  }
  else{
  cout<<ans<<endl;
  }
}
  

Compiler output:
a.cc:1:1: error: 'ng' does not name a type; did you mean 'long'?
    1 | ng ll=long long;
      | ^~
      | long
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin>>n>>m>>x;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | ng ll=long long;
a.cc:6:3: error: 'll' was not declared in this scope
    6 |   ll c[n];
      |   ^~
a.cc:7:5: error: expected ';' before 'a'
    7 |   ll a[n][m];
      |     ^~
      |     ;
a.cc:8:5: error: expected ';' before 'ans'
    8 |   ll ans=10000000;
      |     ^~~~
      |     ;
a.cc:9:7: error: 'i' was not declared in this scope
    9 |   rep(i,n){
      |       ^
a.cc:9:3: error: 'rep' was not declared in this scope
    9 |   rep(i,n){
      |   ^~~
a.cc:24:7: error: 'mi' was not declared in this scope; did you mean 'm'?
   24 |   rep(mi,1<<n){
      |       ^~
      |       m
a.cc:57:6: error: 'ans' was not declared in this scope
   57 |   if(ans==10000000){
      |      ^~~
a.cc:58:3: error: 'cout' was not declared in this scope
   58 |   cout<<"-1"<<endl;
      |   ^~~~
a.cc:58:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:58:15: error: 'endl' was not declared in this scope
   58 |   cout<<"-1"<<endl;
      |               ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | ng ll=long long;
a.cc:61:3: error: 'cout' was not declared in this scope
   61 |   cout<<ans<<endl;
      |   ^~~~
a.cc:61:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:61:14: error: 'endl' was not declared in this scope
   61 |   cout<<ans<<endl;
      |              ^~~~
a.cc:61:14: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

int main() {
    int n, m, x;
    cin >> n >> m >> x;
    //vector<vector>は結構複雑なのでグローバルにとることが多い
    vector<int> c(n);
    rep(i, n){
        cin >> c[i];
        rep(j, m) cin >> a[i][j];
    }

    // <<はシフト演算子 1<<nは2^nまでループ
    int ans = INF;
    rep(s, 1<<n){
        int cost = 0;
        //理解度の合計
        vector<int> d(m);
        rep(i, n){
            //iビット目を取り出す作業
            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:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> n >> m >> x;
      |     ^~~
a.cc:5:5: error: 'vector' was not declared in this scope
    5 |     vector<int> c(n);
      |     ^~~~~~
a.cc:5:12: error: expected primary-expression before 'int'
    5 |     vector<int> c(n);
      |            ^~~
a.cc:6:9: error: 'i' was not declared in this scope
    6 |     rep(i, n){
      |         ^
a.cc:6:5: error: 'rep' was not declared in this scope
    6 |     rep(i, n){
      |     ^~~
a.cc:12:15: error: 'INF' was not declared in this scope
   12 |     int ans = INF;
      |               ^~~
a.cc:13:9: error: 's' was not declared in this scope
   13 |     rep(s, 1<<n){
      |         ^
a.cc:29:20: error: 'cout' was not declared in this scope
   29 |     if(ans == INF) cout << -1 << endl;
      |                    ^~~~
a.cc:29:34: error: 'endl' was not declared in this scope
   29 |     if(ans == INF) cout << -1 << endl;
      |                                  ^~~~
a.cc:30:10: error: 'cout' was not declared in this scope
   30 |     else cout << ans << endl;
      |          ^~~~
a.cc:30:25: error: 'endl' was not declared in this scope
   30 |     else cout << ans << endl;
      |                         ^~~~
Language: C++

int main() {
    int n, m, x;
    cin >> n >> m >> x;
    //vector<vector>は結構複雑なのでグローバルにとることが多い
    vector<int> c(n);
    rep(i, n){
        cin >> c[i];
        rep(j,m) cin >> a[i][j];
    }

    // <<はシフト演算子 1<<nは2^nまでループ
    int ans = INF
    rep(s,1<<n){
        int cost = 0
        //理解度の合計
        vector<int> d(m);
        rep(i,n){
            //iビット目を取り出す作業
            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:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> n >> m >> x;
      |     ^~~
a.cc:5:5: error: 'vector' was not declared in this scope
    5 |     vector<int> c(n);
      |     ^~~~~~
a.cc:5:12: error: expected primary-expression before 'int'
    5 |     vector<int> c(n);
      |            ^~~
a.cc:6:9: error: 'i' was not declared in this scope
    6 |     rep(i, n){
      |         ^
a.cc:6:5: error: 'rep' was not declared in this scope
    6 |     rep(i, n){
      |     ^~~
a.cc:12:15: error: 'INF' was not declared in this scope
   12 |     int ans = INF
      |               ^~~
a.cc:30:5: error: 'else' without a previous 'if'
   30 |     else cout << ans << endl;
      |     ^~~~
a.cc:30:10: error: 'cout' was not declared in this scope
   30 |     else cout << ans << endl;
      |          ^~~~
a.cc:30:25: error: 'endl' was not declared in this scope
   30 |     else cout << ans << 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>;

int main() {
    const int max = 10000000;
    int n, m, x, ans = max;
    cin >> n >> m >> x;
    vector<vector<int>> a(n, vector<int>(m));
    vector<int> c(n), alg(m);
    rep(i, n) {
        cin >> c[i];
        rep(j, m) { cin >> a[i][j]; }
    }

    for(int bit = 1; bit < (1 << n); bit++) {
        int money = 0;
        vector<int> alg(m);
        rep(i, n) {
            if(bit & (1 << i)) {
                rep(j, m) alg[j] += a[i][j];
                money += c[i];
            }
        }
        bool flag = true;
        rep(i, m) {
            if(alg[i] < x) {
                flag = false;
                break
            }
        }
        if(flag) {
            ans = min(ans, money);
        }
    }
    if(ans == max) {
        cout << -1 << endl;
    } else {
        cout << ans << endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:22: error: expected ';' before '}' token
   31 |                 break
      |                      ^
      |                      ;
   32 |             }
      |             ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using Graph = vector<vector<ll>>;
int main(){
  ll N,K,b;
  cin>>N>>K>>b;
  vector<vector<ll>>vec(N,vector<ll>(K+1));
  ll d=0;
  for(ll i=0;i<N;i++){
    for(ll j=0;j<K+1;j++){
      cin>>vec.at(i).at(j); 
    }
    d+=vec.at(i).at(0);
  }
  d=d+1;
  ll re=d;
  const ll n=N;
  for (int tmp = 0; tmp < (1 << N); tmp++) {
    bitset<12> s(tmp);
    vector<ll>veco(K+1,0);
    // ビット列を出力
    for(ll i=0;i<N;i++){
      for(ll k=0;k<K+1;k++){
          veco.at(k)+=vec.at(i).at(k)*s.test(i);
        }
      }
    }
    for(ll i=1;i<K+1;i++){
      if(veco.at(i)<b)break;
      if(i==K){
        re=min(re,veco.at(0));
      }
    }
  }
  if(re==d){
    re=-1;
  }
  cout<<re<<endl;
  return 0;
}
      
    	
  


Compiler output:
a.cc: In function 'int main()':
a.cc:30:10: error: 'veco' was not declared in this scope; did you mean 'vec'?
   30 |       if(veco.at(i)<b)break;
      |          ^~~~
      |          vec
a.cc:32:19: error: 'veco' was not declared in this scope; did you mean 'vec'?
   32 |         re=min(re,veco.at(0));
      |                   ^~~~
      |                   vec
a.cc: At global scope:
a.cc:36:3: error: expected unqualified-id before 'if'
   36 |   if(re==d){
      |   ^~
a.cc:39:3: error: 'cout' does not name a type
   39 |   cout<<re<<endl;
      |   ^~~~
a.cc:40:3: error: expected unqualified-id before 'return'
   40 |   return 0;
      |   ^~~~~~
a.cc:41:1: error: expected declaration before '}' token
   41 | }
      | ^
Language: C++

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

int n, m, x;
int c[12], a[12][12];

int main()
{
    cin >> n >> m >> x;
    for (int i = 0; i < n; i++) {
        cin >> c[i];
        for (int j = 0; j < m; j++) {
            cin >> a[i][j];
        }
    }
    int all = 1 << n;
    int mincost = INT_MAX;
    for (int mask = 0; mask < all; mask++) {
        int cost = 0;
        vector<int> level(m);
        for (int i = 0; i < n; i++) {
            if ((mask >> i) & 1) {
                cost += c[i];
                for (int 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) {
            mincost = min(mincost, cost);
        }
    }
    if (mincost == INT_MAX)
        cout << -1 << endl;
    else
        cout << mincost << endl;
    return 0;
}

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

8 5 22
100 3 7 5 3 1
164 4 5 2 7 8
334 7 2 7 2 9
234 4 7 2 8 2
541 5 4 3 3 6
235 4 8 6 9 7
394 3 6 1 6 2
872 8 4 3 7 2

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

#include<bits/stdc++.h>
using namespace std;
vector<int> c,d;
vector<vector<int>> a;
int n,m,x,sum=0,res=1200001;
int search(int cnt){
  if(cnt>=n) {
    bool solve=true;
    --cnt;
    for(int i=0; i<m; ++i) solve&=(d[i]>=x);
    if(solve==true) return sum; else return res;
  }
  for(int i=0; i<2; ++i){
    if(i==1) {sum+=c[cnt]; //for(int j=0; j<m; ++j) d[j]+=a[cnt][j];}
    res=min(res,search(cnt+1));
  }
  for(int i=0; i<m; ++i) d[i]-=a[cnt][i];
  sum-=c[cnt];
  if(cnt==0&&res==1200001) return -1; else return res;
}

int main(void){
  cin>>n>>m>>x;
  c.resize(n); d.resize(n);
  a.resize(n); for(int i=0; i<n; ++i) a[i].resize(m);
  for(int i=0; i<n; ++i){
    cin>>c[i];
    for(int j=0; j<m; ++j) cin>>a[i][j];
  }
  cout<<search(0)<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int search(int)':
a.cc:22:15: error: a function-definition is not allowed here before '{' token
   22 | int main(void){
      |               ^
a.cc:32:2: error: expected '}' at end of input
   32 | }
      |  ^
a.cc:6:20: note: to match this '{'
    6 | int search(int cnt){
      |                    ^
a.cc:32:2: warning: control reaches end of non-void function [-Wreturn-type]
   32 | }
      |  ^
Language: C++

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

int main(){
	int n,m,x; cin>>n>>m>>x;
	vector<int> B[n];
	for(int i=0; i<n; i++){
		for(int j=0; j<m+1; j++){
			int x; cin>>x;
			B[i].push_back(x);
		}
	}
	int ans = 1e6;
	ll arr[m];
	for(int mask=0; mask<(1<<n); mask++){
		memset(arr, 0, sizeof(arr));
		ll price=0;
		for(int i=0; i<n; i++){
			if(mask & (1<<i)){
				price+=B[i][0];
				for(int j=1; j<m+1; j++){
					arr[j-1]+=B[i][j];
				}
			}
		}
		bool ok = true;
		for(int k=0; k<m && ok; k++){
			if(arr[k]<x)ok=0;
		}
		if(ok)ans=min(ans, price);
	}
	cout<<(ans==1e6?-1:ans)<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:30: error: no matching function for call to 'min(int&, ll&)'
   31 |                 if(ok)ans=min(ans, price);
      |                           ~~~^~~~~~~~~~~~
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:31:30: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   31 |                 if(ok)ans=min(ans, price);
      |                           ~~~^~~~~~~~~~~~
/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:31:30: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   31 |                 if(ok)ans=min(ans, price);
      |                           ~~~^~~~~~~~~~~~
Language: C++

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


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

#include <bits/stdc++.h>
using namespace std;
int main(void){
    int n,m,x;
    cin >> n >> m >> x;
    
    vector<vector<int>> a(n, vector<int>(m));
    vector<int> c(n);
    
    for(int i=1;i<=n;i++) {
        cin >> c[i];
        for(int j=1;j<=m;j++) cin >> a[i][j];
    }
    int ans = 12345678;
    int all = 1<<n;
    
    for(int bit=0;bit<all;bit++){
        int cost = 0;
        vector<int> level(m);
        for(int i=0;i<n;i++){
            if(bit and (1<<i)){
                cost+=c[i];
                for(int 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==12345678)cout << -1;
    else cout << ans;
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:27: error: 'X' was not declared in this scope
   28 |             if(level[j] < X) ok = false;
      |                           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void){
    int n,m,x;
    cin >> n >> m >> x;
    
    vector<vector<int>> a(n, vector<int>(m));
    vector<int> c(n);
    
    for(int i=1;i<=n;i++) {
        cin >> c[i];
        for(int j=1;j<=m;j++) cin >> a[i][j];
    }
    int ans = 12345678;
    int all = 1<<n;
    
    for(int bit=0;bit<all;bit++){
        int cost = 0;
        vector<int> level(m);
        for(int i=0;i<n;i++){
            if(bit and 1<<i){
                cost+=c[i];
                for(int j=0;j<m;j++)level[j]+=a[i][j];
            }
        }
        bool ok = true;
        for(int i=0;i<m;i++){
            if(level[j] < X) ok = false;
        }
        if(ok)ans=min(ans,cost)
    }
 
    if(ans==12345678)cout << -1;
    else cout << ans;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:22: error: 'j' was not declared in this scope
   28 |             if(level[j] < X) ok = false;
      |                      ^
a.cc:28:27: error: 'X' was not declared in this scope
   28 |             if(level[j] < X) ok = false;
      |                           ^
a.cc:30:32: error: expected ';' before '}' token
   30 |         if(ok)ans=min(ans,cost)
      |                                ^
      |                                ;
   31 |     }
      |     ~
Language: Java

import java.util.*;
static 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<n;j++){
        a[i][j]=sc.nextInt();
      }
    }
    int[] aExp=new int[m];
    int cSum=0;
    List<Integer> cList=new ArrayList<>();
    boolean masterd=true;
    sc.close();
    
    for(int i=0;i< 1<<n;i++){
      for(int j=0;j<n;j++){
        if((1&i>>j)==1){
          for(int k=0;k<m;k++){
            aExp[k]+=a[j][k];
          }
          cSum+=c[j];
        }
      }
      for(int k=0;k<m;k++){
        if(aExp[k]<x){
          masterd=false;
          break;
        }
      }
      if(masterd) cList.add(cSum);
      for(int k=0;k<m;k++) aExp[k]=0;
      cSum=0;
      masterd=true;
    }
    int cMin=Integer.MAX_VALUE;
    if(cList.isEmpty()){
      cMin=-1;
    }
    else{
      for(int z:cList){
        if(cMin>z) cMin=z;
      }
    }
    System.out.println(cMin);
  }
}

Compiler output:
Main.java:2: error: modifier static not allowed here
static class Main{
       ^
1 error
Language: Java

import java.util.*;
static 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<n;j++){
        a[i][j]=sc.nextInt();
      }
    }
    int[] aExp=new int[m];
    int cSum=0;
    List<Integer> cList=new ArrayList<>();
    boolean masterd=true;
    sc.close();
    
    for(int i=0;i< 1<<n;i++){
      for(int j=0;j<n;j++){
        if((1&i>>j)==1){
          for(int k=0;k<m;k++){
            aExp[k]+=a[j][k];
          }
          cSum+=c[j]
        }
      }
      for(int k=0;k<m;k++){
        if(aExp[k]<x){
          masterd=false;
          break;
        }
      }
      if(masterd) cList.add(cSum);
      for(int k=0;k<m;k++) aExp[k]=0;
      cSum=0;
      masterd=true;
    }
    int cMin=Integer.MAX_VALUE;
    if(cList.isEmpty()){
      cMin=-1;
    }
    else{
      for(int z:cList){
        if(z<cMin) cMin=z;
      }
    }
    System.out.println(cMin);
  }
}

Compiler output:
Main.java:28: error: ';' expected
          cSum+=c[j]
                    ^
1 error