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

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

int main(){
	int N,M;
	cin >> N >> M;
	int sum=0;
	for(int i=0;i<M;i++){
		int A;
		cin >> A;
		sum+=A;
	}
	cout << ((N>=sum)?(N-sum):(-1)) << endl;
	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;

int N, M;

int main() {
    cin >> N >> M;
    int ans=0;
    for (int i = 0; i < M; i++) {
        int day;
        cin >> day;
        ans += day;
    }
    if (ans > N) {
        cout << "-1" << "\n";
    }
    else {
        cout << N-ans << "\n";
    }
    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;

int main(){
  int n,m;
  cin >> n >> m;
  int sum = 0;
  for (int i = 0; i < m; i++)
  {
    int a;
    cin >> a;
    sum+=a;
  }

  if(sum>n) cout << -1 << endl;
  else cout << n-sum << 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<iostream>
using namespace std;

int main(){
  int N,M;
  int a;
  cin >> N >> M;
  for (int i=0; i<M; i++){
      cin >> a;
      N -= a;
  }
  cout << max(-1,N) << endl;
}


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

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>
//#pragma GCC optimize("Ofast")
//#define _GLIBCXX_DEBUG
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
//#define int ll
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef pair<int,int> pii;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define irep(it, stl) for(auto it = stl.begin(); it != stl.end(); it++)
#define drep(i,n) for(int i = (n) - 1; i >= 0; --i)
#define fin(ans) cout << (ans) << '\n'
#define mp(p,q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define floatprec(dig) fixed << setprecision(dig)
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
#define itn int;
#define invar(typ, var) typ var; cin >> var;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
template <class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;} return 0;}
template <class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;} return 0;}
struct io{io(){ios::sync_with_stdio(false);cin.tie(0);}};
const int INF = INT_MAX / 2;
const ll LLINF = 1LL<<60;
constexpr ll MOD = 1000000007;
const double EPS = 1e-9;

signed main(void) {
  cin.tie(0); ios::sync_with_stdio(false);
  
  ll N, M;
  cin >> N >> M;
  ll s = 0;
  rep(i, M) {
    ll A;
    cin >> A;
    s += A;
  }
  if(s > N) {
    fin(-1);
  } else {
    fin((N - s));
  }
}

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

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>
//#pragma GCC optimize("Ofast")
//#define _GLIBCXX_DEBUG
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
//#define int ll
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef pair<int,int> pii;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define irep(it, stl) for(auto it = stl.begin(); it != stl.end(); it++)
#define drep(i,n) for(int i = (n) - 1; i >= 0; --i)
#define fin(ans) cout << (ans) << '\n'
#define mp(p,q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define floatprec(dig) fixed << setprecision(dig)
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
#define itn int;
#define invar(typ, var) typ var; cin >> var;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
template <class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;} return 0;}
template <class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;} return 0;}
struct io{io(){ios::sync_with_stdio(false);cin.tie(0);}};
const int INF = INT_MAX / 2;
const ll LLINF = 1LL<<60;
constexpr ll MOD = 1000000007;
const double EPS = 1e-9;

signed main(void) {
  cin.tie(0); ios::sync_with_stdio(false);
  
  ll N, M;
  cin >> N >> M;
  ll s = 0;
  rep(i, M) {
    ll A;
    cin >> A;
    s += A;
  }
  if(s < N) {
    fin(-1);
  } else {
    fin((N - s));
  }
}

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


import.java.util.*;
public class Main {
    private static int error =-1;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int sum = 0;
        for (int i = 0; i < b ; i++) {
            int c = sc.nextInt();
            if(a>sum)
                {
                    sum+=c;
                }
            else
                break;
            }
        if(a < sum){
            System.out.println(error);
        }
        else
            System.out.println(a-sum);
            
    

            }
}

Compiler output:
Main.java:2: error: <identifier> expected
import.java.util.*;
      ^
1 error
Language: Java


import.java.util.*;

public class Test {
    private static int error =-1;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int sum = 0;
        for (int i = 0; i < b ; i++) {
            int c = sc.nextInt();
            if(a>sum)
                {
                    sum+=c;
                }
            else
                break;
            }
        if(a < sum){
            System.out.println(error);
        }
        else
            System.out.println(a-sum);
            
    

            }
}

Compiler output:
Main.java:2: error: <identifier> expected
import.java.util.*;
      ^
1 error
Language: Java

public class Main {
    private static int error =-1;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int sum = 0;
        for (int i = 0; i < b ; i++) {
            int c = sc.nextInt();
            if(a>sum)
                {
                    sum+=c;
                }
            else
                break;
            }
        if(a < sum){
            System.out.println(error);
        }
        else
            System.out.println(a-sum);
            
    

            }
}

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

#include<iostream>
int main(){
int N, M;
std::cin >> N >> M;
int A[M];
for (i=0; i < M; i++){
  std::cin >> A[i];
}
sum = 0;

for (i=0; i < M; i++){
  sum = sum+ A[i];
}
if(sum > N){std::cout << -1;}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:6: error: 'i' was not declared in this scope
    6 | for (i=0; i < M; i++){
      |      ^
a.cc:9:1: error: 'sum' was not declared in this scope
    9 | sum = 0;
      | ^~~
a.cc:11:6: error: 'i' was not declared in this scope
   11 | for (i=0; i < M; i++){
      |      ^
Language: C++

#include<iostream>
 
int main(){
int N, M;
std::cin >> N >> M;
int A[M];
for (i=0; i < M; i++){
  std::cin >> A[i];
}

int sum = 0;
for (i=0; i < M; i++){
  sum= sum + A[i];
}  
if (sum > N){
std::cout << -1;
}
  
return 0;
}

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

n,m=map(int,input().split())
a=list(map(int,input().split()))
print(max(n-sum(a),-1))


Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | n,m=map(int,input().split())
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int]
    1 | n,m=map(int,input().split())
      |   ^
main.c:1:5: error: implicit declaration of function 'map' [-Wimplicit-function-declaration]
    1 | n,m=map(int,input().split())
      |     ^~~
main.c:1:9: error: expected expression before 'int'
    1 | n,m=map(int,input().split())
      |         ^~~
main.c:2:1: error: expected ',' or ';' before 'a'
    2 | a=list(map(int,input().split()))
      | ^
Language: C++

#include<bits/stdc++.h>
#define mod 1000000000
#define ll long long
#define _USE_MATH_DEFINES
using namespace std;
int main()
{
ll m,n;
cin>>m>>n;
ll a[n];
for(ll i=0;i<n;i++)
{
cin>>a[i];
m-=a[i];
}
cout<<max(m,-1);
}


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

#include<bits/stdc++.h>
#define mod 1000000000
#define ll long long
#define _USE_MATH_DEFINES
using namespace std;
int main()
{
int m,n;
cin>>m>>n;
int a[n];
for(int i=0;i<n;i++)
{
cin>>a[i];
m-=a[i];
}
cout<<m;
}


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

#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
 
/*** Template Begins ***/
 
typedef long long    ll;
typedef pair<ll,ll>  pll;
typedef pair<ll, pair<int, int> > plll;
typedef vector<long long>  vll;
typedef vector<pll>  vp;
typedef long double ld;
#define pb           push_back
#define INF          INT_MAX/10
#define F            first
#define S            second
#define mp           make_pair
// #define ios          ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define hell         1000000007LL
// #define h 998244353
#define all(a)       (a).begin(),(a).end()
ll power(ll x, ll y, ll p)
{
  ll res = 1;
  x = x % p;
  while (y > 0)
  { 
    if (y & 1) 
      res = (res*x) % p;
    y = y>>1;
    x = (x*x) % p;
  } 
  return res; 
} 
const int MAXN = 2e5+5;

// Debug //
#define trace(x)                 cerr << #x << ": " << x << endl;
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;
#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_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;
const double eps=1e-8;
int dblcmp(double d){if (fabs(d)<eps)return 0;return d>eps?1:-1;}
ll euclid(ll x,ll y,ll a,ll b)
{
  return (a-x)*(a-x)+(b-y)*(b-y);
}
// Constants //
void solve()
{
  ll total,n,i;
  cin>>total>>n;
  vector<ll> v(n);
  for(i=0;i<n;i++)
  {
    cin>>v[i];
    total-=v[i];
  }
  if(total>=0)
    cout<<total;
  else
    cout<<-1;
}
int main()
{ 
  // ios;
  // freopen("inputt.txt", "w", stdout);
  ll t,i;
  t=1;

  while(t--)
    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<stdio.h>

int main(void)
{
int N,M,i,hw=0,D;
  int A[10000];
  scanf("%d",&N);
  scanf("%d",&M);
  for(i=0;i<M;i++){
    scanf("%d",&A[i]);
    hw+=A[i];
    D=N-hw
    if(D<0)
    {
      printf("-1\n");
	  break;      
    }
  }
  if(D>=0)
  {
    printf("%d\n",D);
  }
  return 0;
}
  

Compiler output:
main.c: In function 'main':
main.c:12:11: error: expected ';' before 'if'
   12 |     D=N-hw
      |           ^
      |           ;
   13 |     if(D<0)
      |     ~~
Language: C

#include <bits/stdc++.h>

using namespace std;

#define f first
#define s second
#define pb push_back
#define mp make_pair
#define all(v) v.begin(), v.end()
#define sz(v) (int)v.size()

#define MOO(i, a, b) for (int i=a; i<b; i++)
#define M00(i, a) for (int i=0; i<a; i++)
#define MOOd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define M00d(i,a) for (int i = (a)-1; i >= 0; i--)

#define FAST ios::sync_with_stdio(0); cin.tie(0);
#define finish(x) return cout << x << '\n', 0;
#define dbg(x) cerr << ">>> " << #x << " = " << x << "\n";
#define _<< " _ " <<

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef pair<ld,ld> pd;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;

int main() { FAST
	mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
	ll n, m;
	cin >> n >> m;
	ll sum = 0;
	M00(i, m) {
		ll x;
		cin >> x;
		sum += x;
	}
	if(sum > n) {
		finish(-1);
	} else {
		finish(n - sum);
	}
}


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 ;

int main(){
  long long int n , m , a , ans = 0 ;
  cin >> n >> m ;
  for( int i = 0 ; i < m ; i++ ){
	cin >> a ;
    ans += a ;
  }
  cout << max( n - ans , -1 ) << endl ;
  return 0 ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: no matching function for call to 'max(long long int, int)'
   11 |   cout << max( n - ans , -1 ) << 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:11:14: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   11 |   cout << max( n - ans , -1 ) << 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:11:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   11 |   cout << max( n - ans , -1 ) << endl ;
      |           ~~~^~~~~~~~~~~~~~~~
Language: C++

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

int main(){
  long long int n , m , a , ans = 0 ;
  cin >> n >> m ;
  for( int i = 0 ; i < m ; i++ ){
	cin >> a ;
    ans += a ;
  }
  cout << max( ans , -1 ) << endl ;
  return 0 ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: no matching function for call to 'max(long long int&, int)'
   11 |   cout << max( ans , -1 ) << 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:11:14: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   11 |   cout << max( ans , -1 ) << 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:11:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   11 |   cout << max( ans , -1 ) << endl ;
      |           ~~~^~~~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;

int main() {
  int n.m;
  cin >> n >> m;
  int sum = 0;
  int hw[m];
  for(int i = 0; i < m; i++){
    cin >> hw[i];
    sum += hw[i];
  }
  if( n >= sum){
    cout << n - sum << endl;
  }
  else{
    cout << "-1" << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:8: error: expected initializer before '.' token
    5 |   int n.m;
      |        ^
a.cc:6:10: error: 'n' was not declared in this scope
    6 |   cin >> n >> m;
      |          ^
a.cc:6:15: error: 'm' was not declared in this scope; did you mean 'tm'?
    6 |   cin >> n >> m;
      |               ^
      |               tm
a.cc:10:12: error: 'hw' was not declared in this scope
   10 |     cin >> hw[i];
      |            ^~
Language: C

#include <iostream>
using namespace std;
int main()
{
    int n, m, a, sum = 0;
    cin >> n >> m;
    for(int i = 0; i < m; i++) {
        cin >> a;
        sum += a;
    }
    cout << (n - sum < 0 ? -1 : n - sum) << endl;
    return 0;
}

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

#include<stdio.h>
int main()
{
           int  n,m,i;
           scanf("%d",&n);
           scanf("%d",&m);
           int arr[m];
           for(i=0;i<m;i++)
           {
                   scanf("%d",&arr[i]);
                   sum+=arr[i];
           }
            if(sum<n)
                  printf("-1");
            else
                  printf("%d",sum-n);
           return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:20: error: 'sum' undeclared (first use in this function)
   11 |                    sum+=arr[i];
      |                    ^~~
main.c:11:20: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

int main() {
  int a,b;
  cin >> a >> b;
  int count, sum;
  for(int i=0;i<a;i++){
   cin >> count;
    sum += count;
  }
  cout << b - count; << endl;  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:22: error: expected primary-expression before '<<' token
   12 |   cout << b - count; << endl;
      |                      ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,m;
  cin>>n>>m;
  int arr[m];
  for(int i=0; i<m; i++)
  {
    cin>>arr[i];
    sum+=arr[i];
  }
  if(sum>n)
    cout<<"-1\n";
  else
    cout<<n-sum<<"\n";
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'sum' was not declared in this scope
   11 |     sum+=arr[i];
      |     ^~~
a.cc:13:6: error: 'sum' was not declared in this scope
   13 |   if(sum>n)
      |      ^~~
Language: C++

#include<iostream>
int main(){
  int n,m,sum;
  int ar[m];
  for(int i=0;i<m;i++){
    cin>>ar[i];
  }
  for(int i=0;i<m;i++){
    sum=sum+ar[i];
  }
  if(sum>n)
  {
    cout<<-1;
  }
  else{
    cout<<n-sum;
  }
      
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |     cin>>ar[i];
      |     ^~~
      |     std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:13:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |     cout<<-1;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:16:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |     cout<<n-sum;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C

N=int(input())
M=int(input())
arr=list(map(int,input().rstrip().split()))
summ=0  
for i in range(M) :
	summ+=arr[i]
if summ >= N :
	print(-1)
else :
    print(N-summ)
    

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

#include<bits/stdc++.h>
using namespace std;
#define FS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long int
#define ld long double
#define pb push_back
#define bp __builtin_popcount
#define sz size()
#define ff first
#define ss second
#define vll vector<ll>
#define vbool vector<bool>
#define vpll vector<pair<ll,ll>>
#define pll pair<ll,ll>
#define vllv vector<vector<ll>>
#define setpri(x) cout<<setprecision(x)<<fixed;
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
#define yesr {cout<<"YES"<<endl;return;}
#define nor {cout<<"NO"<<endl;return;}
// getline (std::cin,name);
ll MOD=1e9+7;
ll ceil1(ll n,ll x){if(n%x==0)return n/x; else return (n/x)+1;}
ll gcd(ll a,ll b){return __gcd(a,b);}
ll lcm(ll a,ll b){return (max(a,b)/gcd(a,b))*min(a,b);}
ll pow1(ll n,ll k,ll mm){
    if(k==0)return 1;
    if(k%2==0)return (pow1((n%mm)*(n%mm),k/2,mm))%mm;
    return ((n%mm)*(pow1((n%mm)*(n%mm),k/2,mm)%mm))%mm;
}
ll pow2(ll n,ll k){ll ans=1;
    while(k>0){
        if(k%2==1)ans=ans*n;n=n*n;k/=2;
    }return ans;
}
ll modinv(ll A,ll M){return pow1(A,M-2,M);}
ll fact(ll n){ll s=1; for(ll i=1;i<=n;i++)s*=i; return s;}
ll factmod(ll n,ll mod){ll s=1; for(ll i=1;i<=n;i++){s*=i;s%=mod;} return s;}
vll fact1tonmod(ll n,ll mod){vll  ans(n+1);ans[0]=ans[1]=1;
    for(ll i=2;i<=n;i++)ans[i]=(ans[i-1]*i)%mod;
    return ans;
}
ll ncrmod(ll n,ll r,ll mod){
    ll ans=((((factmod(n,mod)%mod)*(modinv(factmod(r,mod),mod)%mod))%mod)*(modinv(factmod(n-r,mod),mod)))%mod;
    return ans;
}
ll ncr(ll n,ll r){if(n==1 || r==0)return 1;if(r>n/2)r=n-r;
    ll ans=1;for(ll i=1;i<=r;i++){ans=((ans * n )/i);n--;}return ans;
}
bool isprime(ll n){if(n==1 || (n!=2 && n%2==0))return false; if(n==2)return true; 
        for(ll i=3;i<=sqrt(n);i+=2)if(n%i==0)return false; return true; }
bool func(pair<ll,ll> &a,pair<ll,ll> &b ){
    if(a.ff != b.ff)return a.ff < b.ff;
    return a.ss > b.ss;
}
void solve(){
    ll i,j,k,n,l,m,x,y,z,r;
    cin>>n>>m;
    ll sum=0;
    for(i=0;i<m;i++){
    	cin>>x;
    	sum+=x;
    }
    if(sum>n){
    	cout<<-1<<endl;
    }else{
    	cout<<n-sum<<endl;
    }

int main(){
    // FS;
    ll i,j,k,n,m,x,y,z,q;
    q=1;
	// cin>>q;
    while(q--){
        solve();
    }
    return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:70:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   70 | int main(){
      |         ^~
a.cc:70:9: note: remove parentheses to default-initialize a variable
   70 | int main(){
      |         ^~
      |         --
a.cc:70:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:70:11: error: a function-definition is not allowed here before '{' token
   70 | int main(){
      |           ^
a.cc:79:2: error: expected '}' at end of input
   79 | }
      |  ^
a.cc:56:13: note: to match this '{'
   56 | void solve(){
      |             ^
Language: Java

import java.util.*;
public class MainA{
  public static void main(String[]args){
  Scanner sc=new Scanner(System.in);
  int d=sc.nextInt();
  int as=sc.nextInt();
  int ar[]=new int[10000];
  int s=0;
  
  for(int i=0;i<as;i++){
  ar[i]=sc.nextInt();
  
  }
  for(int i=0;i<ar.length;i++){
  s=s+ar[i];
  }
  int f=d-s;
  
  
  System.out.println(f);
  
  }
}

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

#include<iostream>
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define ll long long
#define N 2*10e5
using namespace std;
void get(ll arr[],ll n){for(ll i=0;i<n;i++) cin>>arr[i];}
int main()
{
 	ios::sync_with_stdio(0);
	cin.tie(0);
	ll n,m;
	cin>>n>>m;
	ll arr[m],sum=0;
	for(int i=0;i<m;i++)
	cin>>arr[i] , sum+=arr[i];
	if(sum>n)
	cout<<"-1";
	else
	cout<<n-sum;
}



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

N = int(input())
M = int(input())

A = 0

for i in range(M):
  A += int(input())

if M < A:
  print(N-A)

else:
  print(-1)

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

#include<bits/stdc++.h>
using namespace std;
int main()
{
	long n,m,sum=0;
  	int a[m];
  	cin>>n>>m;
  	for(i=0;i<m;i++)
    {cin>>a[i];
     sum=sum+a[i];
    }
  	if(sum>n)
      cout<<-1;
  	if(sum<=n)
      cout<<n-sum;
}

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

#include<stdio.h>
int main(){
    int a[210000],i,n,j,m,sum=0;
	
	scanf("%d%d", &n,&m);
	for(i=0; i<m;i++){
		scanf("%d", &a[i]);
        sum+=a[i];
	}
    if(sum>n){
    printf("-1"\n);
    return 0;
    }
    printf("%d\n", m-sum);
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:11:16: error: stray '\' in program
   11 |     printf("-1"\n);
      |                ^
main.c:11:16: error: expected ')' before 'n'
   11 |     printf("-1"\n);
      |           ~    ^~
      |                )
Language: C

#include <cstdio>
#include <cstring>

using namespace std;

#define ll long long

int main() {
	int n, m;
	scanf("%d %d", &n, &m);
	ll sum = 0;
	for (int i = 0; i < m; i++) {
		int x;
		scanf("%d", &x);
		sum += x;
	}
	if (sum > n)
		puts("-1");
	else
		printf("%lld\n", n - sum);

	return 0;
}

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

#include <cstdio>

using namespace std;

#define ll long long

int main() {
	int n, m;
	scanf("%d %d", &n, &m);
	ll sum = 0;
	for (int i = 0; i < m; i++) {
		int x;
		scanf("%d", &x);
		sum += x;
	}
	if (sum > n)
		puts("-1");
	else
		printf("%lld\n", n - sum);

	return 0;
}

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

#include <bits/stdc++.h>

using namespace std;

using ll = long long;

int main() {
	int n, m;
	scanf("%d %d", &n, &m);
	ll sum = 0;
	for (int i = 0; i < m; i++) {
		int x;
		scanf("%d", &x);
		sum += x;
	}
	if (sum > n)
		puts("-1");
	else
		printf("%lld\n", n - sum);

	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 <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <numeric>
#include <algorithm>
#include <iomanip>
#define _USE_MATH_DEFINES
#include <cmath>
#include <math.h>

#define rep(i,m,n) for(int i=(m);i<(n);++i)

using namespace std;

using ll = long long;
using std::swap;

vector<long long int> v;
vector<long long int> w;



int main() {
	int N, M, ANS = 0,day;
	cin >> N >> M;
	rep(i, 0, M) {
		cin >> day;
		ANS += day;
	}
	ANS = N - ANS;
	if (ANS < 0)ANS = -1;
	cout << ANS << '\n';
	return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:34:18: error: expected '}' at end of input
   34 |         return 0;
      |                  ^
a.cc:24:12: note: to match this '{'
   24 | 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;
using P = pair<int, int>;


ll factorial(int n)
{
    ll fact = n;

    if (n <= 0) return 1;

    while (--n)
        fact *= n;

    return fact;
}

ll combi(int n, int r)
{
    if (r <= 0) return 1;
    return factorial(n) / (factorial(r) * factorial(n - r));
}

int main() {
   ll n, k;
   cin >> n >> k;
   rep(i ,n){

   cout << combi(n, k) << endl;
   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 ll long long

int main()
{
    ll n,m;
    cin>>n>>m;
    ll sum=0;
    for (int i=0;i<m;i++)
    {
        ll a;
        cin>>a;
        sum+=a;
    }
    cout<<max(-1,n-sum);
    return 0;
}


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

#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define repeq(i,n) for(int (i)=0;(i)<=(int)(n);(i)++)
#define rep1(i,x,n) for(int (i)=(x);(i)<(int)(n);(i)++)
#define rep1eq(i,x,n) for(int (i)=(x);(i)<=(int)(n);(i)++)
#define rrep(i,x) for(int i=((int)(x)-1);i>=0;i--)
using namespace std;
using ll = long long;
using Int = long long;

const int MOD = 1000000007;
const ll INF = numeric_limits<ll>::max();
const int inf = 1e8;
typedef pair<int,int> P;
typedef std::priority_queue<int> IntPrioQueue;
typedef std::priority_queue<int, std::vector<int>, std::greater<int> > IntReversePrioQueue;

//少数点表示
//cout << std::fixed << std::setprecision(14) << 値

int main(){
    cin.tie( 0 ); ios::sync_with_stdio( false );
    ll n,m;
    cin >> n >> m;
    vector<ll> a(m);
    ll cnt = 0;
    rep(i,m){
        cin >> a[i];
        cnt+=a[i];
    } 
    ll ans = ((n-cnt)>=0 ? (n-cnt) : -1);
    cout << ans << endl;
    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>
#include<cmath>
using namespace std;
int main()
{
    int n,m,sum=0;
    cin>>n>>m;
    int arr[10000];
    
    for(int i=1;i<=m;i++)
    {
        cin>>arr[i];
        sum=arr[i]+sum;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:14:6: error: expected '}' at end of input
   14 |     }
      |      ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C

// https://atcoder.jp/contests/abc163/tasks/abc163_b

#include "algorithm"
#include "bitset"
#include "cmath"
#include "functional"
#include "iomanip"
#include "iostream"
#include "map"
#include "numeric"
#include "queue"
#include "set"
#include "string"
#include "vector"
#define rep(i, to) for (ll i = 0; i < (to); ++i)
#define rep1(i, to) for (ll i = 1; i <= (to); ++i)
#define repf(i, from, to) for (ll i = from; i < (to); ++i)
#define repr(i, from) for (ll i = from - 1; i >= 0; --i)
#define all(vec) vec.begin(), vec.end()
#define unless(cond) if (!(cond))
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef long double ld;
template <typename T>
using V = vector<T>;
using VL = V<ll>;
using VVL = V<VL>;
template <typename T, typename U>
using P = pair<T, U>;
using PL = P<ll, ll>;
using VPL = V<PL>;

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

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

struct exit_exception : public std::exception {
  const char* what() const throw() { return "Exited"; }
};

template <typename T>
void drop(T res) {
  cout << res << endl;
  throw exit_exception();
}

const ll INF = 1e18;

void solve();

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

  try {
    solve();
  } catch (exit_exception& e) {
  }

  return 0;
}
#endif

void solve() {
  ll N, M;
  cin >> N >> M;

  ll sum = 0;
  rep(i, M) {
    ll a;
    cin >> a;
    sum += a;
  }

  ll res = N - sum;

  if (res < 0) drop(-1);
  drop(res);
}


Compiler output:
main.c:3:10: fatal error: algorithm: No such file or directory
    3 | #include "algorithm"
      |          ^~~~~~~~~~~
compilation terminated.
Language: C

#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) FOR(i, 0, (n))
#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define LAR(a, b) ((a)=max((a),(b)))
#define SML(a, b) ((a)=min((a),(b)))
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vl = vector<ll>;
using pii = pair<int, int>;
using vpii = vector<pair<int, int>>;
template<typename T>
using pque = priority_queue<T, vector<T>, greater<T>>;
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define ALL(a) (a).begin(), (a).end()
#ifdef LOCAL_DEBUG
#define DEBUG(...) printf(__VA_ARGS__)
#else
#define DEBUG(...)
#endif

int main(){
	int n, m; scanf("%d%d", &n, &m);
	REP(i, m) { int a; scanf("%d", &a); n -= a; }
	if(n < 0) n = -1;
	printf("%d\n", n);
}


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;

int main(){

int a,b,c;
int sum=0;
cin>>a>>c;

while(c--){
    cin>>b;
    sum+=b;
}
if(sum>a)
    cout<<"-1"<<endl;
else
    cout<<a-sum<<endl;


return 0;
}


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

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

using ll = long long;
using ull = unsigned long long;
using vl = vector<ll>;
using vi = vector<int>;
using vchar = vector<char>;
using vstr = vector<string>;
using pll =  pair<ll,ll>;

const ll mod = 1000000007;
const ll inf = 1000000000000000;

#define pi acos(-1)
#define pb push_back
#define test int TEST;cin>>TEST;while(TEST--)
#define vsort(xx) sort(xx.begin(),xx.end())
#define vrevsort(xx) sort(xx.rbegin(),xx.rend())


int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    long n,m;cin>>m>>n;
  ll sum=0;
  int ele;
  while(n--) {cin>>ele;sum+=ele;}
  if(m - sum >=0)?cout<<m-sum:cout<<-1;
   
    return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:33:18: error: expected primary-expression before '?' token
   33 |   if(m - sum >=0)?cout<<m-sum:cout<<-1;
      |                  ^
Language: C

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> mp;
ll inf =  1e9;


int main(){
 ll n,m;
 cin>>n>>m;
 vector<ll> a(m);
 for(ll i=0;i<m;i++)cin>>a[i];
 ll sum = 0;
 for(auto i:a)sum+=i;
 
 if(n-sum >= 0 )cout<<n-sum<<endl;
 else cout<<-1<<endl;   
 return 0;
}


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

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

int main() {
lli n, m;
  cin >> n >> m;
  lli temp = 0;
  for(int i = 0; i < m; i++){
  	int temp;
    cin >> temp;
    sum += temp;
  }
  if(sum >= n){
  cout << sum-n << endl;
  }else cout << -1 << endl;
 }


Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'sum' was not declared in this scope
   13 |     sum += temp;
      |     ^~~
a.cc:15:6: error: 'sum' was not declared in this scope
   15 |   if(sum >= n){
      |      ^~~
Language: C

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T, class U> using Pa = pair<T, U>;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N,M;
    cin >> N >> M;
    int sum = 0;
    for(int i=0;i<M;i++){
        int a;
        cin >> a;
        sum += a;
    }
    cout << (sum<=N? N-sum:-1) << "\n";
}

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>
#define ll long long
#define pi acos(-1)
using namespace std;
int main(){
    ll n,k;
    cin>>n>>k;
    ll arr[k];
    for(ll i=0;i<k;i++){
      ll sum=0;
      sum+=arr[i];
    }

    if(n>=sum){
      cout<<n-sum<<endl;
    }
    else{
      cout<<"-1"<<endl;
    }
  return 0;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: 'sum' was not declared in this scope
   14 |     if(n>=sum){
      |           ^~~
Language: Java

import java.util.Scanner;
public class Main
{
  public static void main(String args[])
  {
     Scanner sc=new Scanner(System.in);
    int a,b;
    a=sc.nextInt();
    b=sc.nextInt();
    if((b(b+1))/2 > a)
      System.out.println("-1");
    int c=(b(b+1))/2;
    System.out.println(c-a);
  }
}

Compiler output:
Main.java:10: error: cannot find symbol
    if((b(b+1))/2 > a)
        ^
  symbol:   method b(int)
  location: class Main
Main.java:12: error: cannot find symbol
    int c=(b(b+1))/2;
           ^
  symbol:   method b(int)
  location: class Main
2 errors
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();
        for(int i=0; i<M; i++){
          int Ai = sc.next();
          N = N - Ai;
        }
        if(N < 0){
          System.out.println("-1");
        }else{
          System.out.println(N);
        }
    }
}

Compiler output:
Main.java:9: error: incompatible types: String cannot be converted to int
          int Ai = sc.next();
                          ^
1 error
Language: Java

import java.util.Scanner;
public class Main
{
  public static void main(String args[])
  {
     Scanner sc=new Scanner(System.in);
    int a,b;
    a=sc.nextInt();
    b=sc.nextInt();
    if((b(b+1))/2 > a)
      System.out.println("-1");
    int c=(b(b+1))/2;
    System.out.println(c-a);

Compiler output:
Main.java:13: error: reached end of file while parsing
    System.out.println(c-a);
                            ^
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();
        for(int i=0; i<M; i++){
          int Ai = sc.next();
          N = N - Ai;
        }
        if(N < 0){
          System.out.println('-1');
        }else{
          System.out.println(N);
        }
    }
}

Compiler output:
Main.java:13: error: unclosed character literal
          System.out.println('-1');
                             ^
Main.java:13: error: unclosed character literal
          System.out.println('-1');
                                ^
2 errors
Language: C

#include <iostream>
using namespace std;

int main()
{
  int n, m, x, sum = 0; cin >> n >> m;
  while (m--){ cin>>x; sum +=x}
  if (sum <= n} cout << sum;
      else cout << -1;}

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

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

int main(){
  int N, M;
  cin >> N >> M;
  vector<int> A(N);
  for(int i = 0; i < N; ++i){
    cin >> A[i]
    M -= A[i];
  }
  if(M < 0) cout << -1 << endl;
  else cout << M << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: expected ';' before 'M'
   10 |     cin >> A[i]
      |                ^
      |                ;
   11 |     M -= A[i];
      |     ~
Language: C++

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

int main() {
  int m,n;
    cin>>m>>n;
    vector<int>A(m);
    int sum=0;
    rep(i,m){sum+A.at(i)};
  if(n-sum<0){cout<<-1<<endl;}
  else{cout<<n-sum<<endl;}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:25: error: expected ';' before '}' token
   10 |     rep(i,m){sum+A.at(i)};
      |                         ^
      |                         ;
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();
        for(int i=0; i<M; i++){
          int Ai = sc.next();
          N = N - Ai;
        }
        if(N < 0){
          System.out.println(-1);
        }else{
          System.out.println(N);
        }
    }
}

Compiler output:
Main.java:9: error: incompatible types: String cannot be converted to int
          int Ai = sc.next();
                          ^
1 error