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

#include <vector>
#include <iostream>
#include <string>
#include <math.h>
#include <algorithm>

using namespace std;


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

  
  
  cin >> N >> M;

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

  ans = N;

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

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

  cout << ans << endl;
  

  return 0;
}




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

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include <cmath>

using namespace std;
const long long INF = (long long) (1e18)+1;

int main() {
  int n, m;
  cin >> n >> m;
  vector<int> nums(m);
  for (int i=0; i<m; ++i) {
    cin >> nums[i];
    n-=nums[i];
  }
  if (n>0) {
    cout << n << endl;
  } else {
    cout << -1<< 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;

int main(void) {
  long long N, M;
  cin >> N >> M;

  long long count = 0;

  vector<int> A(M);
  for(int i=0; i<M; i++) {
    cin >> A.at(i);
    count += A.at(i);
  }

  if (count > N) { cout << -1 << endl; } else {
    cout << N - count << 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<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<map>
#include<iomanip>
#include<queue>
#include<stack>
#include<time.h>
#define rep(i,n)for(int i=0;i<n;i++)
#define int long long
#define ggr getchar();getchar();return 0;
#define prique priority_queue
constexpr auto mod = 1000000007;
#define inf 1e15
#define key 1e9
using namespace std;
typedef pair<int, int>P;
void yes() { cout << "Yay!" << endl; }
void no() { cout << ":(" << endl; }
template<class T> inline void chmax(T& a, T b) {
	a = std::max(a, b);
}
template<class T> inline void chmin(T& a, T b) {
	a = std::min(a, b);
}

//combination(Nが小さい時はこれを使う)
const int MAX = 300000;
int fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % mod;
		inv[i] = mod - inv[mod % i] * (mod / i) % mod;
		finv[i] = finv[i - 1] * inv[i] % mod;
	}
}
int COMB(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % mod) % mod;
}

bool prime(int n) {
	int cnt = 0;
	for (int i = 1; i <= sqrt(n); i++) {
		if (n % i == 0)cnt++;
	}
	if (cnt != 1)return false;
	else return n != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}

//繰り返し二乗法（Nが大きい時の場合のcombination)
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= (i % mod); res %= mod;
	}
	return res;
}
int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y) * mod_pow(kai(y, y), mod - 2, mod) % mod;
}
//UnionFind
class UnionFind {
protected:
	int* par, * rank, * size;
public:
	UnionFind(unsigned int size) {
		par = new int[size];
		rank = new int[size];
		this->size = new int[size];
		rep(i, size) {
			par[i] = i;
			rank[i] = 0;
			this->size[i] = 1;
		}
	}
	int find(int n) {
		if (par[n] == n)return n;
		return par[n] = find(par[n]);
	}
	void unite(int n, int m) {
		n = find(n);
		m = find(m);
		if (n == m)return;
		if (rank[n] < rank[m]) {
			par[n] = m;
			size[m] += size[n];
		}
		else {
			par[m] = n;
			size[n] += size[m];
			if (rank[n] == rank[m])rank[n]++;
		}
	}
	bool same(int n, int m) {
		return find(n) == find(m);
	}
	int getsize(int n) {
		return size[find(n)];
	}
};
int dight_sum(int n) {
	int sum = 0;
	rep(i, 20)sum += (n % (int)pow(10, i + 1)) / (pow(10, i));
	return sum;
}
int a[11111];
signed main() {
	int n, m;
	cin >> n >> m;
	rep(i, m)cin >> a[i];
	int memo = 0;
	rep(i, m)memo += a[i];
	if (memo > n)puts("-1");
	else cout << n - memo << endl;
	ggr
}

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<iostream>
#include<string>
#include<vector>
#include<utility>
#include<cmath>
#include<map>
#include<functional>
#include<queue>
#include<set>
#include<stack>
#include<iomanip>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<(n);i++)
template<typename T =ll> using v = vector<T>;
template<typename T =ll> using vv = v<v<T>>;
template<typename T =ll,typename U =ll> using p = pair<T,U>;
template<typename T> T chmin(T &a,T b) {return a=min(a,b);}
template<typename T> T chmax(T &a,T b) {return a=max(a,b);}
const ll INF = (ll)1e9;

void a(){
    double r; cin >> r;
    cout<< fixed <<setprecision(15) <<2*M_PI*r<<endl;
}

void b(){
    ll n,m; cin >> n >> m;
    ll sum=0;
    rep(i,m){
        ll a;
        cin >> a;
        sum+=a;
    }
    cout << ((sum<=n?n-sum:-1));
}


void c(){

}

void d(){

}

void e(){

}

int main(){
    b();
    return 0;
}

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

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

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

    

Compiler output:
a.cc: In function 'int main()':
a.cc:16:6: error: 'N' was not declared in this scope
   16 |   if(N-count>=0){
      |      ^
Language: C++

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


	int main()
	{
		int days,n;
		cin>>days>>n;
		int ans=0;;
		while(n--)
		{	int a;
			cin>>a;
			ans+=a;
		}

		if(days-ans > 0)cout<<days-ans<<endl;
		else cout << -1 << endl;
	}

Compiler output:
a.cc:1:9: error: stray '#' in program
    1 | .       #include<bits/stdc++.h>
      |         ^
a.cc:1:1: error: expected unqualified-id before '.' token
    1 | .       #include<bits/stdc++.h>
      | ^
a.cc: In function 'int main()':
a.cc:8:17: error: 'cin' was not declared in this scope
    8 |                 cin>>days>>n;
      |                 ^~~
a.cc:16:33: error: 'cout' was not declared in this scope
   16 |                 if(days-ans > 0)cout<<days-ans<<endl;
      |                                 ^~~~
a.cc:16:49: error: 'endl' was not declared in this scope
   16 |                 if(days-ans > 0)cout<<days-ans<<endl;
      |                                                 ^~~~
a.cc:17:22: error: 'cout' was not declared in this scope
   17 |                 else cout << -1 << endl;
      |                      ^~~~
a.cc:17:36: error: 'endl' was not declared in this scope
   17 |                 else cout << -1 << endl;
      |                                    ^~~~
Language: C++

#include<iostream>
#include<math.h>
#include<iomanip>
#include<vector>
#include<algorithm>
#include<queue>
#include<string>
#include<stdlib.h>
using namespace std;
#define PI 3.14159265358979
typedef  long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
#include<set>


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

int main(void)
{
    ll n;
    lldiv m;
    cin>>n>>m;
    ll sum =0;
    vector<int> a(m);

    rep(i,m) 
    {
        cin>>a[i];
        sum+=a[i];
    }

    ll ans = n-sum;

    if(ans<0) cout<<-1<<endl;

    else cout<<ans<<endl;




}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:10: error: expected ';' before 'm'
   22 |     lldiv m;
      |          ^~
      |          ;
a.cc:23:13: error: 'm' was not declared in this scope
   23 |     cin>>n>>m;
      |             ^
Language: C

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

int main(){

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



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

import java.util.Scanner;

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


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

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


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

    int N,M;
    cin >> N >> M;
    int A[M];
    rep(i,M) cin >> A[i];
    int ans=0;
    int sum=0;
    rep(i,M) sum+=A[i];
    if(N<sum) ans=-1;
    else ans=N-sum;
    cout << ans<< endl;


}

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

/*  TAHMID RAHMAN
    DAMIAN FOREVER
     MATH LOVER
    NEVER GIVE UP
*/
#include<bits/stdc++.h>
using namespace std;
#define pi acos(-1.0)
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define ll long long
#define pb push_back
#define fi first
#define se second
#define in insert
#define mp make_pair
#define gcd(a,b) __gcd(a,b);
int main()
{
    fastio;
    ll n,m,i,s=0;
    cin>>n>>m;
    vector<ll>v(m);
    for(i=0;i<m;i++)
    {
        cin>>v[i];
    }
    for(i=0;i<m;i++)
    {
        s=s+v[i];
    }
    if(s>n)
        cout<<"-1"<<endl;
    else
    {
        cout<<n-s<<endl;
    }
}


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

#include<stdio.c>
#include<stdlib.c>

int main()
{
  int N,M,i;
  int a;
  int sum=0;
  scanf("%d %d",&N,&M):
  getchar():
  for(i=0;i<M;i++){
    scanf("%d",&a);
    getchar();
    sum+=a;
  }
  printf(N-sum);
  return 0;
}
  
    
    

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

#include<bits/stdc++.h>
#define PI 2.0*acos(0.0)
#define ll              long long int
#define gcd(a,b)        __gcd(a,b)
#define lcm(a,b)        ((a)*(b))/gcd(a,b)
#define MOD             1000000007
#define mx              123456789
using namespace std;
int main()
{
    ll n, m;
    cin>>n>>m;
    ll a[n+2];
    ll sum=0;
    for(i=0; i<m; i++)
    {
        ll x;
        cin>>x;
        sum+=x;
    }
    if(sum>n)
        cout<<-1<<endl;
    else
        cout<<n-sum<<endl;
    return 0;
}


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

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'score' was not declared in this scope; did you mean 'sccore'?
   11 |     score+=x;
      |     ^~~~~
      |     sccore
a.cc:13:7: error: 'score' was not declared in this scope; did you mean 'sccore'?
   13 |   if (score<=n){
      |       ^~~~~
      |       sccore
Language: C++

/home/vitalii/Desktop/Project/cmake-build-debug/Project
314 15
9 26 5 35 8 9 79 3 23 8 46 2 6 43 3
9

Process finished with exit code 0


Compiler output:
a.cc:1:1: error: expected unqualified-id before '/' token
    1 | /home/vitalii/Desktop/Project/cmake-build-debug/Project
      | ^
Language: C

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: expected ';' before '}' token
   10 |    sum+=a[i]
      |             ^
      |             ;
   11 |   }
      |   ~          
a.cc:12:8: error: 'i' was not declared in this scope
   12 |   if(a[i]<n)
      |        ^
Language: C

#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <algorithm>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using ll = long long;
using namespace std;
int main()
{
	int n, m, t, tot;
	cin >> n >> m;
	tot = 0;
	rep(i, m) {
		cin >> t;
		tot += t;
	}
	cout << max(-1, n - tot) << 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>
#include<stdio.h>
#include<string>
#include<cmath>
#include<math.h>
#include<vector>
#include<algorithm>
#include<map>
#pragma warning(disable: 4996)
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;
using ll = long long;


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

	vector<int> A(M);

	ll cnt = 0;

	rep(i, M) {
		cin >> A[i];
		cnt += A[i];
	}

	if (N - cnt <= 0) {
		cout << "-1" << endl;
	}
	else if (N - cnt > 0) {
		cout << N - cnt << endl;
	}

	return 0;
}

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

#include<bits/stdc++.h>
#define pb push_back
//#define int long long
#define mod 1000000007
#define mp make_pair
#define fi first
#define se second
#define ll long long
#define scan(n) ll a[n]; for(ll i = 0 ; i<n ; i++) cin>>a[i]
#define print(a,n) for(int i = 0 ; i < n ; i++) cout<<a[i]<<' '
#define fast ios_base::sync_with_stdio(false); cin.tie(0);cout.tie(0);
#define rep(i,x,y) for(ll i=x;i<y;i++)
using namespace std;
typedef vector<int>vi ;
typedef vector<ll>vll ;
typedef vector<vector<ll> >vvl ;
typedef pair<ll,ll> pll ;
/*vi adj[200005];
ll vis[200005];
ll parent[200005];
ll level[200005];*/
int main()
{
	fast;
	ll n,m;
	scan(m);
	ll sum=0;
	for(ll i=0;i<m;i++)
	{
		sum+=a[i];
	}
	if(sum<=n)
	{
		cout<<n-sum;
	}
	else
		cout<<"-1";
	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() {
    int n, m, a, ans = 0;

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

    if(n - ans < 0)
    {
        cout << "-1" << endl;
    }
    else
    {
        cout << n - ans << endl;
    }
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: expected ';' before '}' token
   11 |         ans += a
      |                 ^
      |                 ;
   12 |     }
      |     ~
Language: Java

class  Main{
      public static void main(String[] args) {
          Scanner scan = new Scanner(System.in);
           int N= scan.nextInt();
           int M = scan.nextInt();
           for(int i=0;i<M;i++){
               N-=scan.nextInt();
           }
           if(N<0){
               System.out.println(-1);
           }
           else{
               System.out.println(N);
           }
          }
   }


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

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <iterator>
#include <algorithm>
#include <map>
#include <string.h>
#include <vector>
#include <cmath>
#include <deque>
#include <iomanip>

using namespace std;
#define range(a) a.begin(), a.end()
#define rep(i, c) for(int i = 0; i < (int)c; i++)
typedef long long ll;

template <typename T> ostream& operator<<(ostream& out, vector<T> &v){
  for (int i = 0; i < (int)v.size(); i++) {
    out<<v[i]<<' ';
  }
  return out;
}

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

  // float n; cin >> n;
  //
  // cout << n * 2 * 3.141592653589 << endl;

  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 << 0 << endl;
  else if (sum < n) 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>
#include <string>
#include <vector>
#include <map>
#include <memory>
#include <math.h>
#include <algorithm>
#include <queue>

using namespace std;
int main()
{
    int N, M;
    int day = 0;

    cin >> N >> M;
    vector<int> shukulist( M );

    for (auto i = 0; i < M; i++) 
    {
        cin >> shukulist[i];
        day += shukulist[i];
    }
    if (N < day) {
        cout << "-1" << endl;
    } else {
        cout << (N - day) << 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>
#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>
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 rrep(i, m, n) for(int i=m; i<n; ++i)
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};

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);
}

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

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

n, m = gets.split("\s").map(&:to_i)
a = gets.split("\s").map(&:to_i)

rest = n - a.sum 

print rest >= 0 ? rest : -1

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | n, m = gets.split("\s").map(&:to_i)
      | ^
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 = gets.split("\s").map(&:to_i)
      |    ^
main.c:1:8: error: 'gets' undeclared here (not in a function)
    1 | n, m = gets.split("\s").map(&:to_i)
      |        ^~~~
main.c:1:23: warning: unknown escape sequence: '\s'
    1 | n, m = gets.split("\s").map(&:to_i)
      |                       ^
main.c:1:30: error: expected expression before ':' token
    1 | n, m = gets.split("\s").map(&:to_i)
      |                              ^
main.c:2:1: error: expected ',' or ';' before 'a'
    2 | a = gets.split("\s").map(&:to_i)
      | ^
Language: C

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

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: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 main()
{
 
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  /* freopen("input.txt","r",stdin);
     freopen("output.txt","w",stdout);
  */ 
  ll n,m;
  cin>>n>>m;
  ll arr[m],i,sum=0;
  for(i=0;i<m;i++)
  {
     cin>>arr[i];
  }
  for(i=0;i<m;i++)
  {
     sum=sum+arr[i];
  }
  if(sum>n)
  {
     cout<<"-1\n";
  }
  else
  {
     cout<<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

import java.util.*;
public class Main{
    public static void main(String [] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        //int c = sc.nextInt();
        //String s = sc.next();

        //int A[] = new int[M];
        int count = 0;
        int a;
        for(int i = 0;i<M;i++) {
            a = sc.nextInt();
            count += a;
        }
/*        if(N%2 != 0){
        for(int i = 1; i <= N; i++){
            for(int j = i; j <= N; j++){
                c = i*j;
                if(c == N){
                    d = i+j-2;
                    if(min == 0 || min > d) min = d;
            }
        }
    }
}*/
//double R = (double)r * Math.PI * 2;
count = N - count;
if(count < 0) System.out.println(-1);
else System.out.println(count);

    }
}

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

#include <bits/stdc++.h>
#define rep(i,a) for(int i=0;i<a;i++)
using namespace std;
using ll = long long;
int main(void){
    int n,m;
    cin>>n>>m;
    int a;
    rep(i,m){
        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 <bits/stdc++.h>
using namespace std;

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

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

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

int main()
{
    ios::sync_with_stdio();cin.tie(0);cout.tie(0);
    #define pb push_back
    #define mk make_pair
    //#define int long long int
    int t,n,sum=0;
    cin>>t>>n;
    int a[n+10];
    for(int i=0;i<n;i++)]
    {
        cin>>a[i];
        sum+=a[i];
    }
    if(sum>t)cout<<-1<<endl;
    else cout<<sum-t<<endl;



    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:25: error: expected primary-expression before ']' token
   14 |     for(int i=0;i<n;i++)]
      |                         ^
Language: C

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


using namespace std;

const ll mod = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;


#define DEBUG

#ifdef DEBUG
#define PRINT(A) std::cout << (#A) << ":" << (A) << std::endl;
#else
#define PRINT(A)
#endif

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 A, B;
int a[10010][10010], b[1000];
int dp[10010][3];
 
int main()
{
    int N, M; cin >> N >> M;
    int A;
    rep(i,M){
        cin >> A;
        N -= A;
    }

    cout << max(N,-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

N,M=map(int,input().split())
A=list(map(int,input().split()))

nissuu=sum(A)

if nissuu>N:
    print(-1)
else:
    print(N-nissuu)

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

#include<stdio.h>
#include<algorithm>

using namespace std;

long long inp_c, inp_n, i1, cursum;

long long inp_a[10004];

long long readNumber() {
	long long temp_func;
	scanf("%lld", &temp_func);
	return temp_func;
};
long long printNumber(long long temp_func) {
	printf("%lld", temp_func);
	return 0;
};

int main() {
	
	inp_n = readNumber();
	
	inp_c = readNumber();
	
	for (i1 = 1; i1 <= inp_c; i1++) {
		
		inp_a[i1] = readNumber();
		
		cursum += inp_a[i1];
		
	};
	
	printNumber(max(-1, inp_n - cursum));
	
	return 0;
	
}

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

#include <bits/stdc++.h>
#define PI 3.1415926535897
using namespace std;
typedef long long ll;
const int INF = 1000000000;
const ll LINF = 1000000000000000000; //1e18
const double EPS = 1e-10;

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

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

    int ans = N;
    for (int i = 0; i < M; i++)
    {
        if (ans - A[i] >= 0)
        {
            ans -= A[i];
        }
        else
        {
            ans = -1;
            break;
        }
    }
    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() {
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n, m;
    cin>>n>>m;
    int a[m];
    long long int sum = 0;
    for (int i = 0; i < m; i++) {
        cin>>a[i];
        sum += a[i];
    }
    if (n >= sum) {
        cout<<n - sum;
    }
    else {
        cout<<"-1";
    }
	return 0;
}

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

#include<bits/stdc++.h>
#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
using namespace std;
int main(){
  int n,m;cin>>n>>m;
  int a,sum=0;
  rep(i,m){cin>>a;sum+=a;}
  cout<<(sum>n?-1:n-sum);
}

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;
int arr[m];
for(int i=0; i<m; i++) cin >> arr[i];
for(int i=0; i<m; i++) n = n- arr[i];
if(n>=0) cout << n ;
else cout << "-1";

Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: expected '}' at end of input
   10 | else cout << "-1";
      |                   ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C

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

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

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

int main()
{
    ios::sync_with_stdio();cin.tie(0);cout.tie(0);
    #define pb push_back
    #define mk make_pair
    //#define int long long int
    int t,n,sum=0;
    cin>>t>>n;
    for(int i=0;i<n;i++)]
    {
        cin>>a[i];
        sum+=a[i];
    }
    if(sum>t)cout<<-1<<endl;
    else cout<<sum-t<<endl;



    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:25: error: expected primary-expression before ']' token
   13 |     for(int i=0;i<n;i++)]
      |                         ^
Language: C

#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <cmath>
#include <bitset>
#include <iomanip>
#include <stack>
#include <list>
#include <map>
#include <unordered_map>
#include <chrono>
#include <numeric>
using namespace std;
using ll = long long;
const long long INF = (long long)1e18+1;
#define DIV 1000000007
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
#ifdef TEST
    chrono::system_clock::time_point start, end;
    start = chrono::system_clock::now();
#endif
    long idx=0;
    long N, M;
    cin >> N >> M;
    vector<long> A(M);
    long total=0;
    for(size_t i=0;i<M; i++)
    {
        cin >> A[i];
        total += A[i];
    }
    if(N - total < 0) cout << "-1" << endl;
    else cout << N - total << endl;
#ifdef TEST
    end = chrono::system_clock::now();
    cerr << static_cast<double>(chrono::duration_cast<chrono::microseconds>(end - start).count() / 1000.0) << "[ms]" << endl;
#endif
    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 <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <iomanip>//setprecision
using namespace std;
#define rep(i, n)        for(int i=0; i<(int)(n); ++i)
int main() {
}

int main(){
    long long int a,b,c,d=0;
    cin>>a>>b;
    rep(i,b){
        cin>>c;
        d+=c;
    }
    a-=b;
    if(a>0)cout<<-1;
    else cout<<a;
}

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

#pragma GCC optimize("Ofast")
#include<stdio.h>
#include<algorithm>
using namespace std;
int num[10005];
int main(){
	int i,n,m,sum=0;
	scanf("%d%d",&n,&m);
	for(i=0;i<m;i++){
		scanf("%d",&num[i]);
		sum+=num[i];
	}
	if(sum>n)
		puts("-1");
	else
		printf("%d\n",n-sum);
}


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

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <iomanip>
#include <map>
#include <set>
#include <tuple>
#include <unordered_map>
#include <iterator>
#include <string>
#include <limits>

using namespace std;

using i64 = int64_t;
using P = pair<i64, i64>;
i64 mod = 1000000007;
int int_max = 2147483647;
int max_n = 1e5;


int main(int argc, char **argv) {
    int n, m;
    cin >> n >> m;

    std::vector<int> as(m,0);
    int sum{0};
    for (int i=0; i<m; ++i) {
        cin >> as[i];
        sum+=as[i];
    }

    if (sum > 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>
using namespace std;
const long long int mod = 1000000007;

//i*2^X>=K
//2^X>=
int main() {
	int N, M, t = 0, ans=0;
	cin >> N >> M;
	for (size_t i = 0; i < M; i++)
	{

		cin >> t;
		ans += t;
	}
	if (ans <= N)cout << N - ans;
	else cout << -1;
}

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 <math.h>
#include <algorithm>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using ll = long long;
using namespace std;
int main()
{
	int n, m, t, tot;
	cin >> n >> m;
	tot = 0;
	rep(i, m) {
		cin >> t;
		tot += t;
	}
	cout << max(-1, n - tot) << 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>
using namespace std;

int main() {
  int n,m;
  cin>>n>>m;
  vector<int> s(m);
  for(int i=0;i<m;i++){
    cin>>a[i];
  }
  int k=n;
 for(int i=0;i<m;i++){
    k -=a[i];
  }
  cout<<k<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: 'a' was not declared in this scope
    9 |     cin>>a[i];
      |          ^
a.cc:13:9: error: 'a' was not declared in this scope
   13 |     k -=a[i];
      |         ^
Language: C

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

int main()
{
  int N,M;
  cin >>N>>M;
  int S;
  int tmp;
  for(int i= 0;i<N;i++){
    cin >>tmp;
    S +=tmp;
  }
  if(S<=N){
    cout<<N-S<<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 int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=0;i<=n;i++)
#define repr(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
#define INF 1e10
#define MOD 1e9+7
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using Graph = vector<vector<int>>;
int fg(int k){
    int sum = 1;
    for (int i = 1; i <= k; ++i)
    {
        sum *= i;
    }
    return sum;
}
signed main(){
 int a,b;
 cin>>a>>b;
 vector <int> vec(b);
 rep(i,b){
   cin>>vec[i];
 }
  int sum=0;
 rep(j,b){
   sum+=vec[i];
 }
 if(sum>a){
   cout<<-1;
 }
  else{
 cout<<a-sum;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:13: error: 'i' was not declared in this scope
   33 |    sum+=vec[i];
      |             ^
Language: C

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <vector>
#include <bitset>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <deque>
#include <string>
#include <list>
#include <iterator>
#include <algorithm>
#include <unordered_map>
#define int                long long
#define pb                 push_back
#define pi                 pair<int,int>
#define vi                 vector<int>
#define all(v)             v.begin(),v.end()
#define MOD                1000000007
#define F                  first
#define S                  second
#define FOR(i,r)           for(int i=0;i<r;i++)
#define REP(i,l,r)         for(int i=l;i<r;i++)
#define RER(i,l,r)         for(int i=l;i>=r;i--)
#define print(v)           for(auto i : v)cout << i << ' ';
#define FASTIO             ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define mem(arr,k)         memset(arr,k,sizeof(arr));
#define pii                acos(-1.0)
#define PI                 3.1415926535897932385
#define Sin(a)             sin((pi*a)/180)
#define test()             int x;cin >> x;while(x--)
using namespace std;
const int N = (int)1e5+5;
const int inf = (int)1e17+7;
void solve(){
	int n,m;
	cin >> n >> m;
	vi v(m);
	int s = 0;
	REP(i,0,m){
		cin >> v[i];
		s += v[i];
	}
	cout << max(-1LL,n-s) << endl;
}
int32_t main(){

	
	FASTIO;
	solve();
    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;
#define ll  long long
#define FASTINOUT ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const ll mod = 1e9+7;
const int N=1e7+9;
int main()
{
    FASTINOUT;
    int x,k,y;
    cin>>x>>k;
    int sum=0;
    for (int i=0;i<k;i++)
    {
        cin>>y;
        sum+=y;
    }
    if (sum<=x)
        cout<<x-sum<<endl;
    else
        cout<<-1<<endl;
    return 0;
}


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

N,M=map(int, input().split())
A=list(map(int, input().split()))
t = N - sum(A)
if t >= 0:
    print(N - sum(A))
else:
    print(-1)

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

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define repr(i,x,n) for(int i=x; i<(n); i++)
#define ALL(x) (x).begin(),(x).end()
#define INF 1e9
typedef long long ll;
using VI = vector<int>;
using VS = vector<string>;
using graph = vector<vector<int>>;
int main()
{
int n,m,homework_days=0;
cin>>n>>m;
for (int i = 0; i < m; i++)
{
    int days;
    cin>>days;
    homework_days+=days;
}

if (homework_days<=n)
{
    cout<<n-homework_days<<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++

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" ;
    return 0 ;
  }
  cout << n - sum ;
  return 0 ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> n >> m ;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:13:5: error: 'cout' was not declared in this scope
   13 |     cout << "-1" ;
      |     ^~~~
a.cc:13:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:16:3: error: 'cout' was not declared in this scope
   16 |   cout << n - sum ;
      |   ^~~~
a.cc:16:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C

# import sys
# sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]


def solve():
    n, m = MI()
    A = LI()

    sm = sum(A)
    if n - sm >= 0:
        print(n - sm)
    else:
        print(-1)


if __name__ == '__main__':
    solve()


Compiler output:
main.c:1:3: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | # import sys
      |   ^~~~~~
main.c:1:10: error: #import expects "FILENAME" or <FILENAME>
    1 | # import sys
      |          ^~~
main.c:2:3: error: invalid preprocessing directive #sys
    2 | # sys.setrecursionlimit(10 ** 6)
      |   ^~~
main.c:3:1: warning: data definition has no type or storage class
    3 | int1 = lambda x: int(x) - 1
      | ^~~~
main.c:3:1: error: type defaults to 'int' in declaration of 'int1' [-Wimplicit-int]
main.c:3:8: error: 'lambda' undeclared here (not in a function)
    3 | int1 = lambda x: int(x) - 1
      |        ^~~~~~
main.c:3:15: error: expected ',' or ';' before 'x'
    3 | int1 = lambda x: int(x) - 1
      |               ^
main.c:24:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   24 | if __name__ == '__main__':
      |                ^~~~~~~~~~
Language: C

#include<stdio.h>
#include<algorithm>

using namespace std;

long long inp_c, inp_n, i1, cursum;

long long inp_a[10004];

long long readNumber() {
	long long temp_func;
	scanf("%lld", &temp_func);
	return temp_func;
};
long long printNumber(long long temp_func) {
	printf("%lld", temp_func);
	return 0;
};

int main() {
	
	inp_n = readNumber();
	
	inp_c = readNumber();
	
	for (i1 = 1; i1 <= inp_c; i1++) {
		
		inp_a[i1] = readNumber();
		
		cursum += inp_a[i1];
		
	};
	
	printNumber(max(-1, inp_n - cursum));
	
	return 0;
	
}

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

import java.util.*;
public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		long N = sc.nextInt();
		int M = sc.nextInt();
		long buf = 0;
		for(int i = 0;i < M;i++){
			long += = sc.nextLong();
		}
		System.out.println(N - buf);
	}
}

Compiler output:
Main.java:9: error: not a statement
			long += = sc.nextLong();
			^
Main.java:9: error: ';' expected
			long += = sc.nextLong();
			    ^
2 errors
Language: C

#include <iostream>
#include <string>
#include <algorithm>
#include <stdlib.h>
#include <math.h>
#define ll long long 

using namespace std;
int res = 0;



int main(){
    int n, m; cin >> n >> m;
    int a[m];
    for(int i=0; i<m; i++) cin >> a[i];
    int sum = 0;
    for(int i=0; i<m; i++){
        sum = sum + a[i];
    }
    if(n - sum > 0) 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(x,to) for(int (x)=0;(x)<(to);(x)++)
#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define sz(v) (int)(v).size()
using namespace std;
typedef long long ll;
int main()
{
	cin.tie(0);
	ios_base::sync_with_stdio(false);

	int N, M, sum = 0;
	cin >> N >> M;
	rep (i, M)
	{
		int j;
		cin >> j;
		sum += j;
	}
	if (sum > N)
	{
		cout << -1 << '\n';
	}
	else
	{
		cout << 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

#include<cstdio>

int main(){
	int N, M;
	scanf("%d %d", &N, &M);
	for (int i = 0; i < M && N >= 0; ++i)
	{
		int tmp;
		scanf("%d", &tmp);
		N -= tmp;
	}
	printf("%d\n", N >= 0 ? N : -1);
	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;
int main()
{


        ll n,k,sm=0;
        cin>>n>>k;
        vector<int>v;
        for(int i=0; i<k; i++)
        {
            int x;
            cin>>x;
            v.push_back(x);
            sm+=x;
        }

        ll x=n-sm;

        if(x<0)
        {
            cout<<-1<<endl;
        }
        else
        {
            cout<<x<<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.