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

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#define  boost ios_base::sync_with_stdio(false);cin.tie(NULL);
#define ull unsigned long long
#define d1(x) cout<<#x<<" "<<x<<endl;
#define d2(x,y) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<endl;
#define d2i(x,y,i) cout<<#x<<i<<" "<<x<<" "<<#y<<i<<" "<<y<<endl;

#define fr(i,l,r) for(ll i=l;i<r;i++)
#define mems(a,x) memset(a,x,sizeof(a))
#define mod 1000000007
#define ff first
#define ss second
#define pb(x) push_back(x)
#define vll vector<ll>
#define pbp(x,y) push_back(make_pair(x,y))
#define  mat vector<vector<ll>>
#define pi 3.14159265358979323846
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

void solve(){
  ll n,m;
  cin>>n>>m;
  ll sm=0,x;
  fr(i,0,m)
  cin>>x,sm+=x;
  n-=sm;
  if(n<0)
  cout<<-1;
  else cout<<n;
}





int main(){
    ll t=1;
//cin>>t;
    while(t--){
     solve();
   cout<<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

#pragma GCC optimize(2)
#include<bits/stdc++.h>
#define ll long long
#define maxn 1000005
#define inf 1e9
#define pb push_back
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define per(i,a,b) for(int i=a;i>=b;i--)
using namespace std;

inline int read()
{
	int x=0,w=1; char c=getchar();
	while(c<'0'||c>'9') {if(c=='-') w=-1; c=getchar();}
	while(c<='9'&&c>='0') {x=(x<<1)+(x<<3)+c-'0'; c=getchar();}
	return w==1?x:-x;
}

int main()
{
	int n=read(),m=read(),ans=0;
	rep(i,1,m) {int x=read(); ans+=x;}
	if(ans>n) puts("-1"); else cout<<n-ans<<endl;
	return 0;
}

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 <bits/stdc++.h>
using namespace std;
using ll = long long;

int main() {
  int n , m;
  cin >> n >> m;
  
  ll count =0;
  vector<int>a(m);
  for(int i=0; i<m; i++){
    cin >> a[i];
    count+=a[i];
  }
  
  ll ans = n-count;
  
  if(ans<0) cout << -1 << endl;
  else 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>
#include <cmath>
using namespace std;

int main(){
   int n,m;
   cin>>n>>m;
   int x;
   for(int i=0;i<m;i++){
       cin>>x;
       n-=x;
       if(n<0){
           cout<<-1;
           return 0;
       }

   }
   cout<<n;
   return 0;
}

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

#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define INF (int)(1123456789)
#define LINF (long long int)(112345678901234567)
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define PB push_back
#define SP << " " <<

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;

__attribute__((constructor))
void initial(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed <<setprecision(15);
}


int main(void){
	ll N,M;
    cin >> N >> M;
    VL A;
    ll sum = 0;
    rep(i,M){
        ll 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: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include <iostream>
using namespace std;

int main()
{
  int N, M, input, sum = 0;
  cin >> N >> M;
  for(int i=0;i<M;i++){
    cin >> input;
    sum += input;
  }
  if(input>N){
    cout << -1 << endl;
  }else{
    cout << 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 <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
#define REP(i, n) for(int i = 1; i <= n; i++)
#define ll long long
using namespace std;

int keta(int n) {
    int res;
    for(int i = 0; i < 100; i++) {
        n = n / 10;

        if(n == 0) {
            res = i + 1;
            break;
        }
    }
    return res;
}

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


Compiler output:
a.cc: In function 'int main()':
a.cc:30:16: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   30 |         cout<-1<<endl;
      |              ~~^~~~~~
Language: C

#include"bits/stdc++.h"
#include <ext/pb_ds/assoc_container.hpp> 
using namespace __gnu_pbds; 
using namespace std;

#define double long double
#define int long long
#define pb push_back 
#define Z(c) (int)(c).size()
#define L(c) c[Z(c)-1]
#define F first
#define S second
#define nl "\n"
#define mii map<int,int> 
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define rep(i,iv,n) for(int (i)=(iv);(i)<(n);++(i))
#define FO fflush(stdout) 
#define D1(x) cerr <<"At line "<<__LINE__<<" "<<#x<<"="<<x<<nl
#define D2(x,y) cerr <<"At line "<<__LINE__<<" "<<#x<<"="<<x<<" "<<#y<<"="<<y<<nl
#define D3(x,y,z) cerr <<"At line "<<__LINE__<<" "<<#x<<"="<<x<<" "<<#y<<"="<<y<<" "<<#z<<"="<<z<<nl
#define tr(it,ct) for(auto &(it) : (ct))
#define pi acos(-1)
#define prt(ct) for(auto &(it) : (ct)) cerr<<it<<" "; cerr<<nl
#define prtp(ct) for(auto &(it) : (ct)) cerr<<it.F<<" "<<it.S<<nl; cerr<<nl

typedef vector< int > vi;
typedef vector< vi > vvi;
typedef pair< int,int > pii;
typedef pair<pii,pii> ppp;
typedef vector< pii > vp;
typedef tree<int, null_type, less<int>, rb_tree_tag, 
             tree_order_statistics_node_update> baap;

void swap(char &a,char &b)
{ auto tm=a; a=b; b=tm; }

void mina(int &a,int b)
{ a=(a<b?a:b); }

void maxa(int &a,int b)
{ a=(a>b?a:b); }

  const int mod=1000000007;
  const int mod2=998244353;
  const int INF=1e18;
  const int N=2e5+25;
  const int M=31;

 
 void doit()
 { 
   int n,m,s=0; cin>>n>>m;
   rep(i,0,m){
     int x; cin>>x; s+=x;
   }

   cout<<max(-1LL,n-s);
   
 }

signed main()
{ 
   ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

   int tc=1;                         
 //  cin>>tc;

  rep(i,1,tc+1)
  { // cout<<"Case #"<<i<<": ";
    
   doit();
   if(i<tc)
   cout<<nl;
  }
 

 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>

using namespace std;

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

	int n, m;

	cin >> n >> m;

	while(m--){
        int x;

        cin >> x;

        n -= x;
	}

	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>
#define ll long long
#define PI 3,14
using namespace std;

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

using namespace std;

ll n,m,x,sum;

int main()
{
    cin >> n >> m;
    for (int i=0;i<m;i++)
    {
        cin >> x;
        sum+=x;
    }
    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 <bits/stdc++.h>
using namespace std;
typedef long long ll;
// const int INF = 2147483647;
// const ll INF = 9223372036854775807;
// const ll MOD = 1e9 + 7;

ll A[1000];

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

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

	ll ans = N;

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

	cout << max(ans, -1LL) << endl;

	return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
using ll = long long; // ll は long long　と同じとする。(int64_t)
int main(){
    int N , M;
    cin >> N >> M;
    int total = 0;
    vector <int> A(M);
    for(int i = 0; i < M; i++){
        cin >> A.at(i);
        total+=A.at(i);
    }
    if(total > N){
        cout << -1 << endl;
    }
    else{
        cout << N - total << 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 int64_t
#include <cstdlib> 
#include <math.h>
#include<cstdio>
#include<cstring>
#define FOR(I, A, B) for (ll I = (A); I <= (B); I++)
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fo(i,n) for(ll i=0;i<n;i++)
#define sz(a) ll((a).size())
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define tr(c,i) for(auto i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define dbg(x) cout << #x << " = " << x << endl
#define dbg2(x,y) cout << #x << " = " << x << ", " << #y << " = " << y << endl
#define dbg3(x,y,z) cout << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << endl
#define dbg4(x,y,z,q) cout << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << ", " << #q << " = " << q << endl
#define scan(char_array) scanf("%[^\n]s",&char_array);

int main(){
	ll n,m;
	cin>>n>>m;
	ll a[m];
	fo(i,m) cin>>a[i];
	ll suum=0;
	fo(i,m) suum+=a[i];
	if(suum<n){
		cout<<(n-suum)<<endl;
	}
	else{

		if(suum==n) cout<<0<<endl;
		else 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;

 int main(){
     int N,M;cin>>N>>M;
     
     for(int i=0;i<M;i++){
         int a;cin>>a;
         N-=a;
     }
     if(N>=0)cout<<N<<endl;
     else 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 <iostream>
#include <complex>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <cmath>
#include <bitset>
#include <cassert>
#include <queue>
#include <stack>
#include <deque>
#include <random>
typedef long long int ll;
typedef long double ld;
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
const ll MOD=1000000007;
const ll MAX_N=500010;
const ll INF=9999999999;

int main(){
    ll n,m;
    cin>>n>>m;
    for(int i=0;i<m;i++){
        ll a;
        cin>>a;
        n=n-a;
    }
    if(n<0){
        cout<<-1<<endl;
    }else{
        cout<<n<<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>
#define ll long long
#define pb push_back
using namespace std; 
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
  ll n,m;
  cin>>n>>m;
  ll a[m];
  ll sum=0;
  for(ll i=0;i<m;i++)
  {
      cin>>a[i];
      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

/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author champon
 */

#include <iostream>
#include <fstream>
#include <bits/stdc++.h>
#define se cout << "test ok" << endl;
#define sp << " " <<
#define enl "\n"
using namespace std;
using ll=long long;
using ld=long double;
using vi = vector<int>;
using vii = vector<vector<int>>;
using vl = vector<ll>;
using vll = vector<vector<ll>>;
using vlll = vector<vector<vector<ll>>>;
using vc = vector<char>;
using vcc = vector<vector<char>>;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
ll mod = ll(1e9)+7;
ll inf = ll(1e18);
void bl(bool b, ostream& out=cout){ out << (b ? "Yes" : "No") << endl; }
void bl2(bool b, ostream& out=cout){ out << (b ? "YES" : "NO") << endl; }
template<typename T> inline bool chmax(T &a, T b){ if(a<b){a=b; return true;} return false; }
template<typename T> inline bool chmin(T &a, T b){ if(a>b){a=b; return true;} return false; }
int dx[] = {1, 0, -1, 0, 1, -1, 1, -1};
int dy[] = {0, 1, 0, -1, 1, -1, -1, 1};

#ifndef INCLUDE_DEBUG_HPP
#define INCLUDE_DEBUG_HPP

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

namespace dbg {
    using ll = long long;

    class Debug {
    public:
        Debug(){}
        template<typename T>
        void vd(vector<T> vec);
        template<typename T>
        void vd2(vector<vector<T>> vec);
        template<typename T>
        void ad(T *arr, ll n);
        template<typename T, size_t N>
        void ad2(T (&arr)[N], ll n);
        template<typename T>
        void md(T mp);
    };

    template<typename T>
    void Debug::vd(vector<T> vec) {
        for (auto vv : vec) cout << vv << " ";
        cout << endl;
    }

    template<typename T>
    void Debug::vd2(vector<vector<T>> vec) {
        for (auto vv : vec) {
            for (auto vvv : vv) cout << vvv << " ";
            cout << endl;
        }
    }

    template<typename T>
    void Debug::ad(T *arr, ll n) {
        for (int i = 0; i <= n; i++) cout << arr[i] << " ";
        cout << endl;
    }

    template<typename T, size_t N>
    void Debug::ad2(T (&arr)[N], ll n) {
        for (int i = 0; i <= N; i++) for (int j = 0; j <= n; j++) cout << arr[i][j] << " ";
        cout << endl;
    }

    template<typename T>
    void Debug::md(T mp) {
        cout << "key : value" << endl;
        for (auto const &m : mp) cout << m.first << " : " << m.second << endl;
        cout << endl;
    }

}

#endif //INCLUDE_DEBUG_HPP

using dbg::Debug;
Debug debug;

class BHomework {
public:
	void solve(std::istream& in, std::ostream& out) {
	    ll n, m;
	    in >> n >> m;
	    vl a(m);
	    ll sum = 0;
	    for(int i=0; i<m; i++){
	        in >> a[i];
	        sum += a[i];
	    }

        out << n-sum << enl;
	}
};


int main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
	BHomework solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


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

#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <string>
#include <deque>
using namespace std;
using P = pair<int,int>;
typedef long long int ll;
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define PI 3.14159265359
ll gcd(ll a, ll b) {//最大公約数
    if(a<b){
        ll tmp = a;
        a = b;
        b = tmp; 
    }
    if (b==0) return a;
    else return gcd(b, a%b);
}
ll lcm(ll a, ll b) {//最小公倍数
    return a * b / gcd(a, b);
}

int main() {
    int n,m,work=0;
    cin >> n>> m;
    rep(i,m){
        int a;
        cin >> a;
        work+=a;
    }
    int ans = n-work;
    if(ans<0){
        cout << -1 << endl;
    }else{
        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 rep(i, n) for(int i=0; i < n; i++)
#define REP(i, n, m) for(int i=n; i < m; i++)
#define reps(i, n) for(int i=1; i <= n; i++)
#define ALL(v) v.begin(), v.end()
#define rALL(v) v.rbegin(), v.rend()
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)

using namespace std;
using ll=long long;

ll mod=1000000007;

const ll INF = 1LL << 60;

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

int main(){
  int n,m;cin>>n>>m;
  int sum=0;
  rep(i,m){int a;cin>>a;sum+=a;}
  cout<<(sum>n?-1: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>
#define maxn 200001
#define maxa 2000005
#define MOD  998244353 //1000000007
#define INF 1000000000000000000

using namespace std;

#define int int64_t
#define ll long long
#define pii pair<ll, ll>
#define piii pair<pii, ll>
#define ft first
#define sd second
#define pb push_back
#define rep(i, n) for(ll i = 0; i < n; i++)
#define repr(i, n) for(ll i = n-1; i >= 0; i--)
#define mem(a, b) memset(a, b, sizeof(a))
#define all(v) v.begin(), v.end()
#define edge(v, x, y) v[x].pb(y); v[y].pb(x);
#define popcount __builtin_popcount

void fast(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout << setprecision(10) << fixed;
}
ll ceil(ll a, ll b){ return (a+ b-1)/b; }
void flaged(bool flag){
    if(flag) cout << "Yes\n";
    else cout << "No\n";
}
// power and modulo inverse
ll power(ll a, ll b = MOD-2){
    if(b == 0) return 1;
    ll r = power(a, b/2);
    r = (r*r)%MOD;
    if(b%2 == 1) r = (r*a)%MOD;
    return r;
}
// factorial
ll fact[maxa], finv[maxa];
void calf(){
    fact[0] = finv[0] = 1;
    for(ll i = 1; i < maxa; i++){fact[i] = (fact[i-1]*i) %MOD;finv[i] = (finv[i-1]*power(i))%MOD;}
}
// nCr
ll ncr(ll N, ll R){ if(R > N) return 0; return (fact[N]*((finv[R]*finv[N-R])%MOD))%MOD;}



void solve(){
    ll n, m;
    cin >> n >> m;
    ll s = 0, x;
    for(ll i = 0; i < m; i++){
    cin >> x;
    s += x;
    }
    if(s > n)cout << "-1";
    else cout << n-s;
}

main(){
    ll 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

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

int main(){
    int N, M;
    scanf("%d %d", &N, &M);

    int sum=0;
    for(int i=0; i<M; i++){
        int tmp;
        scanf("%d", &tmp);

        sum += tmp;
    }

    if(sum > N)printf("-1");
    else printf("%d", N-sum);
}

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

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

int main() {
 #include <bits/stdc++.h>
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];
    sort(A.begin(), A.end());
    ll sum = 0;
    for(int i = 0; i < M; i++) {
        sum += A[i];
    }

    if(sum > N) { cout << -1 << endl; }
    
    cout << sum;
    return 0;
}

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   10 | int main() {
      |         ^~
a.cc:10:9: note: remove parentheses to default-initialize a variable
   10 | int main() {
      |         ^~
      |         --
a.cc:10:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:10:12: error: a function-definition is not allowed here before '{' token
   10 | int main() {
      |            ^
Language: C++

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

#define ll long long
#define ull unsigned ll

#define vi vector <int>
#define ii pair <int, int>
#define vii vector <ii>
#define vll vector <ll>
#define vull vector <ull>
#define INFL 9e18
#define INF 2e9
#define EPS 1e-9
#define pb push_back
#define emp emplace_back
#define PI acos(-1.0)
#define endl "\n"
#define mp make_pair
#define DEBUG 0

int main ()

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

    int n, r;
    vi num(r);
    int sum = 0;
    for (int i=0; i<r; i++)
    {
    	cin >> x;
    }
    
    if (sum > n)
    {
    	cout << -1 << endl;
    	return 0;
    }
    
    else cout << n - sum << endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:16: error: 'x' was not declared in this scope
   34 |         cin >> x;
      |                ^
Language: C

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

int main()
{
    int N, M;
    cin >> N >> M;
    vector<int> A(M);
    int sum = 0;
    for (int i=0; i< M; i++) {
        int a;
        cin >> a;
        sum += a;
    }
    int nokori = N - sum;
    if (nokori < 0) cout << -1 << endl;
    else cout << nokori << 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 <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include <functional>
#include <iomanip>
#include <bitset>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
const long long mod = 1000000007;
typedef long long ll;

int main() {

	long double r;
	cin >> r;

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

	return 0;
}


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

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

using namespace std;
using ll = long long;

ll N2;
int N;
int M;
int A;
int main() {
    cin >> N >> M;
    for (int i = 0; i < M; i++) {
        cin >> A;
        N = N - A;
        if (N - A <= 0) {
            cout << "-1";
            return;
        }
    }
    cout << N;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:13: error: return-statement with no value, in function returning 'int' [-fpermissive]
   18 |             return;
      |             ^~~~~~
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);
  rep(i, m) cin >> a[i];

  int ans = n;
  rep(i, m) ans -= a[i];

  if (ans < 0) {
    cout << -1 << endl;
  } else {
    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>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;

int main() {
  int N, M;
  cin >> N >> M;
  rep(i, M) {
    int a;
    cin >> a;
    N -= a;
  }
  cout << max(-1, N) << 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 < (ll)(n); ++i)
#define repk(i,k,n) for (ll i = k; i < (ll)(n); ++i)
#define MAX 500000001000000000
#define MOD 1000000007
typedef long long  ll;

using namespace std;

int ans, cnt;

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

	int N,M;
	cin >> N >> M;

	vector<int>A(M);
	int sum = 0;
	rep(i, M) {
		cin >> A[i];
		sum += A[i];
	}

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


	cout << ans << 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 <cstring>
#include <cmath>
#include <algorithm>
#include <string>
#include <iostream>
#include <vector>
#include <queue>
#include <unordered_map>
#include <random>
#include <stack>
#include <set>
#include <unordered_set>

#define bug(x) cout<<"zdongdebug1: "<<x<<endl;
#define bug2(x, y) cout<<"zdongdebug2: "<<x<<" "<<y<<endl;
#define bug3(x, y, z) cout<<"zdongdebug3: "<<x<<" "<<y<<" "<<z<<endl;
using namespace std;
typedef long long ll;
const int maxn = 100005;
const int mod = 1000000007;


int main() {
#ifdef suiyuan2009
  freopen("/Users/suiyuan2009/CLionProjects/icpc/input.txt", "r", stdin);
  //freopen("/Users/suiyuan2009/CLionProjects/icpc/output.txt", "w", stdout);
#endif
  int n,m;
  cin>>n>>m;
  ll s = 0;
  for(int i=0;i<m;i++){
    int x;
    cin>>x;
    s+=x;
  }
  if(s>n)cout<<-1<<endl;
  else cout<<n-s<<endl;
  return 0;
}

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

#include <bits/stdc++.h>

#define rep(l, r) for (int i = (l); i < (r); i++)

typedef long long ll;
 
using namespace std;

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

    int a;
    int sum = 0;
    rep(0, m) {
        cin >> a;
        sum += a;
    }

    if (sum <= n) {
        cout << (n - sum);
    } else {
        cout << -1;
    }
    cout << 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;
using LL = long long;

constexpr int N = 1e5 + 5;

int main() {
	ios::sync_with_stdio(false); cin.tie(nullptr);
	
	int n, m;
	cin >> n >> m;

	vector< int> in(m);
	for (int &e : in) cin >> e;

	int s = accumulate(begin(in), end(in), 0);

	cout << max(-1, n - s) << 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;


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

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

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<stack>
#include<queue>
#include<set>
#include<tuple>
#include<ctime>
#include<functional>
#include<cmath>
#include<cassert>
using namespace std;
typedef long long ll;

#define rep(i,n) for(ll i=0;i<(n);i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define ALL(v) (v).begin(), (v).end()
#define p(s) cout<<(s)<<endl
#define p2(s, t) cout << (s) << " " << (t) << endl
#define br() p("")
#define pn(s) cout << (#s) << " " << (s) << endl
#define p_yes() p("Yes")
#define p_no() p("No")
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))

const ll mod = 1e9 + 7;
const ll inf = 1e18;
int main(){
    int N,M,a[10000],sum;
    cin>>N>>M;
    rep(i,M) cin>>a[i];
    rep(i,M) sum+=a[i];
    if(N>=sum) p(N-sum);
    else p (-1);
}

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<cstdlib>
#include<cmath>
#include<queue>
#include<string>
#include<cstring>
#include<algorithm>
#include<set>
#include<map>
#include<iomanip>

#define REP(i,n) for(int i=0;i<(n);i++)
#define EPS (1e-7)
#define INF (2e9)
// cout << setprecision(10)

using namespace std;
typedef long long int ll;

int N, M;
int A, T;
int main(void){
    cin >> N >> M;
    REP(i,M) {
        cin >> A;
        T += A;
    }
    cout << max(-1, N - T) << endl;
    return 0;
}



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

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MOD 1000000007
#define INF 1LL<<30
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()

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

    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> a(m);
  	for(int i = 0; i < m; i++)
    {
    	cin >> a.at(i)
    }
  	int sum = 0;
  	for(int i = 0; i < m; i++)
    {
    	sum += a.at(i);
    }
  	if(n >= sum)
    {
    	cout << n - sum << endl;
    }
  	else
    {
    	cout << -1 << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:23: error: expected ';' before '}' token
   11 |         cin >> a.at(i)
      |                       ^
      |                       ;
   12 |     }
      |     ~
Language: C

//g++ -std=gnu++14 a.cpp
#include <bits/stdc++.h>
/*
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <iostream>
#include <istream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <tuple>
#include <iomanip>
#include <random>
#include <math.h>
*/


using namespace std;

#define ll long long
#define rep(i, n) for(ll i = 0; i < (n); i++)
ll MOD = 1e9 + 7;
int INF = 1 << 30;
ll INFL = 1LL << 60;

int main(){
  int N,M;
  cin >> N >> M;
  vector<int> h(M);
  rep(i,M) cin >> h.at(i);
  int sum = 0;
  rep(i,M){
    sum += h[i];
  }
  if(sum <= N){
    cout << N-sum << endl;
  }else{
    cout << -1 << endl;
  }
}


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

#include <iostream>
#include <ios>
#include <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <utility>
#include <typeinfo>
#include <tuple>
using namespace std;

#define MOD 1000000007
#define INF 1e9+7
#define INF_LONG 1e18
#define rep(i, n) for(int i=0; i<n; ++i)
#define rep1(i, n) for(int i=1; i<=n; ++i)
#define rrep(i, m, n) for(int i=m; i<n; ++i)
#define countof(array) (sizeof(array) / sizeof(array[0]))
typedef long long ll;

#define MAX_N 200000
#define MAX_M 100000
#define MAX_V 100
#define MAX_E 100
#define MAX_Q 100000

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

int ddx[] = {-1, 0, 1, 0, -1, 1, -1, 1};
int ddy[] = {0, -1, 0, 1, 1, 1, -1, -1};

string as = {"ABCDEFGHIJKLMNOPQRSTUVWXYZ"};
string ab = {"abcdefghijklmnopqrstuvwxyz"};

ll gcd(ll x, ll y) {
  if(y==0) return x;
  else return gcd(y, x%y);
}

ll lcm(ll x, ll y) {
  return (x*y)/gcd(x, y);
}

void yes() {
  cout << "Yes" << endl;
}

void no() {
  cout << "No" << endl;
}

void print_array(int array[], int len) {

  for(int i=0; i<len; ++i) {
    cout << array[i] << endl;
  }

}

ll absolute(ll x) {
  return (x<0)? (-1)*x : x;
}

//g++ AtCoder.cpp -o AtCoder
//AtCoder

//--------------------------

int main() {

  ll n, m;
  cin >> n >> m;
  ll a[m];
  rep(i, m) {
    cin >> a[i];
    n-=a[i];
  }

  if(n>=0) cout << n << endl;
  else cout << -1 << 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>
#define _GLIBCXX_DEBUG
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(),v.end()
#define puts(i) cout << i << endl
#define INF INT_MAX;
#define INFL LLONG_MAX;
typedef long long ll;
using namespace std;

int main(){
  int n,m; cin >> n >> m;
  int sum =0;
  rep(i,m){
    int x; cin >> x;
    sum+=x;
  }
  if(sum>n) puts("-1");
  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

    //Bismillah hirrahmanir Rahim
    #include<bits/stdc++.h>
    #define ll long long
    #define pb push_back
    #define dbug printf("I am here\n");
    #define Fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
  using namespace std;
int main() {
    ll int tst,n,x;
  cin>>n>>tst;
  while(tst--){
cin>>x;
n-=x;
  }
  if(n>-1)cout<<n<<endl;
  else cout<<"-1"<<endl;
    return 0;
  }


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

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

int main(void){
    int N, M; cin >> N >> M;
    int A[M]; for(int i = 0; i < M; i++) cin >> A[i];
    
    int sum_A = 0;
    for(int i = 0; i < M; i++){
        sum_A += A[i];
    }
    
    cout << max(-1, N - sum_A) << 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()
{
    int n,m;
    cin>>n>>m;
    int a[m];
    int sum=0;
    for(int i=0;i<m;i++)
    	{cin>>a[i];
    		sum=sum+a[i];
    	}

    	if(n-sum>=0)
    		cout<<n-sum<<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>
#define fi first
#define se second
#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define rrep(i, n) for (int (i) = 1; (i) <= (n); (i++))
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define pb push_back
#define eb emplace_back
#define yn {puts("Yes");}else {puts("No");}
#define printd(x) printf("%.12f\n", x);
template<class T> bool chmin(T& a, const T& b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> bool chmax(T& a, const T& b) {if (a < b) {a = b; return 1;} return 0;}
using namespace std;
using ll = long long;
using P = pair<int, int>;


int main() {
	int n, m;
	cin >> n >> m;
	int sum = 0;
	rep (i, m) {
		int a;
		cin >> a;
		sum += a;
	}
	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<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
#define ll long long
#define ld long double
#define MAX 1000000000
int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	int t=1;
	//cin>>t;
	for(int cc=1;cc<=t;cc++){
        //cout<<"Case #"<<cc<<": ";
        ll n,m,ans=0;
        cin>>n>>m;
        ll a[m];
        for(int i=0;i<m;i++)
        	cin>>a[i],ans+=a[i];
        cout<<max(-1LL,n-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<bits/stdc++.h>
using namespace std;

int main(){
    int N,M;
    cin >> N >> M;
    vector<int> A(M);
    for(int i=0; i<M; ++i) cin >> A.at(i);

    int sum = 0;
    for(int i=0; i<M; ++i) sum += A.at(i);
    if(N >= sum) cout << N - sum << 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>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> ii;
typedef tuple<ll, ll, ll> iii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
#define REP(i,n) for (ll i = 0; i < n; ++i)
#define REPR(i,n) for (ll i = n-1; i >= 0; --i)
#define FOR(i,m,n) for (ll i = m; i < n; ++i)
#define FORR(i,m,n) for (ll i = n-1; i >= m; --i)
#define FORE(x,xs) for (const auto& x : xs)
#define FORI(i,v) for (auto i = v.begin(); i != v.end(); i++)
#define ALL(v) v.begin(), v.end()
#define CHMIN(x,y) x = min(x, y)
#define CHMAX(x,y) x = max(x, y)
#define YES(b) cout << ((b) ? "YES" : "NO") << endl
#define Yes(b) cout << ((b) ? "Yes" : "No") << endl
#define DOUBLE(d) cout << fixed << setprecision(15) << (d) << endl

const int MAX = 1e4+10;

int N, M;
int A[MAX];

int main() {
    cin >> N >> M;
    REP (i, M) cin >> A[i];
    ll s = 0;
    REP (i, M) s += A[i];
    cout << max(-1ll, N-s) << 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 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;
  cin >> n >> m;
  int sum = 0;
  rep(i,m)
    cin >> a;
    sum = sum + a;
  if(n-sum>=0)
    cout << n-sum << endl;
  if(n-sum<0)
    cout << -1 << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:12: error: 'a' was not declared in this scope
   12 |     cin >> a;
      |            ^
a.cc:13:17: error: 'a' was not declared in this scope
   13 |     sum = sum + a;
      |                 ^
Language: C

#include <iostream>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);

#define ull unsigned long long int
#define ll long long int
#define ld double
#define ui unsigned int
#define pb push_back
#define mp make_pair
#define ff first
#define ss second 

#define fr(i,a,b) for (int i = (a), _b = (b); i <= _b; i++)
#define frr(i,a,b) for (int i = (a), _b = (b); i >= _b; i--)
#define rep(i,n) for (int i = 0, _n = (n); i < _n; i++)
#define repr(i,n) for (long long i = (n) - 1; i >= 0; i--)


ll gcd(ll a, ll b) 
{ 
    if (a == 0) return b; 
    return gcd(b % a, a); 
} 

int main(){
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);      
    #endif
    fastio;

    ll t; t=1;
    while(t--){
        ll n,m; cin>>n>>m;
        ll a[m];
        ll sum=0;
        rep(i,m){
            cin>>a[i];
            sum+=a[i];
        }
        if(n-sum<0) cout<<-1;
        else cout<<n-sum;
    }
    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>
using namespace std;

int main() {
    int N, M;
    cin >> N >> M;
    vector<int> A(M);
    for(int i = 0; i < M; i++) {
        cin >> A[i];
    }
    long long int sum = 0;
    for(int i = 0; i < M; i++) {
        sum += A[i];
    }
    int ans = N - 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 <bits/stdc++.h>
#include <algorithm>
#include <math.h>
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
#define INF 999999999
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

using llong = long long;
using namespace std;


int main(){
    llong n,m,a,sum=0,ans;
    cin >> n >> m;
    rep(i,m){
        cin >> a;
        sum += a;
    }
    ans = n-sum;
    if(ans >= 0){
        cout << ans << endl;
    }else{
        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;
int main(){
   long long n, m, i, a[100100], sum=0, ans=0;
   cin >> n >> m;
   for(i=0;i<m;i++){
      cin >> a[i];
      sum+=a[i];
   }
   ans=n-sum;
   if(ans<0) cout << -1 <<endl;
   else cout << ans <<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

n,m=map(int,input().split())
a=list(map(int,input().split()))
x=n-sum(a)
if x>=0:
  print(str(x))
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: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

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

namespace cysharp_test
{
    class Program
    {
        static void Main (string[] args)
        {
            new Program ().solve ();
        }

        void solve ()
        {
            int[] NM = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();

            int N = NM[0];
            int M = NM[1];

            int[] A = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();

            if(N - A.Sum() >= 0)Console.WriteLine(N - A.Sum());
            else Console.WriteLine("-1");
        }

    }

    class Vector2
    {
        public Vector2 (long x, long y)
        {
            this.x = x;
            this.y = y;
        }

        long x, y;

        public static Vector2 operator + (Vector2 a, Vector2 b)
        {
            return new Vector2 (a.x + b.x, a.y + b.y);
        }

        public static Vector2 operator - (Vector2 a, Vector2 b)
        {
            return new Vector2 (a.x - b.x, a.y - b.y);
        }

        public static Vector2 operator * (Vector2 a, long scala)
        {
            return new Vector2 (a.x * scala, a.y + scala);
        }
    }
}

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.Collections;
      | ^~~~~
main.c:2:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | using System.Collections;
      |             ^
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:4:1: error: unknown type name 'using'
    4 | using System.Linq;
      | ^~~~~
main.c:4:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    4 | using System.Linq;
      |             ^
main.c:6:1: error: unknown type name 'namespace'
    6 | namespace cysharp_test
      | ^~~~~~~~~
main.c:7:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    7 | {
      | ^
Language: C

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n) for (int i=1; i < (int)(n); i++)
#define rrep(i, n) for (int i=((int)(n)-1); i>=0; i--)
#define rreps(i, n) for (int i=((int)(n)-1); i>0; i--)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
using namespace std;
using lint = long long;
using p = pair<int, int>;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main() {
  int N, M; cin >> N >> M;
  vector<int> a(N);
  rep (i, M) cin >> a[i];
  int ans = -1;
  int sum = 0;
  sum = accumulate(ALL(a),sum);
  chmax(ans, N - sum);
  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 <iostream>
#include <vector>
#include <algorithm>
using namespace std;

typedef long long ll;

const int INF = 1e9;

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 (N < sum) cout << -1 << "\n";
    else cout << N - sum << "\n";

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

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

    int n, m;
    cin >> n >> m;

    int sum = 0;
    while(m--) {
        int a;
        cin >> a;
        sum += a;
    }

    int ans = n >= sum ? n - sum : -1;
    cout << 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

N, M = map(int, input().split())
for x in input().split(): N -= int(x)
print(max(N, -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 'for'
    2 | for x in input().split(): N -= int(x)
      | ^~~