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

#pragma GCC optimize("Ofast") 

////////////////////////////////////////////////////////////////////////////////

#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define endl "\n"
#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#define bew ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define all(x) x.begin(),x.end()
#define pb push_back
#define fi first
#define se second
#define mod (long)(1e9+7)
#define ip(ar,n) for(int i=0;i<n;++i)cin>>ar[i];
#define op(ar,n) for(int i=0;i<n;++i)cout<<ar[i]<<" ";
#define print(...) for(auto xas:{__VA_ARGS__})cerr<<xas<<" ";
#define test int t;cin>>t;while(t--)
#define tar(x) int x;cin>>x;
#define fil(ar,val) memset(ar,val,sizeof ar)
#define loop(n) for(int i=0;i<n;++i)
#define coutd(x,y) printf("%0.y lf",x);

////////////////////////////////////////////////////////////////////////////////

typedef vector<int> vec; 
typedef pair<int, int> pa; 
typedef vector<pa> vecp; 
typedef set<int> se;
typedef map<int,int> ma;

////////////////////////////////////////////////////////////////////////////////


bool isprime(int n)
{
    if(n<=1)
        return false;
    for(int i=2;i*i<=n;++i)
    if(n%i==0)
        return false;
    return true;
}

int expo(int a,int n)
{
    if(n==0)
        return 1;
    if(n==1)
        return a;
    int tmp=expo(a,n/2);
    tmp=(tmp*tmp)%mod;
    if(n&1)
        tmp=(tmp*a)%mod;
    return tmp;
}


////////////////////////////////////////////////////////////////////////////////



signed main() {
bew;
    tar(n);
    tar(m);
    vec ar(m);
    ip(ar,m);
    
    int x=accumulate(all(ar),0);
    if(n-x<0)
    cout<<-1;
    else
    cout<<n-x;



return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, a, b) for(ll i=(a); i<(b); i++)
#define PER(i, a, b) for(ll i=(a); i>=(b); i--)
#define rep(i, n) REP(i, 0, n)
#define per(i, n) PER(i, n, 0)
const ll INF = 1e18+18;
const ll MAX = 200000;
const ll MOD = 1000000007;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define YES(n) cout << ((n) ? "YES" : "NO") << endl;

int main(){
    ll N, M;
    cin>>N>>M;
    vector<ll> A(M);
    ll Sum=0;
    rep(i, M){
        cin>>A[i];
        Sum+=A[i];
    }
    if(N-Sum>=0){
        cout<<N-Sum<<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++

/**
* Author : zzy
* Date : 2020-04-19-20.05.46 Sunday
*/
#include <bits/stdc++.h>

#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, a, b) for (int i = (int)(a); i >= (int)b; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)
#define rep(i, l, r) for (int i = (l); i <= (r); i++)
#define per(i, r, l) for (int i = (r); i >= (l); i--)
#define ms(x, y) memset(x, y, sizeof(x))
#define SZ(x) ((int)(x).size())

using namespace std;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef double ld;

template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }

int n, m;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.precision(10);
    cout << fixed;
#ifdef LOCAL_DEFINE
    freopen("input.txt", "r", stdin);
#endif

    cin >> n >> m;
    vi a(m);
    forn(i, m) cin >> a[i];
    int sum = *accumulate(all(a), 0);
    if (sum > n) cout << -1 << '\n';
    else cout << n-sum << '\n';

#ifdef LOCAL_DEFINE
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:53:15: error: invalid type argument of unary '*' (have 'int')
   53 |     int sum = *accumulate(all(a), 0);
      |               ^~~~~~~~~~~~~~~~~~~~~~
Language: C

#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<cstdlib>  
#include<cmath>   
#include<cctype>
#include<string>
#include<set>
#include<iomanip>
#include<map>
#include<algorithm>
#include<functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include<list>
#include<deque>
#include<climits>
#include<typeinfo>
#include<utility>
#define LEN 100005
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,n) for(ll i=0;i<n;i++)
#define For(i,m,n) for(int i=m;i<n;i++)
#define FOR(i,m,n) for(ll i=m;i<n;i++)
using namespace std;
using ll = long long;
double pi() { return 3.14; }
int sum(int a, int b) { return a + b; }
int mul(int a, int b) { return a * b; }
ll LGCD(ll x, ll y) { if (x % y == 0) return y;else return LGCD(y, x % y); }
ll LLCM(ll x, ll y) { return x * y / LGCD(x, y); }

int GCD(int x, int y) { if (x % y == 0) return y;else return GCD(y, x % y); }
int LCM(int x, int y) { return x * y / GCD(x, y); }
ll dpc[10000][10000];

//void nCr(ll n, ll r) {
//	ll ans = 1;
//	for (int i = n; i > n - r; --i) {
//		ans = ans * i;
//	}
//	for (int i = 1; i < r + 1; ++i) {
//		ans = ans / i;
//	}
//	printf("%d",ans);
//}

ll combination(ll n, ll r) {
	if (n == r) { return dpc[n][n] = 1; }
	else if (r == 0) { return dpc[n][0] = 1; }
	else if (r == 1) { return dpc[n][1] = n; }
	else if (dpc[n][r]) { return dpc[n][r]; }
	else { return dpc[n][r] = combination(n - 1, r - 1) + combination(n - 1, r); }
}

//cout << fixed << setprecision(10);


int main() {

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

int main(){
	// sengen
	long long n,m;
	// nyuryoku
	cin >> n >> m;
	long long a[m];
	long long sum=0;
	for(int i=0;i<m;i++){
		cin >> a[i];
		sum += a[i];
	}
	// keisan
	if(sum <= n;){
		cout << n - sum;
	}else{
		cout << "-1";
	}
	// syutsuryoku
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:21: error: expected primary-expression before ')' token
   17 |         if(sum <= n;){
      |                     ^
Language: C

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

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

    int ans = n - sum;

    if (sum < 0)
        sum = -1;

    cout << sum;
}

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

#include<bits/stdc++.h>
using namespace std;
int main(){
   long long  int n;
    cin>>n;
   long long  int m;
    cin>>m;
   long long  int a[m];
   long long  int sum=0;
    for(long long int i=0;i<m;i++){
    	cin>>a[i];
    	sum+=a[i];
    }
    if(sum>n){
    	cout<<"-1";
    	return 0;
    }
    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 forr(i, a, b) for(int i = (a); i < (b); i++)
#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = 1; i <= (n); i++)
#define ALL(a) (a.begin()),(a.end())
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll, ll> LP;
const ll LINF = 1LL<<60;
const int INF = 1001001001;
const int MOD = 1000000007;

/* --------------------------------------------------- */


int main() {
    int n, m;
    cin >> n >> m;
    int sum = 0;
    rep(i, m) {
        int a;
        cin >> a;
        sum += a;
    }
    n -= sum;
    if(n < 0) cout << -1 << endl;
    else cout << n << 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>
#define _GLIBCXX_DEBUG
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define Sort(a) sort(a.begin(), a.end())
#define Rev(a) reverse(a.begin(), a.end())
typedef long long ll;
const ll MOD = 1e9+7;

/*ll gcd(ll a, ll b){
  if(b==0) return a;
  return gcd(b, a%b);
}*/
/*ll myPow(ll x, ll n, ll m){
  if(n == 0)
    return 1;
  if(n % 2 == 0)
    return myPow(x * x % m, n / 2, m);
  else
    return x * myPow(x, n - 1, m) % m;
}*/

/*ll lcm(ll a, ll b){
  ll g = gcd(a, b);
  b /= g;
  a *= b;
  return a;
}*/

/*int dfs(vector<int> &T, vector<int> &C, int i, int sum, int g, int count){
   
}*/

int main(){
  /*double r;
  cin >> r;
  const double PI=3.14159265358979323846;
  printf("%lf\n", 2*r*PI);*/
  int n, m;
  cin >> n >> m;
  //vector<int> A(m);
  int sum = 0, a; 
  rep(i, m){
    cin >> a;
    sum+=a;
  }
  if(sum<=n) cout << n-sum << 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;

#define intt long long
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

const int N = 10005;

int n, m;
int a[N];

int main() {

	FAST;

	cin >> n >> m;
	int sum = 0;
	for (int i = 1; i <= m; i ++) {
		cin >> a[i];
		sum += a[i];
	}
	cout << ((n - sum < 0) ? -1 : (n - sum)) << '\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())
K=input().split()
s=[]
for i in K:
    s.append(int(i))
if N-sum(s)>=0:
    print(N-sum(s))
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 'K'
    2 | K=input().split()
      | ^
Language: C

#include <iostream>
using namespace std;

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

    int sum = 0;
    for (int i = 0; i < m; ++i)
    {
        cin >> x;
        sum += x;
    }
    if (sum <= n)
        cout << n - sum << 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 <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REP1(i,n) for(int i = 1; i < n+1 ;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()
#define SZ(x) ((int)(x).size())
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))
using namespace std;
typedef long long ll;
using p = pair<int, int>;
using P = pair<ll, ll>;
using V = vector<int>;
using VV = vector<vector<int>>;
using VVV = vector<vector<vector<int>>>;
using VL = vector<ll>;
using VVL = vector<vector<ll>>;
using VVVL = vector<vector<vector<ll>>>;
using Graph = VV;


int main(){
    ios::sync_with_stdio(false); cin.tie(0);
    int n,m;
    V a(m);ll sum =0;
    cin >> n >> m;
    REP(i,m){ cin >> a[i];
    sum+=a[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;
typedef	long long ll;

// int/long:		-2,147,483,648 - 2,147,483,647 (-2^31 <= int < 2^31)
// long/long long:	-9,223,372,036,854,775,808 - 9,223,372,036,854,775,807 (-2^63 <= long < 2^63)

#define	INF (1<<30)
//1,073,741,824
//= 536,870,912 *2

#define	MOD 1000000007

#define	Rep0(i, n)	for (int i=0; i<n; i++)
#define	Rep1(i, n)	for (int i=1; i<=n; i++)
#define Sort(P)	sort(P.begin(), P.end())
#define Rev(P)	reverse(P.begin(), P.end())

// lower_bound(A.begin(), A.end(), N)
// upper_bound(...

// A.erase(unique(A.begin(), A.end()), A.end())

// bit: &/and, |/or, ^/xor, ~/not

// getline(cin, String)
// while (getline(cin, S)) {}

// #include <cstdio>
// int a; ll B;
// scanf("%d %lld", &a, &B);
// printf("%d\n", a);
//
// for (int i=0; i<n; ++i)
// 	scanf("%d", &a[i]);
//
// char c;
// scanf(" %c", &c);
//
// cout << "\n";

// cout <<fixed <<setprecision(10)

// priority_queue<int> q;
// priority_queue<int, vector<int>, less<int>> q; // Default: vector, less
// priority_queue<vector<int>, vector<vector<int>>, greater<vector<int>>> q;

// Graph
// Warshall-Floyd: Distance between each node, N^3
// Dijkstra: Distance from the start node, N^2
// DFS(Depth-First Search)

//
// Notes
//
// When specified less than N, try full scan.
// RE: empty vector
// Check Qs
// long/int
// xor -> count each bit
// Check values
// 	1,000,000 -> Loop
// 	100,000	-> vector(int:400KB, long:800KB) 

/*
ll	myPow(ll x, ll n) {
	if (0==n)
		return 1;
	if (0==n%2)
		return myPow(x*x%MOD, n/2);
	else
		return x*myPow(x, n-1)%MOD;
}
*/
ll	myPow(ll x, ll n) {
	ll r=1;
	while(n>0)
		if (0==n%2) {
			x *=x;
			x %=MOD;
			n /=2;
		} else {
			r *=x;
			r %=MOD;
			n--;
		}
	return r;
}

int	main() {
	ll N, M;
	cin >>N >>M;
	vector<ll> A(M, 0);
	Rep0(i, M)
		cin >>A.at(i);
	for (auto AA: A)
		N -=AA;
	if (N<0)
		cout <<-1 <<endl;
	else
		cout <<N <<endl;
	return 0;
}



Compiler output:
main.c:1:17: 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;
using pint = pair<ll, ll>;

int main(int argc, char **argv)
{
	ll N, M; cin >> N >> M;
	vector<ll> A(M);
	for (ll i = 0; i < M; ++i) cin >> A[i];
	if (N - accumulate(A.begin(), A.end(), 0ll) >= 0)
		std::cout << (N - accumulate(A.begin(), A.end(), 0ll))<< std::endl;
	else
		std::cout << -1 << std::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 lli long long int
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define fr(i,n) for(i=0;i<n;i++)
#define F first
#define S second
#define fast std::ios_base::sync_with_stdio(false)
#define mod 1000000007
#define pi 3.14159265
int main() {
	fast;
	lli n,m;
	cin>>n>>m;
	lli a[m],i,sum=0;
	fr(i,m)
	{
		cin>>a[i];
		sum+=a[i];
	}
	if(sum>n)
	{
		cout<<"-1";
	}
	else
		cout<<n-sum;
 
	return 0;
}
 #include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define fr(i,n) for(i=0;i<n;i++)
#define F first
#define S second
#define fast std::ios_base::sync_with_stdio(false)
#define mod 1000000007
#define pi 3.14159265
int main() {
	fast;
	lli n,m;
	cin>>n>>m;
	lli a[m],i,sum=0;
	fr(i,m)
	{
		cin>>a[i];
		sum+=a[i];
	}
	if(sum>n)
	{
		cout<<"-1";
	}
	else
		cout<<n-sum;

	return 0;

Compiler output:
a.cc:42:5: error: redefinition of 'int main()'
   42 | int main() {
      |     ^~~~
a.cc:12:5: note: 'int main()' previously defined here
   12 | int main() {
      |     ^~~~
a.cc: In function 'int main()':
a.cc:59:18: error: expected '}' at end of input
   59 |         return 0;
      |                  ^
a.cc:42:12: note: to match this '{'
   42 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdlib>
using namespace std;
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+=A[i];
  }
  if(sum>N){
    cout << "-1";
  }
  else{
    cout << N-sum;
  }
  cout << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: expected ';' before '<' token
   12 |   for(int i=0,i<M,i++){
      |                ^
      |                ;
a.cc:12:16: error: expected primary-expression before '<' token
a.cc:12:22: error: expected ';' before ')' token
   12 |   for(int i=0,i<M,i++){
      |                      ^
      |                      ;
Language: C

#include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i<(int)(n); i++)
#define all(v) v.begin(), v.end()
#define PRINT(v) for (auto x : (V)) cout <<x <<" " <<endl;
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll MOD = 1000000007;
const ll INF = 10000000000000000;
vector<int> x4 = {0, 1, 0, -1}, x8 = {0, 1, 1, 1, 0, -1, -1, -1};
vector<int> y4 = {1, 0, -1, 0}, y8 = {1, 1, 0, -1, -1, -1, 0, 1};
template<class T> struct edge { int from, to; T cost;};
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;}
template<class T> inline T powerM(T a,T b){if (b==0) return 1;
T tmp = powerM(a,b/2); if (b%2==0) return tmp*tmp%MOD; else return tmp*tmp%MOD*a%MOD; }
template<class T> inline T power(T a,T b,T m){ if (b==0) return 1;
  T tmp = power(a,b/2,m); if (b%2==0) return tmp*tmp%m; else return tmp*tmp%m*a%m; }
template<class T> inline T gcd(T a, T b){if (b==0) return a; return gcd(b, a%b);}
template<class T> inline T lcm(T a, T b){return a / gcd(a,b) * b;}
// ax+by=gcd(a,b)を解く
template<class T> inline T extgcd(T a,T b,T &x,T &y){if (b==0){x=1; y=0; return a;} T d=extgcd(b,a%b,y,x); y -= a/b*x; return d;}
void hey(){ cout <<"hey" <<endl; }


int main() {
  int N,M; cin >>N >>M;
  rep(i, M){ int a; cin >>a; N -= a;}
  cout <<(N >= 0 ? N : -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<cmath>
#include<algorithm>
#include<vector>

using namespace std;

int main(){

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

    long long int a[m];
    for(int i=0;i<m;i++)cin >> a[i];

    for(int i=0;i<m;i++)n -= a[i];


    if(n>=0)cout << n << endl;
    else cout << -1 << endl;
}

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

#include<map>
#include<set>
#include<cmath>
#include<stack>
#include<queue>
#include<deque>
#include<ctime>
#include<vector>
#include<bitset>
#include<string>
#include<cstdio>
#include<numeric>
#include<utility>
#include<sstream>
#include<cstdlib>
#include<iomanip>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<functional>
#include<unordered_map>
#define _USE_MATH_DEFINES
#define inf 999999999999999999
#define rep(i,n,m) for(lli i=(lli)(n);i<(lli)(m);++i)
#define reep(i,n,m) for(int i=(int)(n);i<=(int)(m);++i)
#define per(i,m,n) for(lli i=(int)(m)-1;i>=(int)(n);--i)
#define st(n) sort(n.begin(), n.end())
#define rev(n) reverse(n.begin(),n.end())
#define ou(S) cout << S << endl
#define pb(n) push_back(n)
#define ue(N) N.erase(unique(N.begin(),N.end()),N.end());
#define nou(S) cout << S
#define hou(S) cout << setprecision(30) << S << endl
#define vec(K,L,N,S) vector<L> K(N,S)
#define dv(K,L,N,M,S) vector<vector<L>> K(N,vector<L>(M,S))
#define tv(K,L,N,M,R,S) vector<vector<vector<L>>> K(N,vector<vector<L>>(M,vector<L>(R,S)))
#define pint pair<lli,lli>
#define paf(L,R) pair<L,R>
#define maxx 5100000
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
#define endl "\n"
typedef long long int lli;
typedef unsigned long long int uli;
const uli mod = 1e9 + 7;
using namespace std;
int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    int n, m,sum=0;
    cin >> n >> m;
    vector<int> a(m);
    for(int i = 0; i < m; ++i) {
        cin >> a.at(i);
        sum += a.at(i);
    }
    if(sum > n) {
        cout << -1 << endl;
        return 0;
    }
    cout << n - sum << endl;
}

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

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

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

  int total = 0;
  rep(i, m) total += a[i];

  int ans = 0;
  if (total > n) {
    ans = -1;
  } else {
    ans = n - total;
  }

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: 'n' was not declared in this scope
   14 |   n-=ans;
      |   ^
Language: C

#include <bits/stdc++.h>
using namespace std;
#define fast_io {cin.sync_with_stdio(0); cout.sync_with_stdio(0);}
#define out(x,y) {cout<<x<<y;}
using ll = long long int;

int main(){
	fast_io;
	ll n,m;
	cin>>n>>m;
	ll ans = 0;
	for(ll i=0;i<m;i++){
		ll x; cin>>x; ans+=x;
	}
	if(ans<=n){
		cout<<n-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;

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
string char_to_string(char val) {
    return string(1, val);
}
int char_to_int(char val) {
    return val - '0';
}

int main() {
    int N, M; cin >> N >> M;
    vector<int> A(M); REP(i, M) cin >> A[i];

    ll sum_num = accumulate(all(A), 0LL);

    ll ans = N - sum_num;
    if(ans < 0) {
      cout << -1 << endl;
    } else if(ans >= 0) {
      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

    //Keep Working Hard
  // I__Like__Food  
  #include<bits/stdc++.h>
  using namespace std;
  #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  #define endl "\n"
  #define all(v) v.begin(),v.end()
  #define f first
  #define s second
  #define PB push_back
  #define MP make_pair
  #define double long double
  #define trace1(x)                cerr<<#x<<": "<<x<<endl
  #define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
  #define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
  #define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
  #define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
  #define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
  #define cases int testcases;cin>>testcases; while(testcases--)
  #define MOD 998244353
  #define N 200005
  #define INF 1000000000000
  #define eps 1e-6
  #define int long long
  #define pie 3.1415926535897932384626433832795028
int32_t main()
{


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

   int sum = 0;

   vector<int> v(m);

   for(int i = 0; i <m; i++)
   {
    cin >> v[i];
    sum += v[i];
   }

   n-=sum;

   if(n < 0)n = -1;

   cout << n;
    return 0;
}

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

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

int main() {

long N,M;
cin>>N>>M;
vector<long> a(M);
for(int i=0;i<M;i++) cin>>a[i];
long sum =0;
for(int i=0;i<M;i++){
  sum+=a[i];
}
long 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<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_set>
#include<unordered_map>
#include<bitset>
using namespace std;
#define INF 2000000007
#define LINF 100000000000000007
#define MOD 1000000007
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define repb(i, n) for (int i = n - 1; i >= 0; i--)
#define MODE 0
#ifdef MODE
#define DEB(X) cout<< #X <<": "<<X<<" ";
#define ARDEB(i,X) cout<< #X <<"["<<i<<"]: "<<X[i]<<" ";
#define END cout<<endl;
#else
#define DEB(X) {}
#define ARDEB(i,X) {}
#define END {}
#endif
typedef long long ll;
typedef pair<int,int> P;
struct edge{int to,cost;};
int ceil2(int a,int b){if(a%b){return a/b+1;}else{return a/b;}}
using namespace std;

int n,k,ans;
int a[111111];
signed main(){
	
	cin>>n>>k;
	rep(i,k)cin>>a[i];
	int sum=0;
	rep(i,k){
		sum+=a[i];
	}
	if(sum<=n)cout<<n-sum<<endl;
	else cout<<-1<<endl;
	
}

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;
#define rep(i,a,b) for(int i=int(a);i<int(b);i++)
typedef long long ll;




int main(){
    ll n,m;cin>>n>>m;
    ll sum=0;
    rep(i,0,m){
        ll a;cin>>a;
        sum+=a;
    }
    if(sum<=n)cout<<n-sum<<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;

typedef long long int ll;

const ll mod = 1e9 + 7;
const ll MAXN = 1e5 + 5;

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

  ll n,m;
  cin >> n >> m;
  ll ans = 0;
  for(int i = 0; i < m; i++){
    ll a;
    cin >> a;
    ans += a;
  }
  if(n - ans >= 0) cout << n - ans << 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 <stdio.h>
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <queue>
#include <set>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <complex>

using ll = long long int;
using namespace std;

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

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

  cerr << "Answer:" << endl;
  cout << max(ans, -1LL) << endl;

  return 0;
}


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

#include<iostream>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())

const int MAX = 510000;
const int MOD = 1000000007;

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

  vector<ll> a(M);
  rep(i,M) cin>>a[i];

  ll sum = 0;
  rep(i,M) sum+= a[i];

  if(N>=sum) cout<<N-sum<<endl;
  else cout<<-1<<endl;


}


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;
#define REP(i,n) for(int i=0;i<(n);i++)
#define N 4050
#define INF 1000000000
typedef long long ll;
#define ALL(v) (v).begin(),(v).end()
#define SZ(x) int(x.size())
#define IN(a) cin>>(a)
#define OUT(a) cout<<(a)<<endl
typedef pair<int,int> P;
const int MAX = 1000000;
const int MOD = 1000000007;
int main(){
    int n,m;
    cin>>n>>m;
    ll sum=0;
    REP(i,m){
        int a;
        cin>>a;
        sum+=a;
    }
    OUT(max(n-sum,(ll)-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"
using namespace std;

#define fi first
#define se second
#define pb push_back
#define int long long
#define all(x) (x).begin(), (x).end()

using LL = long long;
using LD = long double;
using pii = pair<int, int>;
using vii = vector<pii>;

const int INF = 1e18;
const int MOD = 1e9 + 7;
const int N = 1e5 + 5;

int32_t main() {
    //ios::sync_with_stdio(false); cin.tie(nullptr);

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

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

    cout << (n >= sum ? n - sum : -1) << "\n";
}

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

#define _USE_MATH_DEFINES
#include <math.h>
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <algorithm>

using namespace std;
typedef long long ll;

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

int main() {

    ll N,M;
    cin >> N >> M;
    ll A[M];
    rep(i,M) cin >> A[i];
    ll out = N;
    rep(i,M){
        out -= A[i];
    }
    if(out<0) out = -1;
    cout << out << endl;
    return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const double PI=3.14159265358979323846;
int main(){
    ll N,M; cin>>N>>M;
    ll ans=0;
    vector<ll>A(M,0);
    for(ll i=0;i<M;i++){
        cin>>A[i];
        ans+=A[i];
    }
    if(ans<=N){
        cout<<N-ans;
    }
    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"
using namespace std;
#define REP(i, n) for(ll i = 0;i < n;i++)
#define ll long long
#define MOD 1000000007
#define llMAX 9223372036854775807
#define llMIN -9223372036854775808
using vi = vector<ll>; // intの1次元の型に vi という別名をつける
using vvi = vector<vi>; // intの2次元の型に vvi という別名をつける

ll n,m,x,y;

int main(){
  ll ans=0;
  cin >> n >> m;
  vi a(m);
  REP(i,m){
    cin>>a[i];
    ans+=a[i];
  }

  ans=n-ans;
  if (ans<-1)ans=-1;

  cout<<ans<<endl;
  return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:27:12: error: expected '}' at end of input
   27 |   return 0;
      |            ^
a.cc:14:11: note: to match this '{'
   14 | 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 ()

{
    

    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:32:16: error: 'x' was not declared in this scope
   32 |         cin >> x;
      |                ^
Language: C

#include<bits/stdc++.h>
#define rep(i,N) for(int i=0;i<(N);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e12;
const int inf = 1e9;
typedef long long ll;
typedef pair<ll,int> P;
typedef set<int> S;
int main(){
    ll n,m;
    cin>>n>>m;
    vector<ll> v(m);
    ll sum = 0;
    rep(i,m){
        ll 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;
int main() {
  long long N, M;
  cin >> N >> M;
  long long a[i];
  long long cnt=0;
  for(int i=0; i<M; i++) {
    cin >> a[i];
    cnt+=a[i];
  }
  cout << N-cnt << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:15: error: 'i' was not declared in this scope
    6 |   long long a[i];
      |               ^
a.cc:9:12: error: 'a' was not declared in this scope
    9 |     cin >> a[i];
      |            ^
Language: C

#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列
using namespace std;

typedef long long ll;

//マクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))
#define INF 1000000000000 //10^12
#define MOD 1000000007 //10^9+7
#define MAXR 100000 //10^5:最大のrange(素数列挙などで使用)


typedef map<string, int> map_type;
typedef pair<string, int> value_type;

struct second_order {
  bool operator()(const value_type& x, const value_type& y) const {
    if( x.second != y.second) return x.second < y.second;
    return x.first > y.first;
  }
};

typedef priority_queue<value_type, vector<value_type>, second_order> pqueue_type;


pqueue_type map_to_pqueue(map_type m) {
    pqueue_type que;
    for(auto it=m.begin(); it!=m.end(); ++it) {
        que.push(*it);
    }
    return que;
}


int main(void){
    int n, x;
    cin >> n >> x;
    vector<int> a(x);
    REP(i,x) cin >> a[i];
    int sum = n-accumulate(ALL(a),0);
    if(sum<0) cout << -1 <<endl;
    else cout << sum << endl;
    return 0;
}


Compiler output:
main.c:1:9: fatal error: algorithm: No such file or directory
    1 | #include<algorithm>//sort,二分探索,など
      |         ^~~~~~~~~~~
compilation terminated.
Language: C

#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <utility>
#include <algorithm>
#include <cmath>
#include <climits>
#include <iomanip>
#include <queue>
#include <stack>

using namespace std;

typedef long long ll;

int main() {
    ll n, *a, m; cin >> n >> m;   
    a = new ll[m];
    ll s = 0;
    for (int i = 0; i < m; i++) {
        cin >> a[0];
        s+= a[0];
    }

    if (s <= n)
        cout << n-s << 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

import java.util.Scanner;

class Main {
	int n;
	int m;
	int[] a;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Main m = new Main(sc);
		m.solve();
		sc.close();
	}

	Main(Scanner sc) {
		n = sc.nextInt();
		m = sc.nextInt();
		a = new int[m];
		for(int i=0;i<m;i++){
			a[i] = sc.nextInt();
		}
	}

	void solve() {
		for(int i:a){
			n-=i;
		}
		System.out.println(n>=0?n:-1);
	}
}

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.Scanner;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.Scanner;
      |            ^
main.c:3:1: error: unknown type name 'class'
    3 | class Main {
      | ^~~~~
main.c:3:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    3 | class Main {
      |            ^
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>


int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
//    return *(long long*)a - *(long long*)b;
}
//  qsort(A, b, sizeof(int), compare_int);

//long long  factorial(long long n) {
//    if (n > 0) {
//        return n * factorial(n - 1);
//    } else {
//        return 1;
//    }
//}
long long  factorial(long long n, long long depth) {
    if (n > 1) {
        depth++;
        return factorial(n / 2, depth);
    } else {
        return depth;
    }
}

int min(int a, int b) {
    if (a > b)
        return b;
    else
        return a;
}

int distance(int a, int b) {
  return abs(a-b)*abs(a-b);
}



//int ()
/*
int triangle(int a, int b, int c){
  if(a<b+c){
    if(b<c+a){
      if(c<a+b){
        printf("1\n");
        return 1;
      }
    }
  }
  printf("1\n");
  return 0;
}
*/

int main()
{
//  int  a, b, c, d, e, X, Y ,r;
  long long  a, b, c, d, e, X, Y;
  //  double  c;
// long long  A[200003]={};
  int  A[200003]={};
  int  B[100003]={};
//  int  C[100003][100001]={};
  int  C[100003]={};

  int  flg=0;

//  char s[101][101]={};
  char s[100001]={};
  char t[100001]={};
//  int N, M;
//  int A[1000000001]={};
//  long long  C[101]={};
  int i,j,k;
  long long p=0,q=0;
  int sosuu[46] ={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199};
  int min =100000001;
  int len=0;
  int l=0;
  int cnt=0;
  int num=0;
  int num1=0;
  int num2=0;
  long long  ans=0;
  int ans_ac=0;
  int ans_wa=0;
  int max=0;
  long long sum=0;
  int addr=0;
  int ptn=0;
  int  tmp=0;
  double per=0; 
//  bool on_off[100]={};
  
//  char alp[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};

  //  a=0;
  scanf("%lld%lld", &a, &b);
  for(i=0;i<b;i++){
    scanf("%lld", &c)
    a=a-c;
  }
  if(a<0)  printf("-1\n");
  else printf("%lld\n", a);
  
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:104:22: error: expected ';' before 'a'
  104 |     scanf("%lld", &c)
      |                      ^
      |                      ;
  105 |     a=a-c;
      |     ~
Language: C

#include<cstdio>
#include<cmath>
#include<string>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<cstring>

using namespace std;

int main()
{
	int n;
	long long m;

	scanf("%lld %d", &m, &n);

	long long sum = 0;

	for (int i = 0; i < n; i++)
	{
		long long input;

		scanf("%lld", &input);

		sum += input;
	}

	if (m >= sum)
	{
		printf("%lld\n", m - sum);
	}

	else
	{
		printf("-1\n");
	}

	return 0;
}

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

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

typedef long long ll;
typedef int64_t i6;

#define rep(i, n) for (ll i = 0; i < n; ++i)
#define rep2(i, n) for (ll i = 1; i <= n; ++i)
#define ALL(v) (v).begin(), (v).end()
#define Sort(x) sort(ALL(x))
#define Sort_rev(x) Sort(x);reverse(ALL(x))

template<typename V,typename T>
T find_num(V v, T num) {
    if ( find(ALL(v), num) == v.end() ) {
        return false;
    } else {
        return true;
    }
}

// π M_PI
// deg = rad*180/M_PI

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

    ll ans = n-sum;
    if ( ans < 0 ) {
        ans = -1;
    }
    cout << ans << endl;
    return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int N, M;
    cin >> N >> M;
    int days = 0;
    for (int i=0; i<M; i++){
        int a;
        cin >> a;
        days += a;
    }

    if (N - days >= 0 ){
        cout << N - days << 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<iomanip>
#include<queue>
#include<iostream>
#include<cmath>
#include<cstdio>
#define pi acos(-1)
using namespace std;

/*int arr[10000];
vector<int>adj[10000];
vector<int>v1;
bool visited[10000];
void bfs(int s)
{
    int cnt=0;
    queue<int>q;
    q.push(s);
    v1.push_back(s);
    visited[s]=1;
    cnt++;
    while(!q.empty()){
        int u=q.front();
        q.pop();
        for(int i=0;i<adj[u].size();i++){
            if(visited[adj[u][i]]==0){
                int v=adj[u][i];
                visited[v]=1;
                v1.push_back(v);
                q.push(v);
                cnt++;
            }
        }
    }
    int u=v1.size();
    for(int i=0;i<u;i++){
        arr[v1[i]-1]=cnt;
    }
    v1.clear();
}
void solve(int n)
{
    for(int i=0;i<n;i++)cout<<arr[i]<<" ";
}
int main()
{
    int m,n;
    cin>>n>>m;
    for(int i=0;i<m;i++){
        int k,j=0;
        cin>>k;
        int ara[k];
        while(j<k){
            cin>>ara[j];
            if(j){
                adj[ara[j-1]].push_back(ara[j]);
                adj[ara[j]].push_back(ara[j-1]);
            }
            j++;
        }
    }
    for(int i=0;i<n;i++){
        if(visited[i+1]==0){
          bfs(i+1);
        }
    }
    solve(n);
    //cout<<v2.size();
}
*/
int main()
{
    long long int a,b,t,k;
    cin>>t>>a;
    long long int sum=0;
    for(int i=0;i<a;i++){
        long long int p;
        cin>>p;
        sum+=p;
    }
    if(sum>t)cout<<"-1";
    else cout<<t-sum;
}




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

#include <iostream>
#include <vector>
#include <string>
#include <cctype>
#include <cmath>
#include <iomanip>
#include <climits>
#include <cfloat>
#include <algorithm>
#include <memory>
using namespace std; 

typedef long long ll; 
typedef unsigned long long ull;
typedef unsigned uint; 
typedef long double l_double;

#define vtr vector
#define PB push_back
#define EB emplace_back
#define gcd __gcd
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define st_ct static_cast // <>
#define TEST uint _ {}; cin >> _; while (_--)
#define PI (3.1415926535897932384626433832795)
#define MOD st_ct<int>(1e9 + 7)
#define EPS 1e-9
#define deb(x) cout<< #x << " --> " << x << endl;

template<typename T>
void vtrS(const vector<T> &ARR) 
{ for (T const &val: ARR) cout<<val<<" "; cout<<endl; }

template<typename T>
void vtrV(const vector<T> &ARR) 
{ for (T const &val: ARR) cout<<val<<endl; }

template<typename T>
void read_vvtr(vector<vector<T>> &ARR) 
{ for (vector<T> &i: ARR) for (T &j: i) cin >> j; }

template<typename T>
void vvtrS(const vector<vector<T>> &ARR) 
{ for (vector<T> const &i: ARR) { for (T const &j: i) cout<<j<<" "; cout<<endl; } }

template<typename T>
void vvtrNS(const vector<vector<T>> &ARR) 
{ for (vector<T> const &i: ARR) { for (T const &j: i) cout<<j; cout<<endl; } }

template<typename T>
T cntDigits(const T &N) { return (floor(log10(N)) + 1); }

template<typename T>
bool isPowOfTwo(const T &N) { return (N && (!(N&(N-1)))); }

template<typename T>
T lcm(T a, T b) { return ((a*b)/gcd(a, b)); }
// --------------------------------------------------------------------------------

//

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    // cout.setf(std::ios::boolalpha);
    cout<<std::fixed<<std::setprecision(10); 
    // --------------------------------------
    
    int n {}, m {};
    cin >> n >> m;
    int sum {};
    for (int i {}; i < m; ++i) {
        int val {};
        cin >> val;
        sum += val;
    }
    if (n - sum >= 0) cout<<n - sum<<endl;
    else if (n - sum < 0) 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 < (n); ++i)
#define rrep(i, n) for (int i = 1; i < (n + 1); ++i)
using namespace std;
using ll = long long;
const int INF = +100100100;
// typedef pair<int,int> P;
const int MAX = 1000000;


int main(){
    int n,m;
    cin >> n >> m;
    vector<int> a(m+1);
    rep(i,m)cin >> a[i];
    ll sum=0;
    rep(i,m)sum+=a[i];
    if(n-sum<0)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 <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: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.