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

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

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

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

int N, M;
std::vector<int> A;
long long ans;

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

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

import java.util.*;
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
	    int n = in.nextInt();
	    int m = in.nextInt();
        int ar[] = new int[n];
      	int sum=0;
      	for(int i=0;i<m;i++){
          ar[i]=in.nextInt();
          sum+=ar[i];
        }
      	int res = n-sum;
      	
        if(res>0{
          System.out.println(res);
        }
        else
          System.out.println("-1");
          
	}

}


Compiler output:
Main.java:17: error: ')' expected
        if(res>0{
                ^
1 error
Language: C++

#include <iostream>
#include <vector>

int main() {
  using namespace std;

  int N, M;
  cin >> N >> M;
  vector<int> A(M);
  for (auto &e : A) cin >> e;
  
  auto sum_A = accumulate(A.begin(), A.end(), 0);
  auto remaining_days = N - sum_A;
  
  if (remaining_days < 0) {
  	cout << "-1\n";
    return 0;
  }
  
  cout << remaining_days << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: 'accumulate' was not declared in this scope
   12 |   auto sum_A = accumulate(A.begin(), A.end(), 0);
      |                ^~~~~~~~~~
Language: C

#include <iostream>
#include <utility>
#include <vector>
#include <queue>
#include <stack>
#include <array>
#include <algorithm>
#include <numeric>
#include <limits>
#include <string>
#include <regex>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

int main()
{
    int n, m;
    cin >> n >> m;
    for (int i = 0; i < m; i++) {
        int a;
        cin >> a;
        n -= a;
    }
    if (n < 0) cout << -1 << endl;
    else cout << n << 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<functional>
#include<algorithm>
#include<iostream>
#include<iomanip>
#include<cstring>
#include<cstdlib>
#include<utility>
#include<string>
#include<cstdio>
#include<vector>
#include<bitset>
#include<cmath>
#include<ctime>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
using namespace std;
const int inf=2147483647,dx[]={-1,0,1,0},dy[]={0,-1,0,1};// 上 左 下 右
const int N=100005,M=1000005,K=200005,mod=1000000007;
const long long llinf=9223372036854775807ll;
//int & long long
long long n,m,a,s;
int main(){
	cin>>n>>m;
	for(int i=1;i<=m;i++)
		cin>>a,s+=a;
	if(s>n)
	{
		cout<<-1;
		return 0;
	}
	cout<<n-s;
	return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
    long long a,b,c=0,d[1000001];
    string s;
    cin>>a>>b;
    for(i=1;i<=a;i++){
        cin>>d[i];
        c=c+d[i];
    }
    if(c>a){
        cout<<-1;
    }
    if(c<=a){
        if(c==a){
            cout<<0;
        }
        else{
            cout<<a-c;
        }
    }
}

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

/* ****TCIITB**** */

#include<bits/stdc++.h>
#define io          ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); 
#define ll          long long
#define pb          push_back
#define    endl        '\n'
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define rep(i,a,b)    for(ll int i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define time        cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
using namespace std;

#define N  100005

int main()
{
    
    io

    ll n,m;
    cin>>n>>m;
    ll ts=0;
    rep(i,0,m)
    {
        ll x;
        cin>>x;
        ts+=x;
    }
    if(ts>=n)
        cout<<"-1";
    else
        cout<<(n-ts)
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:21: error: expected ';' before '}' token
   42 |         cout<<(n-ts)
      |                     ^
      |                     ;
   43 | 
   44 | }
      | ~
Language: Java

package leetcode.challenge;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

/**
 *
 * @author Milo
 */
public class BackspaceString {
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;
 
        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
 
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
 
        int nextInt() {
            return Integer.parseInt(next());
        }
 
        long nextLong() {
            return Long.parseLong(next());
        }
 
        double nextDouble() {
            return Double.parseDouble(next());
        }
 
        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
    static FastReader in = new FastReader();
    public static void main(String[] args) {
        int t = 1; //in.nextInt();
        while (t-- > 0)
            solve();
    }
 
    public static void solve() {
        
        int N = in.nextInt();
        int M = in.nextInt();
        int t;
        long sum = 0;
        
        for(int i = 0; i < M; ++i){
            t = in.nextInt();
            sum += t;
        }
        if(sum > N){
            System.out.println("-1");
        }else{
            System.out.println((N-sum));
        }
    }
 
    public static int max(int a, int b) {
        return a > b ? a : b;
    }
 
    public static int min(int a, int b) {
        return a < b ? a : b;
    }
 
    public static int gcd(int a, int b) {
        return b == 0 ? a : gcd(b, (a % b));
    }
}


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

#include <iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:8: error: no match for 'operator+=' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   11 |     ans+=A[i];
      |     ~~~^~~~~~
Language: C

/* ****TCIITB**** */

#include<bits/stdc++.h>
#define io          ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); 
#define ll          long long
#define pb          push_back
#define    endl        '\n'
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define rep(i,a,b)    for(ll int i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define time        cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
using namespace std;

#define N  100005

int main()
{
    
    io

    ll n,m;
    cin>>n>>m;
    ll ts=0;
    rep(i,0,m)
    {
        ll x;
        cin>>x;
        ts+=x;
    }
    if(ts>n)
        cout<<"-1";
    else
        cout<<(n-ts);
    
}

Compiler output:
main.c:3:9: 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;
using ll = long long;
#define rep(i,n) for(ll i=0;i<n;i++)
#define all(n) n.begin(),n.end()

int main() {
  int n,m;
  cin >> n >> m;
  vector<int>a(m);
  int sum = 0;
  rep(i,m){
    cin >> a[i];
    sum += a[i];
  }
  cout << (n - sum>=0?n - sum:-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>
using namespace std;
define pi 3.14

int a [10000];

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

Compiler output:
a.cc:3:1: error: 'define' does not name a type
    3 | define pi 3.14
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:13:24: error: 'a' was not declared in this scope
   13 |                 cin >> a[i];
      |                        ^
a.cc:18:25: error: 'a' was not declared in this scope
   18 |                 b = b + a[i];
      |                         ^
Language: C

#include<bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define int long long
#define vec(a,n) vector<int> (a)((n));
#define Vec(a,n) vector<string> (a)((n));
#define twovec(a,n,m) vector<vector<int>> a(n,vector<int>(m,0));
#define Twovec(a,n,m) vector<vector<double>> a(n,vector<double>(m,0));
#define P pair<int,int>
#define All(a) (a).begin(),(a).end()
#define Sort(a) sort(All(a));
#define Reverse(a) reverse(All(a));
#define PQ(n) priority_queue<P,vector<P>,greater<P>> (n)
#define pq(n) priority_queue<int> (n)
#define print(a) cout << (a) << endl
#define printD(a) cout << setprecision(15) << (a) << endl;
using namespace std;
int max_int = 2147483647;
int prime = 10e9+7;
void Debug(auto a);
int nibul(auto a,auto b);
int nibuu(auto a,auto b);
void input(vector<auto>& a,int n);
double PI = 3.14159265358979;
int n;




signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int m;
    cin >> n >> m;
    REP(i,m){
        int tmp;
        cin >> tmp;
        n -= tmp;
    }
    (n>=0)?print(n):print("-1");

    return 0;
}

void Debug(auto a){
    cout << "{ ";
    for(auto b: a){
        cout << b << " ";
    }
    cout << "}" << endl;
}

//key以上の初めてのitr
int nibul(auto a,auto b){return lower_bound(All(a),b) - a.begin();}
//key以下の最後のitr
int nibuu(auto a,auto b){return upper_bound(All(a),b) - a.begin()-1;}

void input(vector<auto>& a,int n){
    REP(i,n){
        cin >> a[i];
    }
}


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 k,n;
	cin>>k>>n;
	for(int i=1;i<=n;i++){
		int x;
		cin>>x;
		k-=x;
	}
	if(k<0){
		cout<<-1<<endl;
	}else{
		cout<<k<<endl;
	}
}


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

#include <iostream>

using namespace std;

int main()

{

	int n,m,i,sum=0;	cin>>n>>m;

       int a[m];

      for(i=0;i<m;i++)

      {

      sum=sum+a[i];

      }

	if(n-sum=>0)

	{

		cout<<n-sum<<endl;

	}

	else

	cout<<"-1"<<endl;

}

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

#include <iostream>
using namespace std;

int main() {
    long n, m, ip, sum=0;
    cin>>n>>m;
    for(int i=0; i<m; i++){
        cin>>ip;
        sum += ip;
    }
    n = n-sum;
    if(n>=0)
        cout<<n<<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>
using namespace std;
#define fast ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
#define fr(i,a,b) for(ll i=a; i<b; i++)
#define fr1(i,a,b) for(ll i=a; i>=b; i--)
#define ll long long int
#define ld long double
#define vi vector<ll>
#define vii vector <pair<ll,ll> >
#define pb push_back
#define md 1000000007
int main()
{
	fast;
	int d,m,sum=0;
	cin >>d>>m;
  	int a[m];
  	for(int i=0;<m;i++)
    {
      cin>>a[i];
      sum+=a[i];
    }
  	if(sum>d)
      cout<<"-1";
  	else
      cout<<d-sum;
	return 0;
}

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

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

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

  long long sum=0;
  for(int i=0; i<n; i++){
	long long k;
    cin>>k;
    sum+=k;
  }
  if(sum>k){
    cout<<"-1";
  }
  else{
    cout<<k - sum;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:10: error: 'k' was not declared in this scope
   14 |   if(sum>k){
      |          ^
Language: C++

#include <iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> A[10010];
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> A[10010];
      |          ^~~
a.cc:10:10: error: 'A' was not declared in this scope
   10 |     cin>>A[i];
      |          ^
Language: C++

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



Compiler output:
a.cc: In function 'int main()':
a.cc:9:29: error: 'sum' was not declared in this scope
    9 |         for(int i=0;i<m;i++)sum+=a[i];
      |                             ^~~
a.cc:10:17: error: 'sum' was not declared in this scope
   10 |         cout<<n-sum;
      |                 ^~~
Language: Java

import java.util.Scanner;
public class Homework{
	public static void main(String[] args){
		Scanner input = new Scanner(System.in);
		int num = input.nextInt();
		int n  = input.nextInt();
		int[] arr = new int[n];
		for (int i = 0; i < arr.length; i++){
			arr[i] = input.nextInt();
		}
		int sum = 0;
		for(int i = 0; i < arr.length;i++){
			sum +=arr[i];
		}
		if (sum >= 0)
			System.out.println(num - sum);
		else
			System.out.println("-1");
		
	}
}

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

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

int main() {
  int N, M;
  cin >> N >> M;
  vector <int>A(M);
  int SUM;
  for(int i = 0; i < M ; i++){
    cin >> A.at(i);
    N-=A.at(i);
    //cout << A.at(i) << endl;
  }
  //cout << SUM << endl;
  //int C=N-(SUM);
  //cout << C << endl;  
  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 sum=0;
    int n,m;cin>>n>>m;
    while(m--){
        int a;
        cin>>a;
        sum+=a;
    }
    if(sum==n) cout<<0;
    else 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, i, S = 0;
  cin >> N >> M;
  while (i = 0; i < M; i++) {
    int Ai;
    cin >> Ai;
    S += Ai;
  }
  if (S <= N) {
    cout << N - S <<endl;
  }
  else if (S > N) {
    cout << - 1 <<endl;
  }
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: expected ')' before ';' token
    7 |   while (i = 0; i < M; i++) {
      |         ~     ^
      |               )
a.cc:7:27: error: expected ';' before ')' token
    7 |   while (i = 0; i < M; i++) {
      |                           ^
      |                           ;
Language: C++

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

int main() {
	// your code goes here
    int n,m;
cin>>n>>m;
int ar[m];
for(int i=0;im;i++)  cin>>ar[i]
;int sum=0;
for(int i=0;i<m;i++) sum+=ar[i];
if(sum>m) cout<<-1<<endl;
else cout<<m-sum<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: 'im' was not declared in this scope; did you mean 'i'?
    9 | for(int i=0;im;i++)  cin>>ar[i]
      |             ^~
      |             i
Language: C

#include<bits/stdc++.h>

using namespace std;


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

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

#include <iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: expected ',' or ';' before 'cout'
   14 |     cout << pl << endl;
      |     ^~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<stdio>
using namespace std;
int main()
{
  int n,m,c=0,x;
  scanf("%d,%d",&n,&m);
  int a[m];
  gets(a);
  for(int i=0;i<m;i++)
  {
    c=c+a[i];
  }
  x=n-c;
  if(x>=0)
  {
    printf("%d",x);
  }
  else
  {
    print("-1");
  } 
  return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
int main(){
    long long a,b,c=0,d[1000001],e[101],f,i,g,h,j,m,n,x,y,z;
    string s;
    cin>>a>>b;
    for(i=1;i<=a;i++){
        cin>>d[i];
        c=c+d[i];
    }
    if(c>a){
        cout<<-1;
    }
    if(c<=a){
        if(c==a){
            cout<<0;
        }
        else{
            cout<<a-c;
        }
    }
}

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

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

int main(){
  int N,M;
  cin >> N >> M;
  
  vector<int> days(M);
  for(int i = 0; i < M; i++){
    cin >> days.at(i);
  }
  
  for(int i = 0; i < M; i++){
    N -= days.at(i);
    
    if(N < 0){cout << -1 << endl;
             return;}
  }
  cout << N << endl;
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:17:14: error: return-statement with no value, in function returning 'int' [-fpermissive]
   17 |              return;}
      |              ^~~~~~
Language: C

n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
if sum(a) > n:
    print(-1)
else:
    print(n - sum(a[::2]) - sum(a[1::2]))



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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |         for(int i=0;i<a;i++)cin>>a[i];
      |                     ~^~
a.cc:9:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |         for(int i=0;i<a;i++)sum+=a[i];
      |                     ~^~
a.cc:9:29: error: 'sum' was not declared in this scope
    9 |         for(int i=0;i<a;i++)sum+=a[i];
      |                             ^~~
a.cc:10:17: error: 'sum' was not declared in this scope
   10 |         cout<<n-sum;
      |                 ^~~
Language: C++

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

int main() {
  int N, M;
  cin >> N >> M;
  answer = 0;
  vector<int> vec(M);

  for (int i = 0; i < M; i++) {
    cin >> vec.at(i);
    answer+= vec.at(i);
  }
  
  cout << N - answer << endl;
  

}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'answer' was not declared in this scope
    7 |   answer = 0;
      |   ^~~~~~
Language: C

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

int main(){

    int n,m;
    cin>> n>> m;
    std::vector<int> v;
    int s = 0,x;
    for(int i = 0;i < m;i++){
        cin>> x;
        v.push_back(x);
    }
    for(int x: v){
        //cout<< x;
        s+= x;
    }
    if(s > n)
        cout<< "-1\n";
    else
        cout<< (n - s)<<endl;
}

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

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int mod = 1e9+7;
//const ll mod = 1e9+7;
const int inf = 0x3f3f3f3f;
const int ninf = 0xc0c0c0c0; 
int main(){
	//freopen("in.txt","r",stdin);
	int n,m;
	int a[10005];
	cin>>n>>m;
	int t;
	int sum=0;
	for(int i=0;i<m;i++){
		cin>>t;
		sum+=t;

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:19:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   19 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C++

#include <iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'pl' was not declared in this scope
   13 |     pl = N - hw
      |     ^~
Language: Java

import java.util.*;
class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
  int n = scan.nextInt();
  int m = scan.nextInt();
  int[] a = new int[m];
  for(int i = 0; i < m; i ++) {
  a[i] = scan.nextInt();
  }
  int sum = 0;
  for(int i = 0; i < a.length; i++) {
  sum += a[i];
  }
  if(n - sum < 0){
  return -1;
  }else{
  return n - sum;
  }



}
}

Compiler output:
Main.java:16: error: incompatible types: unexpected return value
  return -1;
         ^
Main.java:18: error: incompatible types: unexpected return value
  return n - sum;
           ^
2 errors
Language: C

#include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<cmath>
#include<cstdio>
#include<cctype>
#include<cstring>
#include<iomanip>
#include<cstdlib>
#include<ctime>
#include<set>
#include<map>
#include<utility>
#include<queue>
#include<vector>
#include<stack>
#include<sstream>
#include<algorithm>
#define forn(i,a,b)for(int i=(a),_b=(b);i<=_b;i++)
#define fore(i,b,a)for(int i=(b),_a=(a);i>=_a;i--)
#define rep(i,n)for(int i=0,_n=n;i<n;i++)
#define ll long long
#define pii pair<int,int>
#define vi vector<int>
#define vpii vector<pii>
#define m_p make_pair
#define re return
#define pb push_back
#define si set<int>
#define ld long double
#define X first
#define Y second
#define st string
#define ull unsigned long long
#define mod 1000000007
#define INF 1000000007
#define x1 XZVJDFADSPFOE
#define y1 GASDIJSLDAEJF
#define x2 DFDAJKVOHKWIW
#define y2 PSFSAODSXVNMQ
#define LLINF 0x3f3f3f3f3f3f3f3fLL
using namespace std;
inline void read(int &x)
{
	short negative=1;
    x=0;
    char c=getchar();
    while(c<'0' || c>'9')
    {
		if(c=='-')
			negative=-1;
		c=getchar();
	}
    while(c>='0' && c<='9')
        x=(x<<3)+(x<<1)+(c^48),c=getchar();
    x*=negative;
}
ll quickpower(ll n,ll k){
	ll ans=1;
	while(k){
		if(k%2){
			ans*=n;
			ans%=mod;
		}
		n*=n;
		n%=mod;
		k/=2;
	}
	return ans;
}
int main()
{
	ios::sync_with_stdio(0);
	//think twice,code once
	int x,n;
	int a[11111];
	cin>>x>>n;
	rep(i,n)cin>>a[i];
	rep(i,n)x-=a[i];
	x=max(x,-1);
	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.
Language: C

// B.

#include <iostream>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <vector>

using namespace std;

int main(int argc, char *argv[]) {
	int n, m, a;
	cin >> n >> m;
	for (int i = 0; i < m; ++i) {
		cin >> a;
		n -= a;
	}
	cout << max(-1, n) << endl;
	return 0;
}


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

int main()
{
    int N,M;
    cin >> N >> M;
    vector<int> A(M);
    int sum = N;
    for ( int i = 0 ;i < M ; ++i )
    {
        cin >> A.at(i);
        sum = sum - A.at(i);
    }
    if ( sum < 0 )
    {
        cout << "-1" << endl;
    }else{
        cout << sum << endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope
    4 |     cin >> N >> M;
      |     ^~~
a.cc:5:5: error: 'vector' was not declared in this scope
    5 |     vector<int> A(M);
      |     ^~~~~~
a.cc:5:12: error: expected primary-expression before 'int'
    5 |     vector<int> A(M);
      |            ^~~
a.cc:9:16: error: 'A' was not declared in this scope
    9 |         cin >> A.at(i);
      |                ^
a.cc:14:9: error: 'cout' was not declared in this scope
   14 |         cout << "-1" << endl;
      |         ^~~~
a.cc:14:25: error: 'endl' was not declared in this scope
   14 |         cout << "-1" << endl;
      |                         ^~~~
a.cc:16:9: error: 'cout' was not declared in this scope
   16 |         cout << sum << endl;
      |         ^~~~
a.cc:16:24: error: 'endl' was not declared in this scope
   16 |         cout << sum << endl;
      |                        ^~~~
Language: C++

#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
using namespace std;
namespace adaptor = boost::adaptors;
 
void Main()
{
	int N, M;
    int A[M];
  
  	cin >> N;
    cin >> M;
    
    for(int i = 0; i < M; i++){
    	cin >> A[i];
        N = N - A[i];
    }
    
    if(N < 0)
        printf('-1');
    
    
    else
    	printf("%d", N);
	
	
}
 
int main()
{
	std::cin.tie(nullptr);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	Main();
}

Compiler output:
a.cc:2:9: fatal error: boost/multi_array.hpp: No such file or directory
    2 | #include<boost/multi_array.hpp>
      |         ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
using namespace std;

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

    int work_days = 0;
    for (int i=0; i<M; i++) {
        work_days += A[i];
    }
    if (work_days <= N) {
        cout << N-work_days << endl;
    } else {
        cout << -1 << endl;s
    }



    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:28: error: 's' was not declared in this scope
   19 |         cout << -1 << endl;s
      |                            ^
Language: C++

#include <stdio.h>
int main(){

int N,M,int a[1000000],sum;
scanf("%d%d",&N,M);
for(int i=0;i<M;i++) scanf("%d",&a[i]);
for(int i=0;i<M;i++) sum+=a[i];
if(N>=sum) printf("%d",N-sum);
else printf("-1");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: expected unqualified-id before 'int'
    4 | int N,M,int a[1000000],sum;
      |         ^~~
a.cc:6:34: error: 'a' was not declared in this scope
    6 | for(int i=0;i<M;i++) scanf("%d",&a[i]);
      |                                  ^
a.cc:7:22: error: 'sum' was not declared in this scope
    7 | for(int i=0;i<M;i++) sum+=a[i];
      |                      ^~~
a.cc:7:27: error: 'a' was not declared in this scope
    7 | for(int i=0;i<M;i++) sum+=a[i];
      |                           ^
a.cc:8:7: error: 'sum' was not declared in this scope
    8 | if(N>=sum) printf("%d",N-sum);
      |       ^~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: 'else' without a previous 'if'
   13 |   else cout<<N-ans<<endl;
      |   ^~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:17: error: expected primary-expression before '>' token
    6 |         cin>>n>>>m;
      |                 ^
Language: C++

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

int main() {
  int N , M;
  cin >> N >> M;
  
  vector<int> day(M);
  for (int i = 0; i < M; i++) {
    cin >> day.at(i);
  }
  
  int sum = 0; //宿題を終わらせるのにかかる日数
  for (int i = 0;i < M; i++) {
    sum += day.at(i)
  }
  
  if (N > sum ) {
    cout << N - sum << endl;
  }
  else {
    cout << -1 << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:21: error: expected ';' before '}' token
   15 |     sum += day.at(i)
      |                     ^
      |                     ;
   16 |   }
      |   ~
Language: C++

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

int main() {
	int N, M;
  	int total = 0;
  	vector<int> data(M);
  	cin >> N >> M;
  	for(int i=0; i<M; i++){
      cin >> data.at(i);
      total += data.at(i);
    }
  	if((N-total)<0){
    	cout << -1 << endl;
    }
  	else{
      	cout << N-total << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:2: error: expected '}' at end of input
   18 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <iostream>
using namespace std;
define pi 3.14

int a [10000];

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

Compiler output:
a.cc:3:1: error: 'define' does not name a type
    3 | define pi 3.14
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:13:24: error: 'a' was not declared in this scope
   13 |                 cin >> a[i];
      |                        ^
a.cc:18:25: error: 'a' was not declared in this scope
   18 |                 b = b + a[i];
      |                         ^
Language: Java

import java.util.Scanner;
public class Dreamoon{
	public static void main(String[] args){
		Scanner input = new Scanner(System.in);
		int num = input.nextInt();
		int n  = input.nextInt();
		int[] arr = new int[n];
		for (int i = 0; i < arr.length; i++){
			arr[i] = input.nextInt();
		}
		int sum = 0;
		for(int i = 0; i < arr.length;i++){
			sum +=arr[i];
		}
		if (sum >= 0)
			System.out.println(num - sum);
		else
			System.out.println("-1");
		
	}
}

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

#include "bits/stdc++.h"
#define rep(i,b) for(ll i=0;i<b;i++)
#define ll long long
using namespace std;
/*--Input//////////////////////////////////////////////////*/
inline void IN(void){return;}
template <typename First, typename... Rest>
void IN(First& first, Rest&... rest){cin >> first;IN(rest...);return;}
#define SS(T, ...)      T __VA_ARGS__; IN(__VA_ARGS__);
#define SV(type,c,n) vector<type> c(n);for(auto& i:c)cin >> i;
/*--Output/////////////////////////////////////////////////*/
inline int p(void){cout << endl; return 0;}
template<class Head> int p(Head&& head){cout << head;p();return 0;} template<class Head,class... Tail> int p(Head&& head,Tail&&... tail){cout<<head<<" ";p(forward<Tail>(tail)...);return 0;}
struct ProconInit {
    static constexpr bool AUTOFLUSH = false;
    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(15);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;

#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vvvl vector<vector<vector<ll>>>
#define debug(x) cerr<<#x<<" "<<x<<'\n';
#define all(x) (x).begin(),(x).end()
#define bit(n) (1LL<<(n))
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
bool cmp(pair<ll,ll> a, pair<ll,ll> b) { return a.first+a.second > b.first+b.second; }

int main() {
	SS(int,n,m);
	SV(int,a,m);
	int sum=0;
	rep(i,m)sum+=a[i];
	if(sum>n){
		p(-1);
		return 0;
	}
	p(n-sum);
}

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

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

int main(){
    int64_t i,j,k,l;//preparation for
    int64_t n,m;

    cin>>n>>m;

    int a[m],s,d;
    
    s=0;

    for(i=0;i<m;i++){
        cin>>a[i];
        s+=a[i];
    }

    if(n-s<0){
        d=-1;
    }
    else{
        d=n-s;
    }

    cout<<d;
    return 0;
}

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

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

using namespace std;

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

  vector<int> A(m);

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

  int sum = accumulate(A.begin(), A.end(), 0);
  
  cout << (N - sum) << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:12: error: 'N' was not declared in this scope
   27 |   cout << (N - sum) << endl;
      |            ^
Language: C++

#include <iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int>A[10010];
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int>A[10010];
      |          ^~~
a.cc:10:10: error: 'A' was not declared in this scope
   10 |     cin>>A[i];
      |          ^
Language: C

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

int main()
{
    double n, m, x, sum=0;
    cin >> n >> m;

//    int arr[m];

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

    if(sum>n) cout << "-1" <<endl;
    else if (sum==n) cout << "0" <<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 vector<int> vi;
typedef vector<long long> vll;
typedef pair<int,int> pii;
typedef vector< pii > vii;

#define ll          long long
#define ff          first
#define ss          second
#define pb          push_back
#define mkp         make_pair
#define sz          size()

#define forf(a,b,c)    for(int i=a;i<=b;i+=c)
#define forr(a,b,c)    for(int i=a;i>=b;i-=c)
#define all(a)      a.begin(),a.end()
#define mem(a,b)    memset(a,b,sizeof(a))
#define pi          2*acos(0.0)
#define End         return 0;

#define scan1(a)    scanf("%d",&a)
#define scan2(a,b)  scanf("%d %d",&a,&b)
#define scan3(a,b,c)  scanf("%d %d %d",&a,&b,&c)
#define scanl(a)    scanf("%lld",&a)
#define scanll(a,b) scanf("%lld %lld",&a,&b)
#define scanlll(a,b,c) scanf("%lld %lld %lld",&a,&b,&c)

#define print1(a)    printf("%d",a)
#define print2(a,b)  printf("%d %d",a,b)
#define print3(a,b,c)  printf("%d %d %d",a,b,c)
#define printl(a)    printf("%lld",a)
#define printll(a,b) printf("%lld %lld",a,b)
#define printlll(a,b,c) printf("%lld %lld %lld",a,b,c)

#define MAXN        100000007
#define INF 0x3f3f3f3f
//int dx[]={+1,-1,+0,+0};///Four Directions
//int dy[]={+0,+0,+1,-1};///Four directions
//int dx [] = {+1,-1,+0,+0,-1,-1,+1,+1};///Eight Directions
//int dy [] = {+0,+0,+1,-1,+1,-1,-1,+1};///Eight Directions

//int mark[10007];vi prime;void seive(){for(int i=2;i<10000;i++){if(mark[i]==0){prime.pb(i);for(int j=i+i;j<=10000;j+=i)mark[j]=1;}}}

//freopen("input.txt", "r", stdin);

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

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

   vi v(m+3);
   for(int i=0;i<m;i++) cin>>v[i];

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

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


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

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

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

using namespace std;

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

  vector<int> A(N);

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

  int sum = accumulate(A.begin(), A.end(), 0);

  int rest = N - sum;
  
  cout << ((rest > 0) ? rest : -1) << endl;
  return 0;
}


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

//#include "bits/stdc++.h"

#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>
#include<iomanip>
#include<unordered_set>
#include<unordered_map>
#include<bitset>
#include<complex>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

//typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

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

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD =  (int)1e9 + 7;
const double EPS = 1e-9;

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

	int N, M;
	cin >> N >> M;
	int ans = N;
	int A;
	rep(i, 0, M)
	{
		cin >> A;
		ans -= A;
	}

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

	return 0;
}

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

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

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

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

int main(){
  int N,M;
  cin>>N>>M;
  vector<int> data(M);
  int a=0;
  for(int i=0;i<M;i++){
    cin>>data.at(i);
    a+=data(i);
  }
  if(a<N){
    cout<<N-a<<endl;
  }
  else{
    cout<<"-1"<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: no match for call to '(std::vector<int>) (int&)'
   11 |     a+=data(i);
      |        ~~~~^~~
Language: C++

#include<iostream>
using namespace std;
int main()
{int m,n,s=0,k;
cin>>n>>m;
int a[m];
for(int i=0;i<m;i++)
cin>>a[i];
for(int j=0;j<<m;j++)
s=s+a[j];
k=n-s;
if(k>0)
cout<<k
else cout<<-1;
return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:8: error: expected ';' before 'else'
   13 | cout<<k
      |        ^
      |        ;
   14 | else cout<<-1;
      | ~~~~
Language: C++

//Burn It Dowwwnnnnn.....................
#include<bits/stdc++.h>
#define pi acos(-1)
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    long long int i,j,k,l,a,b,c,d,q,s,n,m,t=1;
//    cin>>t;
    for(j=0; j<t; j++)
    {
        vector<long long int>vv;
        map<long long int,long long int>uu;
        cin>>n>>m;
        k=0;
        for(i=0; i<m; i++)
        {
            cin>>o;
            k+=o;
        }
        if(k>n)
        {
            cout<<-1<<endl;
        }
        else
        {
            cout<<n-k<<endl;
        }

    }
}



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

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds; 
using namespace std;
#define int long long
#define ll long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define mll map<ll,ll>
#define mii map<int,int>
#define mp make_pair
#define pb push_back
#define rep(i,b) for(ll (i)=0;i<(b);i++)
#define all(c) (c).begin(), (c).end()
#define F first
#define S second
#define CLR(p) memset(p, 0, sizeof(p))
#define SET(p) memset(p, -1, sizeof(p))
#define DEBUG true
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);
//typedef long long int ll;
typedef tree<int, null_type, less<int>, rb_tree_tag, 
tree_order_statistics_node_update> new_data_set; 
const int MAX=1e6+5;
#define MOD 1000000007
/*std::cout << std::fixed;
std::cout << std::setprecision(6);*/
//(a%mod-b%mod+mod)%mod

// #define LOCAL 1

/************************************


 
*************************************/

vector<int>par,dep,tin,tout;
vector<vector<int>>v;
vector<int>deg;
vector<pll>req;
bool visited[MAX];






void solve(){
    int t=1;
    // cin>>t;
    while(t--){
        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<<endl;
        }
        else{
            cout<<n-sum<<endl;
        }
        

        
    }
}


signed main() 
{ 
    boost;

    #ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    while (cin.peek() != EOF) {
        solve();
        cout << endl << endl;
        string s;
        do getline(cin, s);
        while (!cin.eof() && !s.empty());
        while (isspace(cin.peek())) cin.get();
    }
    #else
        solve();
    #endif




    

    
	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 count = 0;
    while(m)
    {
        int t;
        cin>>t;
        count += t;
        m--;
    }
    if(count > n)
    {
        cout<<"-1"<<endl;
    }
    else
    {
        cout<<(n-count)<<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.