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

#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
#define ll long long
#define _GLIBCXX_DEBUG
const ll MOD = 1000000007;
const int MAX = 510000;

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> A(M);
  for (int i=0; i<M; i++) cin >> A[i];
  int sum = accumulate(A.begin(), A.end());
  cout << max(0, N-sum) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:23: error: no matching function for call to 'accumulate(std::vector<int>::iterator, std::vector<int>::iterator)'
   14 |   int sum = accumulate(A.begin(), A.end());
      |             ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/numeric:62,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_numeric.h:134:5: note: candidate: 'template<class _InputIterator, class _Tp> _Tp std::accumulate(_InputIterator, _InputIterator, _Tp)'
  134 |     accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)
      |     ^~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:134:5: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_numeric.h:161:5: note: candidate: 'template<class _InputIterator, class _Tp, class _BinaryOperation> _Tp std::accumulate(_InputIterator, _InputIterator, _Tp, _BinaryOperation)'
  161 |     accumulate(_InputIterator __first, _InputIterator __last, _Tp __init,
      |     ^~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:161:5: note:   candidate expects 4 arguments, 2 provided
Language: C

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

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

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>
using namespace std;

int main() {
  int n,m;
  cin>>n>>m;
  vector<int> s(m);
  for(int i=0;i<m;i++){
    cin>>a[i];
  }
  int k=n;
 for(int i=0;i<m;i++){
    k -=a[i];
  }
  cout<<k<<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 <vector>
#include <iostream>
#include <string>
#include <math.h>
#include <algorithm>


using namespace std;


int main(void){
  
  int N,M,ans=0;
  vector<int> A;

  
  
  cin >> N >> M;

  for(int i = 0; i < M ;i++){
    int tmp;
    cin >> tmp;
    A.push_back(tmp);
  }

  ans = N;

  for(int i = 0; i < M ;i++){
    ans -= A.at(i);
  }

  if(ans <0){
    ans =-1;
  }

  cout << ans << endl;
  

  return 0;
}




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

#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define F first
#define S second
#define mp make_pair
#define PII pair<ll,ll>
#define PLL pair<long long,long long>
#define pq priority_queue
#define M map
#define UM unordered_map
#define graph unordered_map<ll,vector<ll>>
#define graphw unordered_map<ll,vector<pair<ll,ll>>>
#define V vector
#define mod 1000000007
#define inf 3000000000000000007ll
#define P pair
#define Fast ios_base::sync_with_stdio(false);cin.tie();cout.tie();
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(), a.rend()
#define sz(a) signed(a.size())
#define FIXED cout << fixed << setprecision(12)
#define L list
#define D deque
#define ld long double
#define FILE_READ_IN freopen("input.txt","r",stdin);
#define FILE_READ_OUT freopen("output.txt","w",stdout);
#define deb(x) cout<<#x<<" "<<x<<endl;
using namespace std;
// pair operation
template<class T, class U>istream& operator>>(istream& in, pair<T, U> &rhs) {in >> rhs.first; in >> rhs.second; return in;}
template<class T, class U>ostream& operator<<(ostream& out, const pair<T, U> &rhs) {out << rhs.first; out << " "; out << rhs.second; return out;}
template<class T, class U>pair<T, U> operator+(pair<T, U> &a, pair<T, U> &b) {return pair<T, U>(a.first + b.first, a.second + b.second);}
template<class T, class U>pair<T, U> operator-(pair<T, U> &a, pair<T, U> &b) {return pair<T, U>(a.first - b.first, a.second - b.second);}
// Linear STL
// VECTOR
template<class T>istream& operator>>(istream& in, vector<T> &a) {for (auto &i : a)cin >> i; return in;}
template<class T>ostream& operator<<(ostream& out, const vector<T> &a) {for (auto &i : a)cout << i << " "; return out;}
// SET
template<class T>ostream& operator<<(ostream& out, const set<T> &a) {for (auto &i : a)cout << i << " "; return out;}
template<class T>ostream& operator<<(ostream& out, const unordered_set<T> &a) {for (auto &i : a)cout << i << " "; return out;}
template<class T>ostream& operator<<(ostream& out, const multiset<T> &a) {for (auto &i : a)cout << i << " "; return out;}
// MAP
template<class T, class U>ostream& operator<<(ostream& out, const map<T, U> &a) {for (auto &i : a)cout << "(" << i.first << ", " << i.second << "(\n"; return out;}
template<class T, class U>ostream& operator<<(ostream& out, const unordered_map<T, U> &a) {for (auto &i : a)cout << "(" << i.first << ", " << i.second << "(\n"; return out;}


void judge() {
#ifndef ONLINE_JUDGE
	FILE_READ_IN
	FILE_READ_OUT
#endif
}



int main() {
	Fast;
	ll t = 1;
	judge();
	// cin >> t;
	while (t--) {
		ll n, m;
		cin >> m >> n;
		ll a[n];
		ll sum = 0;
		for (ll i = 0; i < n; i++) {
			cin >> a[i];
			sum += a[i];
		}
		// cout << sum << endl;
		ll ans = m - sum;
		if (ans < 0)ans = -1;
		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<iostream>
using namespace std;
int main(void){
  int n;
  ll a,ans=0,d;
  cin>>d>>n;
  for(int i=0;i<n;++i){
    cin>>a;
    ans+=a;
  }
  if (ans>=d)cout<<-1;
  else cout<<d-ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'll' was not declared in this scope
    5 |   ll a,ans=0,d;
      |   ^~
a.cc:6:8: error: 'd' was not declared in this scope
    6 |   cin>>d>>n;
      |        ^
a.cc:8:10: error: 'a' was not declared in this scope
    8 |     cin>>a;
      |          ^
a.cc:9:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |     ans+=a;
      |     ^~~
      |     abs
a.cc:11:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |   if (ans>=d)cout<<-1;
      |       ^~~
      |       abs
Language: C

#include <iostream>
#include <stdio.h>
#include <vector>

typedef long long ll;

#define rep(i,n) for(int i = 0; i < n; i++)
#define debug(x) cerr << #x << ": " << x << "\n";

using namespace std;
 
const ll INF = ll(1e18)+1;
const double PI=3.14159265358979323846;

int main(){
  int N, M, total = 0;
  cin >> N >> M;

  int x;  
  rep(i,M){
    cin >> x;
    total+=x;
  }
  if(N-total<0) cout << -1 << endl;
  else cout << N-total << endl;
  
}


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

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

#define ll          long long
#define ull         unsigned long long
#define pb          push_back
#define pii         pair<int,int>
#define pll         pair<long,long>
#define vi          vector<int>
#define vll         vector<ll>
#define vii         vector<pii>
#define Mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define rall(a)      (a).rbegin(),(a).rend()
#define ff           first
#define ss           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define mod        1000000007
//#define mod        998244353
#define rep(i,a,b)  for(int i=a;i<b;i++)
#define rem(i,a,b)  for(int i=a;i>b;i--)
#define mp(a,b)     make_pair(a,b)
#define INF         numeric_limits<ll>::max();
#define NINF        numeric_limits<ll>::min();
#define vvi(a,b,name)    vector<vector<int>> name(a,vector<int>(b,-1))
const long double pi=3.14159265359;
inline ll add(ll a,ll b,ll m){
    if((a+b)>=m)return (a+b)%m;
    return a+b;
}
inline ll mul(ll a,ll b,ll m){
    if((a*b)<m)return a*b;
    return (a*b)%m;
}



void solve(){
    int n,m;cin>>n>>m;
    ll su=0;
    rep(i,0,m){
        int temp;
        cin>>temp;
        su+=temp;
    }
    if(su<=n){
        cout<<n-su<<endl;
    }
    else cout<<-1<<endl;

}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    long t=1;
    //cin>>t;
    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 <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;

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

  int total = 0;
  for (int i = 0; i < M; i++) {
    total += A[i];
  }

  int result = N - total;

  cout << (result < 0 ? -1 : result) << 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 <iostream>
#include <vector>
using namespace std;
int main(){
    int N,M;
    vector<int>A(M);
    cin >> N >> M;
    for(int i=0;i<M;i++){
        cin >> A[i];
        N -= A[i];
    }
    if(N <0){
        cout << -1;
    }else{
        cout << N;
    }

}

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>
#include <string>
#include <list>
#include <queue>
#include <algorithm>
#define rep(i, n) for(i = 0; i < (n); i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define MOD 1000000007
#define PI 3.14159265358979323846
#define INF 1 << 30

using namespace std;
typedef long long ll;
typedef pair<int, int> pp;

int main(void) {
	int num, i, m, a, sum = 0;
	cin >> num >> m;
	rep(i, m) {
		cin >> a;
		sum += a;
	}
	int ans = num - sum;
	if (ans < 0)
		printf("-1\n");
	else
		cout << ans << "\n";
	return 0;
}

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

using System;
using System.Linq;
using System.Collections.Generic;

using E = System.Linq.Enumerable;

public class Program
{
    public static void Main()
    {
        var nm = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
        var (n, m) = (nm[0], nm[1]);
        var seqA = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();

        var d = Math.Max(-1, n - seqA.Sum());
        
        Console.WriteLine(d);
    }
}


Compiler output:
main.c:1:1: error: unknown type name 'using'
    1 | using System;
      | ^~~~~
main.c:2:1: error: unknown type name 'using'
    2 | using System.Linq;
      | ^~~~~
main.c:2:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | using System.Linq;
      |             ^
main.c:3:1: error: unknown type name 'using'
    3 | using System.Collections.Generic;
      | ^~~~~
main.c:3:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    3 | using System.Collections.Generic;
      |             ^
main.c:5:1: error: unknown type name 'using'
    5 | using E = System.Linq.Enumerable;
      | ^~~~~
main.c:5:17: error: request for member 'Linq' in something not a structure or union
    5 | using E = System.Linq.Enumerable;
      |                 ^
main.c:7:1: error: unknown type name 'public'
    7 | public class Program
      | ^~~~~~
main.c:7:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Program'
    7 | public class Program
      |              ^~~~~~~
Language: C

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

ll N,M;

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

	for(int i=0;i<M;i++){
		ll a;
		cin>>a;
		N -= a;
	}
	if(N>=0)
		cout<<N<<endl;
	else
		cout<<-1<<endl;

}

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>
using namespace __gnu_pbds;
using namespace std;

#define F first
#define S second
#define eb emplace_back
#define PI 3.14159265
#define sz(c) (int)c.size()
#define len(c) (int)c.length()
#define hcf(a, b) __gcd(a, b)
#define all(c) c.begin(), c.end()
#define vint vector<int>
#define vll vector<ll>
#define vpint vector<pair<int, int>>
#define vpll vector<pair<ll, ll>>
#define tr(container, it) \
    for (typeof(container.begin()) it = container.begin(); it != container.end(); it++)
#define fr(it, a, b) \
    for (int it = (a); it < (b); it++)
#define present(container, element) (container.find(element) != container.end())
#define cpresent(container, element) (find(all(container), element) != container.end())
#define maximum(a, b, c) (a > b ? (a > c ? a : c) : (b > c ? b : c))
#define minimum(a, b, c) (a < b ? (a < c ? a : c) : (b < c ? b : c))
typedef long long ll;
typedef long double ld;
typedef unsigned long long lu;
const ll mod = 1e9 + 7;
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,m,s=0;
    cin>>n>>m;
    fr(i,0,m)
    {
        int x;
        cin>>x;
        s+=x;
    }
    if(s<=n)
    {
        cout<<n-s<<"\n";
        return 0;
    }
    cout<<-1<<"\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() {
  int64_t N, M;
  vector<int64_t> v(M);
  for (int64_t = 0LL; i < M; i++) {
    int64_t x;
    v.at(i) = x;
  }
  int64_t total = 0LL;
  for (int64_t = 0LL; i < M; i++) {
    total += v.at(i);
  }
  if (total > N) cout << -1 << endl;
  else {
    cout << N - total MM endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: expected unqualified-id before '=' token
    7 |   for (int64_t = 0LL; i < M; i++) {
      |                ^
a.cc:7:15: error: expected ';' before '=' token
    7 |   for (int64_t = 0LL; i < M; i++) {
      |               ^~
      |               ;
a.cc:7:16: error: expected primary-expression before '=' token
    7 |   for (int64_t = 0LL; i < M; i++) {
      |                ^
a.cc:7:23: error: 'i' was not declared in this scope
    7 |   for (int64_t = 0LL; i < M; i++) {
      |                       ^
a.cc:7:28: error: expected ')' before ';' token
    7 |   for (int64_t = 0LL; i < M; i++) {
      |       ~                    ^
      |                            )
a.cc:7:30: error: 'i' was not declared in this scope
    7 |   for (int64_t = 0LL; i < M; i++) {
      |                              ^
a.cc:12:16: error: expected unqualified-id before '=' token
   12 |   for (int64_t = 0LL; i < M; i++) {
      |                ^
a.cc:12:15: error: expected ';' before '=' token
   12 |   for (int64_t = 0LL; i < M; i++) {
      |               ^~
      |               ;
a.cc:12:16: error: expected primary-expression before '=' token
   12 |   for (int64_t = 0LL; i < M; i++) {
      |                ^
a.cc:12:28: error: expected ')' before ';' token
   12 |   for (int64_t = 0LL; i < M; i++) {
      |       ~                    ^
      |                            )
a.cc:17:22: error: expected ';' before 'MM'
   17 |     cout << N - total MM endl;
      |                      ^~~
      |                      ;
Language: C

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

int main(){
    long N,M;
    cin >> N >> M;
    long sum = 0L;
    for(int i = 0; i < M; i++){
        int A;
        cin >> A;
        sum += A;
    }
    if(N >= sum){
        cout << N -sum << endl;
    }else{
        cout << -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;
long long n,m,a,s;
int main (){
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
scanf("%lld %lld",&n,&m);
for(int i=0;i<m;i++){
	 scanf("%lld",&a);
	 s=s+a;
}
if(s>n){
	 printf("-1");
}
else{
	printf("%lld",n-s);
}
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;
	int a, asum = 0;
	cin >> n >> m;
	for(int i = 0;i < m;i++){
		cin >> a;
		asum += a;
	}
	if(n >= asum){
		cout << n - asum << endl;
		return 0;
	}
	cout << -1 << 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;
typedef long long ll;
#define REP(i, n) for(int i = 0; i < (int)(n); i++)

int main(){
 int n,m;
 cin>>n>>m;
 int a[m],sum=0;
 REP(i,m){
   cin>>a[i];
   sum+=a[i];
 }
if (sum>n)
{
  /* code */
  cout<<-1<<endl;
}
else
{
  cout<<n-sum<<endl;
}


  }

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>
#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(){
    int n, m, in;
    cin >> n >> m;
    rep(i, m){
        cin >> in;
        n -= in;
    }
    if(n >= 0){
        cout << n << endl;
    }else{
        cout << -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;
#define rep(i,a) for(int i=0;i<a;i++)
#define pd(a,n) for(int i=0;i<n;i++)cout<<a[i]<<((i==n-1)?"\n":" ");cout<<endl;
#define pdd(a,n,m)for(int i=0;i<n;i++){for(int j=0;j<m;j++)cout<<a[i][j]<<" ";cout<<endl;}
#define mp make_pair
#define pb push_back
#define ll long long
//#define int ll
//#define __int64 lng long
#define P pair<int,int>
#define PP pair<P,int>

int n,m;
int a[111111];
int sum;

signed main(){
  cin>>n>>m;
  rep(i,m)cin>>a[i];
  rep(i,m)sum+=a[i];
  if(sum>n)
    cout<<-1<<endl;
  else
    cout<<n-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<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 ll long long 
using namespace std;
int main(){
  ll n,m;
  cin >>n>>m;
  vector<ll> vec(m);
  ll key=0;
  rep(i,m){
    cin >>vec[i];
    key+=vec[i];
  }
  if(key>n){
    cout <<-1<<endl;
  }else{
    cout <<n-key<<endl;
  } 
}

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

n,m = map(int,input().split())
a = list(map(int,input().split()))

if n >= sum(a):
    print(n-sum(a))
else:
    print(-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:7: error: implicit declaration of function 'map' [-Wimplicit-function-declaration]
    1 | n,m = map(int,input().split())
      |       ^~~
main.c:1:11: 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>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)n; i++)

int main() {
  int N, M;
  cin >> N >> M;
  
  vector<int> A(M);
  rep(i, M) cin >> A.at(i);
  
  int sum = 0;
  rep(i, M) sum += A.at(i);
  
  int ans;
  if (N < sum) {
    cout << "-1" << endl;
  }
  
  else {
    ans = N - sum;
    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: Java

using System;
using System.Linq;

public class Test
{
	public static void Main()
	{
		// your code goes here
		
		var hoi = Console.ReadLine().Split().Select(nyan => int.Parse(nyan)).ToArray(); //この呪文覚えたい
		int n = hoi[0];
		int m = hoi[1];
		
		var a = Console.ReadLine().Split().Select(nyaan => int.Parse(nyaan)).ToArray(); //この呪文覚えたい
		
		int sum = 0;
		for(int i=0;i!=m;i++){
			
			sum += a[i];
			
		}
		
		int ans = n - sum;
		if(ans<0){
			
			ans = -1;
			
		}
		
		Console.WriteLine(ans);
		
	}
}

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
using System;
^
  (use --enable-preview to enable unnamed classes)
Main.java:2: error: class, interface, enum, or record expected
using System.Linq;
^
Main.java:10: error: illegal start of expression
		var hoi = Console.ReadLine().Split().Select(nyan => int.Parse(nyan)).ToArray(); //????????
		                                                  ^
Main.java:10: error: class expected
		var hoi = Console.ReadLine().Split().Select(nyan => int.Parse(nyan)).ToArray(); //????????
		                                                        ^
Main.java:10: error: ')' or ',' expected
		var hoi = Console.ReadLine().Split().Select(nyan => int.Parse(nyan)).ToArray(); //????????
		                                                             ^
Main.java:10: error: not a statement
		var hoi = Console.ReadLine().Split().Select(nyan => int.Parse(nyan)).ToArray(); //????????
		                                                              ^
Main.java:10: error: ';' expected
		var hoi = Console.ReadLine().Split().Select(nyan => int.Parse(nyan)).ToArray(); //????????
		                                                                  ^
Main.java:14: error: illegal start of expression
		var a = Console.ReadLine().Split().Select(nyaan => int.Parse(nyaan)).ToArray(); //????????
		                                                 ^
Main.java:14: error: class expected
		var a = Console.ReadLine().Split().Select(nyaan => int.Parse(nyaan)).ToArray(); //????????
		                                                       ^
Main.java:14: error: ')' or ',' expected
		var a = Console.ReadLine().Split().Select(nyaan => int.Parse(nyaan)).ToArray(); //????????
		                                                            ^
Main.java:14: error: not a statement
		var a = Console.ReadLine().Split().Select(nyaan => int.Parse(nyaan)).ToArray(); //????????
		                                                             ^
Main.java:14: error: ';' expected
		var a = Console.ReadLine().Split().Select(nyaan => int.Parse(nyaan)).ToArray(); //????????
		                                                                  ^
12 errors
Language: C

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

// Remove GCC optimizer for codechef
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")

using namespace std;
using namespace __gnu_pbds;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define pb push_back
#define endl "\n"
#define int long long
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

const int INF = 3e18 + 8;
const double PI = acos(-1);
const int N = 1e6 + 7;
int mod = 1e9;

const int maxn = 1e5 + 7;

int32_t main()
{
    IOS;
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);

    int n, m;
    cin >> n >> m;
    int sum = 0;
    for(int i = 1; i <= m; i++)
    {
        int a;
        cin >> a;
        sum += a;
    }
    if(sum > n)
        cout << -1;
    else
        cout << (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 <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <numeric>
#include <bitset>

using namespace std;
#define repp(i,a,b) for(int i = (int)(a) ; i < (int)(b) ; ++i)
#define reppe(i,a,b) for(int i = (int)(a) ; i <= (int)(b) ; ++i)
#define repm(i,a,b) for(int i = (int)(a) ; i > (int)(b) ; --i)
#define repme(i,a,b) for(int i = (int)(a) ; i >= (int)(b) ; --i)

typedef long long ll;

long long GCD(long long a, long long b){if(b==0)return a;return GCD(b,a%b);}

int main() {
    long long N, M; cin >> N >> M;
    vector<long long> A(M); repp(i,0,M) cin >> A[i];
    long long sum_ = 0;
    repp(i,0,M) sum_ += A[i];
    cout << max(-1LL, N - sum_) << endl;
}


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

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

typedef long long int ll; 
#define MOD 1000000007
#define ON 200000
#define rep(i,n) fp(i,0,n)  
#define fp(i,a,b) for(ll i=(a);i<(b);++i)
#define fn(i,a,b) for(ll i=(a);i>(b);i--)
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define FF first
#define SS second
typedef pair<ll, ll> pll; 
typedef vector<pll> vpll;
typedef vector<ll> vll;
#define rs(t) string t;cin>>t
#define ri(t) int t;cin>>t
#define rll(t) long long int t;cin>>t
#define MK make_pair
#define PB push_back
#define PO pop_back
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
///// This part below is only for debug, not used /////
template<typename T> ostream &operator<<(ostream &os, const vector<T> &vec){ os << "["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const deque<T> &vec){ os << "deq["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const unordered_set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const unordered_multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &pa){ os << "(" << pa.first << "," << pa.second << ")"; return os; }
template<typename TK, typename TV> ostream &operator<<(ostream &os, const map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; }
template<typename TK, typename TV> ostream &operator<<(ostream &os, const unordered_map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; }
#define dbg(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ") " << __FILE__ << endl;
///// END /////



int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  rll(n);
  rll(m);

  vll v(m);
  cin >> v;

  ll ma = 0;
  rep(i,m){
  	ma += v[i];
  }	

  if(ma>n){
  	cout << -1 << endl;
  }
  else{
  	cout << n - ma << 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

//Author : Sidiq Tri Pratikto
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define fi first
#define se second
#define mp make_pair
#define all(v) v.begin(), v.end()

using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> new_data_set;
//order_of_key(x) = number of elements stricly smaller than x
//find_by_order(x) = return x-th largest element
typedef long long LL;
const LL MOD = 998244353;
const double PI = 2 * acos(0);

int main() {
	int N, M;
	scanf("%d%d", &N, &M);
	while (M--) {
		int x;
		scanf("%d", &x);
		N -= x;
	}
	if (N < 0) printf("-1\n");
	else printf("%d\n", N);
}

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

#include <vector>
#include <iostream>
#include <string>
#include <math.h>
#include <algorithm>
#include <bits/stdc++.h>


using namespace std;


int main(void){
  
  int N,M,ans=0;
  vector<int> A;

  
  
  cin >> N >> M;

  for(int i = 0; i < M ;i++){
    int tmp;
    cin >> tmp;
    A.push_back(tmp);
  }

  ans = N;

  for(int i = 0; i < M ;i++){
    ans -= A.at(i);
  }

  if(ans <0){
    ans =-1;
  }

  cout << ans << endl;
  

  return 0;
}




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

#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp> 
// #include <ext/pb_ds/tree_policy.hpp> 
// #include <ext/pb_ds/detail/standard_policies.hpp>
// using namespace __gnu_pdbs;
using namespace std;

// typedef tree<int, null_type, less<int>, rb_tree_tag,  
//             tree_order_statistics_node_update>  
//     ordered_set;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define mt make_tuple
#define eb emplace_back
#define sf(x) sizeof(x)
#define len(x) x.length()
#define sz(x) x.size()
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

#define LB(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define UB(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef unsigned long long ull;
typedef long double ld; 
typedef tuple<int,int,int> State;

ll mod = 1e9 + 7;

#define citc(tc) int tc; cin>>tc; while(tc--) 
#define each(a,x) for( auto &a:(x))
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for (ll i = (n) - 1; i >= 0; i--)
#define rep2(i, l, r) for (ll i = (l); i < (r); i++)
#define rep2r(i, l, r) for (ll i = (r) - 1; i >= (l); i--)
#define range(a) a.begin(), a.end()
#define deb(x) cout<<#x<<" "<<x<<endl;
#define cini(i) int i; cin>>i;
#define cinll(l) ll l; cin>>l;
#define cinll2(l, z) ll l, z; cin>>l>>z;
#define cinll3(l, z, x) ll l, z, x; cin>>l>>z>>x;
#define cinai(a, n) vi a(n); rep(i, n) { cin>>a[i]; }
#define cinal(a, n) vl a(n); rep(i, n) { cin>>a[i]; }
#define coutai(a, n) rep(i, n) { cout<<a[i]<<" "; } ent;
#define coutal(a, n) rep(i, n) { cout<<a[i]<<" "; } ent;
#define ent cout<<endl;
#define ms(dp, x) memset(dp, x, sf(dp))

ll powm(ll a, ll b, ll mod) {
	ll res=1;
	while(b) {
		if(b&1)
			res=(res*a)%mod;
		a=(a*a)%mod;
		b>>=1;
	}
	return res;
}

void solve()
{
	ll n, m;
	cin>>n>>m;
	cinal(a, m);
	ll sum = 0;
	rep(i, m)
		sum += a[i];
	cout<<max(-1ll, n - sum)<<endl;
}
int main()
{
	fastio();
	// citc(tc)
		solve();
}


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 <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
typedef long long   ll;
#define pb                push_back
#define mp                make_pair
#define all(a)            (a).begin(), (a).end()
#define clr(a,h)          memset(a, (h), sizeof(a))
#define mem(a,h)          memset(a, (h), sizeof(a))
#define fi first
#define se second
#define por(a,b) (((a%MOD) * (b%MOD))%MOD)
#define forg(i, b, e, c)    for (ll i = (ll)b; i < (ll)e; i+=c)
#define forr(i, b, e)    for (ll i = b; i < e; i++)
 
 
using namespace std;
//using namespace __gnu_pbds;
typedef double lldb;
typedef pair<ll, ll>  ii;
typedef pair<ll, ii>  iii;
typedef vector<ll>     vi;
typedef vector<vi>     vvi;
typedef vector<ii>      vii;
typedef vector<ll>      vll;
//typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
const ll INF = 1e9;
const double PI = acos(-1);
#define tam 120000
#define tam2 200000
#define offset 
const ll MOD= 998244353;
int main()
{
    int n,m;
    cin>>n>>m;
    int valor;
    forr(i,0,m)
    {
        cin>>valor;
        n-=valor;

    }
    n=max(n,-1);
    cout<<n<<endl;
}
// PLUS ULTRA!


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;
    for(int i=0;i<M;i++){
        int K;cin>>K;
        N-=K;
    }
    cout<<max(N,-1)<<endl;
}

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>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

const int N = 1e5 + 11;
const int M = 1e6 + 11;
const int MOD = 1e9 + 7;
const double PI = acos(-1.0);

int main(int argc, char **args){
  //  freopen("in.txt", "r", stdin);
    int sum, n; cin >> sum >> n;
    int t = 0;
    for(int i = 0; i < n; i++)
        {
            int c; cin >>c;
            t += c;
        }
    if(t > sum ) puts("-1");
    else cout << sum - t <<"\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() {
  double n, m, x, sum = 0;
  cin >> n >> m;

  for (int i = 0; i < m; i++) {
    cin >> x;
    n -= x;
  }

  if (n < 0)
    cout << "-1" << endl;
  else
    cout << n << 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>
#include <vector>
#include <algorithm>
#include <functional>

using namespace std;

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

int main() {
  int N, M; cin >> N >> M;
  vector<int> A(M);

  int res = N;
  rep(i, M) {
    res -= A.at(i);
  }

  cout << min(-1, res) << 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 <bits/stdc++.h>
#include<queue>
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef pair<ll,ll> Pll;
typedef pair<string,string> Pstring;
typedef pair<double,double> Pdouble;

#define REP(i,n) for(ll i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define Precision13 cout << fixed << setprecision(13)
ll MOD = 1e9+7;
const double PI=3.14159265358979323846;


int main() {
  ll n,m;
  cin >> n>> m;
  vector<ll> a(m);
  ll sum = 0;
  REP(i,m){
    cin >> a.at(i);
    sum += a.at(i);
  }
  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 <bits/stdc++.h>
using namespace std;
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pb push_back
#define fi first
#define se second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mii map<int,int>
#define mll map<ll,ll>
#define all(x) (x).begin(),(x).end()
#define S(x) (int)(x).size()
#define L(x) (int)(x).length()
#define trace(x) cerr<<#x<<" is "<<x<<'\n';

const int mod = 1e9+7;
const ll infl = 0x3f3f3f3f3f3f3f3fLL;
const int infi = 0x3f3f3f3f;

void solve()
{
	int n,m;
	cin>>n>>m;
	int sum=0;
	for(int i=0;i<m;i++)
	{
		int t;
		cin>>t;
		sum+=t;
	}
	if(sum>n) cout<<-1;
	else cout<<n-sum;
}

int main()
{
	IOS
	int t=1;
	//cin>>t;
	while(t--)
	{
		solve();
	}
}


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;
typedef long long int lli;
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef pair <lli,lli> pii;
#define ff first
#define ss second
#define mod 1000000007
#define pb push_back
#define EPS 1e-6

int main()
{
    fast;
    lli n, m;
    cin>>n>>m;
    lli sum=0;
    for(int i=0; i<m; i++){
        lli x;
        cin>>x;
        sum+=x;
    }
    if(n-sum>=0) cout<<(n-sum);
    else cout<<(-1);
    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 <ext/pb_ds/assoc_container.hpp> 
using namespace __gnu_pbds;
using namespace std;

typedef long long int lli;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<lli> vli;
typedef vector<pii> vii;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> OrderedSet;

const int MOD	= 1e9 + 7;
const double PI = acos(-1.0);

#define fastio			ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define sz(a) int((a).size())
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define all(c) (c).begin(),(c).end()
#define tr(c,i) for(auto &i : c)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define rep(i, n)    for(int i = 0; i < (n); ++i)
#define repA(i, a, n)  for(int i = a; i <= (n); ++i)
#define repD(i, a, n)  for(int i = a; i >= (n); --i)
#define fill(a)  memset(a, 0, sizeof (a))
#define error(x) cerr << #x << " = " << (x) << endl
#define errorp(p) cerr << #p << " = " << (p.first) << ", " << (p.second) << endl

template<typename T> T gcd(T a, T b){return(b?__gcd(a,b):a);}
template <typename T> T lcm(T a, T b){return (a*b)/gcd(a,b); }
int mul(int a, int b, int c){lli res=(lli)a*b;return (int)(res>=c?res%c:res);}
template<typename T>T power(T e, T n, T m){T x=1,p=e;while(n){if(n&1)x=mul(x,p,m);p=mul(p,p,m);n>>=1;}return x;}
int mod_neg(int a, int b, int c){int res;if(abs(a-b)<c)res=a-b;else res=(a-b)%c;return(res<0?res+c:res);}
template<typename T>T extended_euclid(T a, T b, T &x, T &y){T xx=0,yy=1;y=0;x=1;while(b){T q=a/b,t=b;b=a%b;a=t;\
t=xx;xx=x-q*xx;x=t;t=yy;yy=y-q*yy;y=t;}return a;}
template<typename T>T mod_inverse(T a, T n){T x,y,z=0;T d=extended_euclid(a,n,x,y);return(d>1?-1:mod_neg(x,z,n));}
template <class T>  inline void smax(T &x,T y){ x = max((x), (y));}
template <class T>  inline void smin(T &x,T y){ x = min((x), (y));}


int main(){
    // #ifndef ONLINE_JUDGE
	// 	freopen("test", "r", stdin);
	// #endif
    fastio;
    
    lli N, M;
    cin >> N >> M;

    lli sum = 0;
    int temp;
    rep(i, M){
        cin >> temp;
        sum += temp;
    } 

    if(sum > N){
        cout << -1 << endl;
    }else{
        cout << N - sum << 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>
#define rep(i,N) for(ll (i)=0;(i)<(N);(i)++)
#define chmax(x,y) x=max(x,y)
#define chmin(x,y) x=min(x,y)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int mod = 1000000007;
const int INF = 1001001001;

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


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 <string>
#include <vector>
#include <algorithm>
#include <numeric>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int N,M;
vector<int> A;
int main(){
    cin >>  N >> M;
    REP(i,M){
        int a;
        cin >> a;
        A.push_back(a);
    }
    int day = accumulate(ALL(A),0);
    if(N >= day){cout << N - day << endl;}
    else{cout << -1 << endl;}
}

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>


int main() {

	int N, M;
	std::cin >> N >> M;

	int totalDays = 0;

	for (int i = 0; i < M; i++) {
		int buffer;
		std::cin >> buffer;
		totalDays+=buffer;
	}


	if (totalDays > N) {
		std::cout << "-1\n";
	} else {
		std::cout << N - totalDays << std::endl;
	}



}


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

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include <functional>
#include <iomanip>
#include <bitset>
#include <numeric>
#include <queue>
#include <map>
#include <cstdint>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
const long long mod = 1000000007;
typedef long long int ll;
typedef pair<ll, ll> P;
const vector<int> di = { -1, 0, 1, 0 };
const vector<int> dj = { 0, 1, 0, -1 };
const long double PI = acos(-1);

int main() {

	long double r;
	cin >> r;

	cout << long double(2 * r * PI) << endl;

	return 0;
	
}



Compiler output:
a.cc: In function 'int main()':
a.cc:27:17: error: expected primary-expression before 'long'
   27 |         cout << long double(2 * r * PI) << endl;
      |                 ^~~~
Language: C

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long INF = 1LL<<60;
#define REP(i,n) for(int i=0;i<n;i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

int main(){
    int n,m;
    cin >> n>>m;
    int A[m];
    int ans=0;
    REP(i,m){
        cin>>A[i];
        ans += A[i];
    }
    cout<<n-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;
#define ll long long
int main()
{
  ll n,m,s=0;
  cin>>n>>m;
  ll a[m+1],i;
  for(i=0;i<m;i++)
  {
      cin>>a[i];
      s+=a[i];
  }
  if(n-s<0)
    cout<<-1<<endl;
  else
    cout<<n-s<<endl;

}


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 <math.h>
using namespace std;
#define rep(i,n) for (int i=0;i<(n);i++)
typedef long long ll;
bool aaa[11111111];
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
ll gcd(ll a, ll b) {
  if(a < b) return gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}
 
 
int main() {
  ll n,m,k;
  float x1,x2,bx,b=50000.0001,c=5;
  double xx1,xx2,bx,aa,cc;
  aa=3.1415926535;
  cin>>n>>m;
  rep(i,m){
      cin>>k;
      n-=k;
  }
  if(n>=0)cout<<n<<endl;
  else cout<<-1<<endl;
  //vector<vector<bool>> sinsetsu(15,vector<bool>(14)),usotsuki(15,vector<bool>(14));
  //vector<vector<int>> sss(15,vector<int>(14))
  //vector<vector<int>> sss(h,vector<int>(w));
  //vector<int> a(k),b(k);
  //char x;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:18: error: conflicting declaration 'double bx'
   23 |   double xx1,xx2,bx,aa,cc;
      |                  ^~
a.cc:22:15: note: previous declaration as 'float bx'
   22 |   float x1,x2,bx,b=50000.0001,c=5;
      |               ^~
Language: C

n, m = map(int, input().split())
a = list(map(int, input().split()))

if n >= sum(a):
    print(n-sum(a))
else:
    print(-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:4: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int]
    1 | n, m = map(int, input().split())
      |    ^
main.c:1:8: error: implicit declaration of function 'map' [-Wimplicit-function-declaration]
    1 | n, m = map(int, input().split())
      |        ^~~
main.c:1:12: 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>
#include <map> // pair
using namespace std;

typedef long long ll;
#define vec vector<int>
#define vecll vector<ll>
#define vpair vector<pair<int, int>>
#define vpairll vector<pair<ll, ll>>
#define rep(i,n)   for(int i=(int)0; i<(int)n; i++)
#define llrep(i,n)   for(ll i=(ll)0; i<(ll)n; i++)
#define REP(i,m,n) for(int i=(int)m; i<(int)n; i++)
#define all(var)     (var).begin(), (var).end()
#define prt(var)     cout << var << endl
#define prt_dbl(i,var) cout<<fixed<<setprecision(i)<<var<<endl;
template <typename Val>
Val gcd(Val a, Val b) {
//use ll or int for gcd
    if (b==0) return a;
    else return gcd(b, a%b);
}
template <typename Val>
Val vec_max(vector<Val> v){
  return *max_element(v.begin(),v.end());
}
template <typename Val>
Val vec_min(vector<Val> v){
  return *min_element(v.begin(),v.end());
}
//---------------------------------------------------------------
int main(){
  ll N,M,S;
  cin>>N>>M;
  vector<int> A(M);
  ll ans;
  S = 0;
  llrep(i,M){
    cin>>A.at(i);
    S+= A.at(i);
  }

  if(S>N)ans = -1;
  else ans = N-S;
  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>

#define int long long

using namespace std;

signed main(){
    int N,M;
    cin>>N>>M;
    int arr[M];
    int 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:
a.cc: In function 'int main()':
a.cc:20:17: error: 'Sum' was not declared in this scope; did you mean 'sum'?
   20 |         cout<<N-Sum;
      |                 ^~~
      |                 sum