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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'longlong' was not declared in this scope
    5 |         longlong n,m,a[m];
      |         ^~~~~~~~
a.cc:6:14: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |         cin>>n>>m;
      |              ^
      |              yn
a.cc:6:17: error: 'm' was not declared in this scope; did you mean 'tm'?
    6 |         cin>>n>>m;
      |                 ^
      |                 tm
a.cc:9:22: error: 'a' was not declared in this scope
    9 |                 cin>>a[i];
      |                      ^
a.cc:13:20: error: 'a' was not declared in this scope
   13 |                 n-=a[i];
      |                    ^
Language: C

#include <iostream>
using namespace std ;
typedef long long ll ;
int main()
{
	ll m , n , a ;
	cin >> n >> m ;
	for(ll i = 0 ; i < m ; i++ )
	{
		cin >> a ;
		n -= a ;
	}
	if(a < 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 <stdio.h>
#include <math.h>

void main() {
	int i, N, M, ans; int s = 0;
  	scanf("%d%d", &N, &M);
	int A[M];
    for(i=0; i<M; i++){
    	scanf("%d", A[i]);
      	s += A[i];
    }
	ans = N - s;
    if(ans > -1){
    	printf("%d\n", ans);
    }else{
    	printf("-1\n");
    }

}

Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
main.c: In function 'main':
main.c:6:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    6 |         scanf("%d%d", &N, &M);
      |         ^~~~~
main.c:3:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    2 | #include <math.h>
  +++ |+#include <stdio.h>
    3 | 
main.c:6:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    6 |         scanf("%d%d", &N, &M);
      |         ^~~~~
main.c:6:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:14:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   14 |         printf("%d\n", ans);
      |         ^~~~~~
main.c:14:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:14:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:14:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:16:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   16 |         printf("-1\n");
      |         ^~~~~~
main.c:16:9: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
int N,M;
int A=0;
int day[1000];
cin>>N>>M;
for(int i = 0; i<M;i++){
cin>>day[i];
A+=day[i];
};

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

return 0;

Compiler output:
a.cc:18:12: warning: multi-character character constant [-Wmultichar]
   18 |     cout<< '-1' <<endl;
      |            ^~~~
a.cc: In function 'int main()':
a.cc:21:10: error: expected '}' at end of input
   21 | return 0;
      |          ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C

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

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

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

// Optimization

//#pragma GCC optimize("O3")
#define endl '\n'

// Shortcut

#define int long long
#define eb emplace_back
#define pb push_back
#define pob pop_back
#define mp make_pair
#define upb upper_bound
#define lwb lower_bound
#define fi first
#define se second
#define For(i, l, r) for (int i = l; i < r; i++)
#define ForE(i, l, r) for (int i = l; i <= r; i++)
#define Ford(i, r, l) for (int i = r; i > l; i--)
#define FordE(i, r, l) for (int i = r; i >= l; i--)
#define Fora(i, a) for (auto i : a)

// I/O & Debug

#define PrintV(a) Fora(iiii, a) cout << iiii << ' '; cout << endl;
#define PrintVl(a) Fora(iiii, a) cout << iiii << endl;
#define PrintA(a, l, r) for (int iiii = l; iiii <= r; iiii++) cout << a[iiii] << ' '; cout << endl;
#define PrintAl(a, l, r) for (int iiii = l; iiii <= r; iiii++) cout << a[iiii] << endl;
#define Ptest(x) return cout << x, 0;
#define gl(s) getline(cin, s);
#define setpre(x) fixed << setprecision(x)
/*
#define debug(args...){ string _sDEB = #args; replace(_sDEB.begin(), _sDEB.end(), ',', ' '); stringstream _ssDEB(_sDEB); istream_iterator<string> _itDEB(_ssDEB); DEB(_itDEB, args); }
void DEB(istream_iterator<string> it) {}
template<typename T, typename... Args>
void DEB(istream_iterator<string> it, T a, Args... args){
    cout << *it << " = " << a << endl;
    DEB(++it, args...);
}
*/

// Functions

//#define isvowel(a) (a == 'a' || a == 'e' || a == 'i' || a == 'o' || a == 'u')
#define bend(a) a.begin(), a.end()
#define rbend(a) a.rbegin(), a.rend()
#define mset(a) memset(a, 0, sizeof(a))
#define mset1(a) memset(a, 1, sizeof(a))
#define msetn1(a) memset(a, -1, sizeof(a))
#define msetinf(a) memset(a, 0x3f, sizeof(a))
#define gcd __gcd
#define __builtin_popcount __builtin_popcountll
//mt19937 rando(chrono::steady_clock::now().time_since_epoch().count());

// Data Structure

#define pque priority_queue
#define mts multiset
#define y0 _y0_
#define y1 _y1_
#define div divi
typedef long long ll;
typedef long double ld;
typedef vector <int> vi;
typedef vector <ll> vll;
typedef vector <ld> vld;
typedef vector <string> vs;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <vi > vvi;
typedef vector <vll > vvll;
typedef vector <pii > vpii;
typedef vector <pll > vpll;

const int N = 1e5 + 5, mod = 1e9 + 7, mod1 = 998244353, mod2 = 1e9 + 9, inf = 1e18 + 7;
const ll infll = 1e18 + 7;

signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int n, m; cin >> n >> m;
    ForE(i, 1, m){
        int x; cin >> x; n -= x;
    }
    if (n < 0) Ptest(-1);
    cout << n;
}

/*
==================================+
INPUT:                            |
------------------------------    |

------------------------------    |
==================================+
OUTPUT:                           |
------------------------------    |

------------------------------    |
==================================+
*/

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


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


// Author by Md. Jashim Uddin_RMSTU

#include<bits/stdc++.h>
using namespace std;
#define     sf(a)           scanf("%d",&a)
#define     sff(a,b)        scanf("%d %d",&a,&b)
#define     sfff(a,b,c)     scanf("%d %d %d",&a,&b, &c)
#define     pb              push_back
#define     ll              long  long
#define     fast            ios_base :: sync_with_stdio(false);cin.tie(0)
#define     pi              2*acos(0)
#define     sp              fixed<<setprecision
#define     lcm(a,b)        (a*b)/gcd(a,b)
#define     gcd(a,b)        _gcd(a,b)
#define     forn(i,n)       for(int i=1;i<=n;i++)
#define     min3(a,b,c)     min(a,min(b,c))
#define     M             32000
int main()
{


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


}
v

Compiler output:
a.cc:38:1: error: 'v' does not name a type
   38 | v
      | ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: 'i' was not declared in this scope
    7 |   for(i=0; i<M; i++){
      |       ^
a.cc:11:13: error: expected ';' before '}' token
   11 |     sum += A
      |             ^
      |             ;
   12 |   }
      |   ~          
a.cc:14:8: error: 'sum' was not declared in this scope
   14 |   if(N-sum >= 0){
      |        ^~~
Language: C

//
//  main.cpp
//  HelloWorld
//
//  Created by purple on 2020/04/13.
//  Copyright © 2020 Purple. All rights reserved.
//

#include <iostream>
#include <algorithm>
#include <string>
#include <fstream>

using namespace std;

int main(int argc, const char * argv[]) {
    // insert code here...


    
    int n,m;
    
    cin >> n >> m;
    
    int a[m];
    
    for(int i=0; i<m; i++) std::cin >> a[i];

    int total =0;

    for(int i=0; i<m; i++) {
        total = total + a[i] ;
    }
    
    if((n-total) < 0)
        cout << -1 << endl;
    else
        cout << n-total << endl;
    
    return 0;
    
}


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

#include<stdio.h>
int main()
{
  int date, HW, HWdate, HWsum = 0, play;
  scanf("%d", &date);
  scanf("%d",&HW);
  for(i=0;i<HW;i++){
    HEdate = 0;
    scanf("%d",&HWdate);
    HWsum = HWsum + HWdate;
  }
  play = date - HWsum;
  
  if(play<0){
    play = -1;
  }
 
  printf("%d",play);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:7: error: 'i' undeclared (first use in this function)
    7 |   for(i=0;i<HW;i++){
      |       ^
main.c:7:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:5: error: 'HEdate' undeclared (first use in this function); did you mean 'HWdate'?
    8 |     HEdate = 0;
      |     ^~~~~~
      |     HWdate
Language: C++

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

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

Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | v#include<bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'v' does not name a type
    1 | v#include<bits/stdc++.h>
      | ^
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope
    7 |     cin >> n >> m;
      |     ^~~
a.cc:14:9: error: 'cout' was not declared in this scope
   14 |         cout << ans << endl;
      |         ^~~~
a.cc:14:24: error: 'endl' was not declared in this scope
   14 |         cout << ans << endl;
      |                        ^~~~
a.cc:16:9: error: 'cout' was not declared in this scope
   16 |         cout << "-1" << endl;
      |         ^~~~
a.cc:16:25: error: 'endl' was not declared in this scope
   16 |         cout << "-1" << endl;
      |                         ^~~~
Language: C++

#include <iostream>

using namespace std;

int main ()
{
  long int a; int b;
  cin >> a >> b;
  int c[const_cast<const int>(b)];
  for (int i = 0; i < b; i++) {
      cin >> c[i]; }
     long int d = 0;
     for (int i = 0; i < b; i++) {
         d += c[i]; }
    cout << (a < d ? -1 : a - d) << '\n';
    }
     
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: invalid use of 'const_cast' with type 'const int', which is not a pointer, reference, nor a pointer-to-data-member type
    9 |   int c[const_cast<const int>(b)];
      |         ^~~~~~~~~~~~~~~~~~~~~~~~
a.cc:11:14: error: 'c' was not declared in this scope
   11 |       cin >> c[i]; }
      |              ^
a.cc:14:15: error: 'c' was not declared in this scope
   14 |          d += c[i]; }
      |               ^
Language: C

#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string>
using namespace std;

int main(void){
    int N,M;
  	scanf("%d %d", &N,&M);
    int l, i=0, a[M];
    while(cin>>l){
        a[i] = l;
        i++;
    }
  	int sum = 0;
  	for(i=0;i<M;i++){
      sum = sum+a[i];
    }
  	int ans = N-sum;
  	printf("%d",ans);
	}
 

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

import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner scn = new Scanner(System.in);
        int N,M = INteger.valueOf((scn.nextLine()).split(" "));
        int[] Am = new int[M];
        Am = INteger.valueOf((scn.nextLine()).split(" "));
        int sum = 0;
        int result = 0;
        for(int i=0;i<M;i++){
            sum += Am[i];
        }
        if(N > sum){
            result = N -sum;
        }else{
            result = -1;
        }
        System.out.println(result);

    }
}

Compiler output:
Main.java:5: error: cannot find symbol
        int N,M = INteger.valueOf((scn.nextLine()).split(" "));
                  ^
  symbol:   variable INteger
  location: class Main
Main.java:7: error: cannot find symbol
        Am = INteger.valueOf((scn.nextLine()).split(" "));
             ^
  symbol:   variable INteger
  location: class Main
2 errors
Language: C

#include<iostream>
using namespace std;

int main(){
	int n,m;
	cin>>n>>m;
	
	int a[m],sum=0;
	for(int i=1;i<=m;i++)	cin>>a[i];  
	
	for(int i=1;i<=m;i++)  sum+=a[i];
	
	if(n<sum)  cout<<-1<<endl;
	else       cout<<n-sum<<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(){
	long long int n,m;
	cin>>n>>m;
	long long int sum = 0;
	long int a;
	for(long int i = 0; i<m;i++){
		cin>>a;
		sum+=a;
		}
	(n>sum)? cout<<n-sum : 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<stdio.h>
int main()
{
  int date, HW, HWdate, HWsum = 0, play;
  scanf("%d", date);
  scanf("%d",HW);
  for(i=0;i<HW;i++){
    HEdate = 0;
    scanf("%d",&HWdate);
    HWsum = HWsum + HWdate;
  }
  play = date - HWsum;
  
  if(play<0){
    play = -1;
  }
 
  printf("%d",play);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:7: error: 'i' undeclared (first use in this function)
    7 |   for(i=0;i<HW;i++){
      |       ^
main.c:7:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:5: error: 'HEdate' undeclared (first use in this function); did you mean 'HWdate'?
    8 |     HEdate = 0;
      |     ^~~~~~
      |     HWdate
Language: Java

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

    public void main(){
        ArrayList<Integer> list = new ArrayList<Integer>();
        int N=42;
        int M=2;
        int[] Ai = {5, 6};
        int Answer;
        for(int i=0; i<M; i++){
            Answer = N - Ai[i];
        }
        if(Answer < 0){
            System.out.println(-1);
        }else{
            System.out.println(Answer);
        }
    }


Compiler output:
Main.java:5: error: unnamed classes are a preview feature and are disabled by default.
    public void main(){
           ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: C

include<stdio.h>
int main()
{
  int date, HW, HWdate, HWsum = 0, play;
  scanf("%d", date);
  scanf("%d",HW);
  for(i=0;i<HW;i++){
    HEdate = 0;
    scanf("%d",&HWdate);
    HWsum = HWsum + HWdate;
  }
  play = date - HWsum;
  
  if(play<0){
    play = -1;
  }

  printf("%d",play);
  
  return 0;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: Java

import com.company.LineReader;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) {
        FastReader s=new FastReader();
        int n = s.nextInt();
        int m = s.nextInt();

        long total = 0;
        for (int i = 0; i < m; i++) {
            total += s.nextInt();
        }
        long diff = n - total;
        if(diff <0){
            System.out.println("-1");
        }else{
            System.out.println(diff);
        }
    }

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



Compiler output:
Main.java:1: error: package com.company does not exist
import com.company.LineReader;
                  ^
1 error
Language: C++

#include <iostream>

using namespace std;

int main ()
{
  long int a; int b;
  cin >> a >> b;
  int c [const_cast<const int>(b)];
  for (int i = 0; i < b; i++) {
      cin >> c[i]; }
     long int d = 0;
     for (int i = 0; i < b; i++) {
         d += c[i]; }
    cout << (a < d ? -1 : a - d) << 'n\';
    }
     
  
  


Compiler output:
a.cc:15:37: warning: missing terminating ' character
   15 |     cout << (a < d ? -1 : a - d) << 'n\';
      |                                     ^
a.cc:15:37: error: missing terminating ' character
   15 |     cout << (a < d ? -1 : a - d) << 'n\';
      |                                     ^~~~~
a.cc: In function 'int main()':
a.cc:9:10: error: invalid use of 'const_cast' with type 'const int', which is not a pointer, reference, nor a pointer-to-data-member type
    9 |   int c [const_cast<const int>(b)];
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
a.cc:11:14: error: 'c' was not declared in this scope
   11 |       cin >> c[i]; }
      |              ^
a.cc:14:15: error: 'c' was not declared in this scope
   14 |          d += c[i]; }
      |               ^
a.cc:16:5: error: expected primary-expression before '}' token
   16 |     }
      |     ^
Language: C

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


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

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

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

  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'strings' was not declared in this scope; did you mean 'stdin'?
    7 |   strings S;
      |   ^~~~~~~
      |   stdin
a.cc:9:6: error: 'S' was not declared in this scope
    9 | cin>>S[i];
      |      ^
a.cc:13:6: error: 'S' was not declared in this scope
   13 | sum+=S[i];
      |      ^
Language: C

N, M = [int(x) for x in input().split()]
L = [int(x) for x in input().split()]

print(N - sum(L))

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | N, M = [int(x) for x in 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 = [int(x) for x in input().split()]
      |    ^
main.c:1:8: error: expected expression before '[' token
    1 | N, M = [int(x) for x in input().split()]
      |        ^
main.c:2:1: error: expected ',' or ';' before 'L'
    2 | L = [int(x) for x in input().split()]
      | ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'vin' was not declared in this scope; did you mean 'sin'?
    9 |     vin >> V.at(i);
      |     ^~~
      |     sin
Language: C

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


ll combination(ll n, ll r){
    if(n < r) return 0;
    if(r == 0||r == n) return 1;
    else if(r == 1) return n;
    return (combination(n - 1, r - 1) + combination(n - 1, r));
}

bool checkKaibun(string str){
    string checkStr = str;
    reverse(checkStr.begin(), checkStr.end());
    if(str == checkStr) return true;
    else return false;
}

int keta(ll num){
    int digits = 0;
    while(num > 0){
        num /= 10;
        digits++;
    }
    return digits;
}


ll mpow(ll x, ll n){//繰り返し二乗法 計算量O(logN)
    ll ans = 1;
    while(n != 0){
        if(n&1) ans = ans * x % MOD;
        x = x * x % MOD;
        n  = n >> 1;
    }
    return ans;
}

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



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

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

#include <iostream>

using namespace std;

int main ()
{
  long int a; int b;
  cin >> a >> b;
  int c [const_cast<const int>(b)];
  for (int i = 0; i < b; i++) {
      cin >> c[i]; }
     long int d = long int(0);
     for (int i = 0; i < b; i++) {
         d += c[i]; }
    cout << (a < d ? -1 : a - d) << 'n\';
    }
     
  
  

Compiler output:
a.cc:15:37: warning: missing terminating ' character
   15 |     cout << (a < d ? -1 : a - d) << 'n\';
      |                                     ^
a.cc:15:37: error: missing terminating ' character
   15 |     cout << (a < d ? -1 : a - d) << 'n\';
      |                                     ^~~~~
a.cc: In function 'int main()':
a.cc:9:10: error: invalid use of 'const_cast' with type 'const int', which is not a pointer, reference, nor a pointer-to-data-member type
    9 |   int c [const_cast<const int>(b)];
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
a.cc:11:14: error: 'c' was not declared in this scope
   11 |       cin >> c[i]; }
      |              ^
a.cc:12:19: error: expected primary-expression before 'long'
   12 |      long int d = long int(0);
      |                   ^~~~
a.cc:14:15: error: 'c' was not declared in this scope
   14 |          d += c[i]; }
      |               ^
a.cc:16:5: error: expected primary-expression before '}' token
   16 |     }
      |     ^
Language: C++

#include <iostream>

int main() {
	int d_max, cnt;
	std::cin >> d_max >> cnt;
  
	for(int i = 0; i < cnt; ++i) {
		int n;
      	std::cin >> n;
		d_max -= n;
    }
  
  	std::cout << (d_max >= 0 : d_max : -1) << std::endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:33: error: expected ')' before ':' token
   13 |         std::cout << (d_max >= 0 : d_max : -1) << std::endl;
      |                      ~          ^~
      |                                 )
Language: C

#include<bits/stdc++.h>
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 sum=0;
for(int i=0;i<m;i++)
{
	sum=sum+a[i];
}
if(n<sum)
{
	cout<<"-1"<<endl;
}
if(n==sum)
{
	cout<<"0"<<endl;
}
if(n>sum)
{
	int b=n-sum;
	cout<<b<<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,count;
    count = 0;
    cin >> N >> M;
    for(int i=0;i<M;i++){
    int a;
    cin >> a;
    count +=a;
    }
    if(N>=count)
    cout << N-count << 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: Java

import java.util.*;

public class Circle {

	public static void main(String[] args) {

	Scanner s = new Scanner(System.in);
		int m = s.nextInt();
		int n = s.nextInt();

		ArrayList<Integer> arr = new ArrayList<Integer>();
		int sum = 0;
		for (int i = 0; i < n; i++)
			sum += s.nextInt();

		if (sum > m)
			System.out.println(-1);
		else
			System.out.println(m - sum);
}

}


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

#include <iostream>
#include <string>
#include <sstream>

using namespace std;

int sum_digits(int n)
{
＿＿int sum = 0;
＿＿ostringstream ostr;
＿＿unsigned int i;

＿＿ostr << n;

＿＿for (i = 0; i < ostr.str().length(); i++){
＿＿＿＿sum += ostr.str().at(i) - '0';
}
＿＿if(sum > N){
cout << -1 << endl;
}
else{
cout << N - sum << endl;
}
}


Compiler output:
a.cc: In function 'int sum_digits(int)':
a.cc:9:1: error: '\U0000ff3f\U0000ff3fint' was not declared in this scope
    9 | ＿＿int sum = 0;
      | ^~~~~~~
a.cc:10:1: error: '\U0000ff3f\U0000ff3fostringstream' was not declared in this scope
   10 | ＿＿ostringstream ostr;
      | ^~~~~~~~~~~~~~~~~
a.cc:11:1: error: '\U0000ff3f\U0000ff3funsigned' was not declared in this scope
   11 | ＿＿unsigned int i;
      | ^~~~~~~~~~~~
a.cc:13:1: error: '\U0000ff3f\U0000ff3fostr' was not declared in this scope
   13 | ＿＿ostr << n;
      | ^~~~~~~~
a.cc:15:10: error: 'i' was not declared in this scope
   15 | ＿＿for (i = 0; i < ostr.str().length(); i++){
      |          ^
a.cc:15:21: error: 'ostr' was not declared in this scope
   15 | ＿＿for (i = 0; i < ostr.str().length(); i++){
      |                     ^~~~
a.cc:18:8: error: 'sum' was not declared in this scope
   18 | ＿＿if(sum > N){
      |        ^~~
a.cc:18:14: error: 'N' was not declared in this scope
   18 | ＿＿if(sum > N){
      |              ^
a.cc:18:1: error: '\U0000ff3f\U0000ff3fif' was not declared in this scope
   18 | ＿＿if(sum > N){
      | ^~~~~~
a.cc:21:1: error: 'else' without a previous 'if'
   21 | else{
      | ^~~~
a.cc:24:1: warning: no return statement in function returning non-void [-Wreturn-type]
   24 | }
      | ^
Language: C

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

#define ll long long

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


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

#include<stdio.h>
#include<algorithm>
#include<iostream>
#include<stdlib.h>
using namespace std;


int main(){

  long n,m,i;
  long total=0;
  cin>>n>>m;

  long a[i];
  for(i=0; i<m; i++){
    scanf("%ld",&a[i]);
    int total=total+a[i];
  }

  if(total>n){
    printf("-1\n");
  }else{
    printf("%ld\n",n-total);
  }

  return 0;
}

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

#include <bits/stdc++.h>
#define ll long long int
#define MOD 1000000007
#define INF 1e18

using namespace std;

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


  cout << max(-1LL, 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;

int main(){
  int N,M;
  cin >> N >> M;
  vector<int> V;
  for(int i=0;i<M;i++;){
    vin >> V.at(i);
  }
  int P = 0;
  for(int i=0;i<m;i++){
    P += V.at(i);
  }
  if(N-P>=0)
    cout << N-P;
  else
    cout << "-1";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: expected ')' before ';' token
    8 |   for(int i=0;i<M;i++;){
      |      ~               ^
      |                      )
a.cc:8:23: error: expected primary-expression before ')' token
    8 |   for(int i=0;i<M;i++;){
      |                       ^
a.cc:12:17: error: 'm' was not declared in this scope
   12 |   for(int i=0;i<m;i++){
      |                 ^
Language: C++

#include <iosttream>

int main() {
	int d_max, cnt;
	std::cin >> d_max >> cnt;
  
	for(int i = 0; i < cnt; ++i) {
		int n;
      	std::cin >> n;
		d_max -= n;
    }
  
  	std::cout << (d_max >= 0 : d_max : -1) << std::endl;
}


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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:6: error: expected ',' or ';' before 'cin'
   10 |      cin >> Ai;
      |      ^~~
a.cc:13:7: error: 'sum' was not declared in this scope
   13 |   if (sum > N){
      |       ^~~
Language: C

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

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

  for (int i = 0; i < M; i++) {
    cin >> A.at(i);
    answer+= A.at(i);
  }
  
  cout << N - answer << 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;
  
  vector<int> a(m);
  for(int i=0; i<m; i++){
    cin >> a[m];
  }
 
  int s =0;
  for(int i=0; i<m; i++){
    s += a[m];
  }

  if(a>=s){
     cout << a-s << endl;
  }
  else if(a<s){
    cout << -1 << endl;
  }
}


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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:6: error: expected ',' or ';' before 'cin'
   10 |      cin >> Ai;
      |      ^~~
a.cc:11:14: error: expected ';' before '}' token
   11 |      sum +=Ai
      |              ^
      |              ;
   12 |   }
      |   ~           
a.cc:13:7: error: 'sum' was not declared in this scope
   13 |   if (sum > N){
      |       ^~~
Language: C

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


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



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

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

date = sum(a)
if n-date <= 0:
    print(-1)
else:
    print(n-date)


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

#include <iostrteam>

int main() {
	int d_max, cnt;
	std::cin >> d_max >> cnt;
  
	for(int i = 0; i < cnt; ++i) {
		int n;
      	std::cin >> n;
		d_max -= n;
    }
  
  	std::cout << (d_max >= 0 : d_max : -1) << std::endl;
}


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

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

#include<stdio.h>
int main()
{
int N,M;
int c,d,s;
int sum=0;
int A[10000];
scanf("%d%d\n",&N,&M);
if(N>=1||N<=10^6 && M>=1||M<=10^4)
{
  for(int i=0;i<M;i++)
    {
      scanf("%d",&A[i]);
      sum=sum+A[i];
    }
c=N-i;
d=M-sum;
s=c-d;
printf("%d",s);

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

return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:5: error: 'i' undeclared (first use in this function)
   16 | c=N-i;
      |     ^
main.c:16:5: note: each undeclared identifier is reported only once for each function it appears in
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

#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
  int N,M;
  int A=0;
  int day[1000];
  cin>>N>>M;
  for(int i = 0; i<M;i++){
      cin>>day[i];
  }
  for(int i = 0; i<M;i++){
      A += day[i];
  }
  if((N-A)>=0){
      cout<<N-A<<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<stdio.h>

int add(int a[],int size);

int main()
{
    int n,m;
    scanf("%d %d",&n,&m);
    int arr[m];
    for(int i=0;i<m;i++)
    {
        scanf("%d",&arr[i]);
    }
    int sum = add(arr,m);
    int ans = n-sum;
    if(ans<0)
    {
        printf("-1");
    }
    else
    {
        printf("%d",ans);314 15
9 26 5 35 8 9 79 3 23 8 46 2 6 43 3314 15
9 26 5 35 8 9 79 3 23 8 46 2 6 43 3
    }
}

int add(int a[],int size)
{
    int s = 0;
    for(int i=0;i<size;i++)
    {
        s+=a[i];
    }
    return s;
}


Compiler output:
main.c: In function 'main':
main.c:22:29: error: expected ';' before numeric constant
   22 |         printf("%d",ans);314 15
      |                             ^~~
      |                             ;
Language: C

#include<stdio.h>
int main() {
	int N, M, i, AM=0;
	int A[1000];

	scanf_s("%d""%d", &N,&M);
	for (i = 0; i < M; i++) {
		scanf_s("%d", &A[i]);
	}
	for (i = 0; i < M; i++) {
		AM += A[i];
	}
	if (AM > N) {
		printf("-1");
	}
	if (AM < N) {
		printf("%d", N - AM);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    6 |         scanf_s("%d""%d", &N,&M);
      |         ^~~~~~~
      |         scanf
Language: C++

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

int main() {
	cin >> m >> n;
	vector <ll> ans(m);
	rep(i, n) cin >> ans[i];
	rep(i, n) {
		m = m - ans[i];
	}
	if (m >= 0) {
		cout << m;
	}
	else {
		cout << "-1";
	}
	return 0;
}

Compiler output:
a.cc:1:2: 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:5:11: error: 'pair' does not name a type
    5 | using p = pair<int, int>;
      |           ^~~~
a.cc: In function 'int main()':
a.cc:9:9: error: 'cin' was not declared in this scope
    9 |         cin >> m >> n;
      |         ^~~
a.cc:10:9: error: 'vector' was not declared in this scope
   10 |         vector <ll> ans(m);
      |         ^~~~~~
a.cc:10:19: error: expected primary-expression before '>' token
   10 |         vector <ll> ans(m);
      |                   ^
a.cc:10:21: error: 'ans' was not declared in this scope
   10 |         vector <ll> ans(m);
      |                     ^~~
a.cc:16:17: error: 'cout' was not declared in this scope
   16 |                 cout << m;
      |                 ^~~~
a.cc:19:17: error: 'cout' was not declared in this scope
   19 |                 cout << "-1";
      |                 ^~~~
Language: C++

#include <cstdlib>
#include <iostream >
#include <vector>
using namespace std;
int main()
{
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(NULL);
    long long n ,m;
    cin >> n>>m;
    int s = 0;
    while(m--)
    {
        int a;
        cin >> a;
        s += a;

    }
    if(n-s<0)
        cout << "-1";
    else
    cout << n - s;
}

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

#include <bits/stdc++.h>

using namespace std;

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

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

  s = 0;
  rep(i, m) {
    cin >> a;
    s += a;
  }

  int r = n - s;
  if (r < 0) {
    r = -1;
  }
  cout << r << endl;
}


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

import java.util.Scanner;

public class Main {
	public static void main(String[] args){

		Scanner sc = new Scanner(System.in);

		int day = sc.nextInt();
		int work_count = sc.nextInt();

		int homework [] = new int[work_count];

		for (int i = 0; i < work_count; i++) {
			homework[i] = sc.nextInt();
		}

		int sum = 0;

		for (int i = 0; i < work_count; i++) {
			sum += homework[i]
		}

		if (day >= sum) {
			System.out.print(day - sum);
		} else {
			System.out.print(-1);
		}

	return;

	}
}


Compiler output:
Main.java:20: error: ';' expected
			sum += homework[i]
			                  ^
1 error
Language: C++

#include"pch.h"
#include <iostream>
#include<vector>
using namespace std;
int main()
{
	int N, M;
	int c = 0;
	cin >> N;
	cin >> M;
	vector<int>A(M);
	for (int i = 0; i < M; i++) {
		cin >> A[i];
		c = c + A[i];
	}
	if (c > N)
		cout << -1;
	else {
		cout << N - c;
	}
	return 0;
}


Compiler output:
a.cc:1:9: fatal error: pch.h: No such file or directory
    1 | #include"pch.h"
      |         ^~~~~~~
compilation terminated.
Language: C

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

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

  for (int i = 0; i < M; i++) {
    cin >> vec.at(i);
  }
  int answer = 0;
   for (int i = 0; i < M; i++) {
   answer += vec.at(i);
  }
  
  cout << N - answer << 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;
  vector<int> v(m);
  for (int i=0; i<m; i++) {
  	cin >> v[i];
  }
  int result = accumulate(v.begin(), v.end(), 0);
  if (result > n) {
    cout << -1 << endl;  	
  } else {
    cout << n - result << endl;
  }
}

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

#include<iostream>
#include<cmath>
using namespace std;
int main(void){
    // Your code here!
    
    long long N;
    long M;
    long A[16448];
    long ans;
    
    cin >> N >> M;
    ans = N;
    
    for(int i=0;i<M;i++){
        
        cin >> A[i];
        ans = ans -A[i];
        
    }
    
    if(ans<0){
        ans = -1;
    }

    
    cout << ans <<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 <iostream>

using namespace std;
 
    
    
int main(){
  int n,m;
  cin>>n>>m;
  int day[m];
  
  for (int i = 0; i < m; i++)
  {
    cin>>day[i];
  }
  
  int sum=0;

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

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

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

#include <bits/stdc++.h>
#include <iostream>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;

int main(){
    long a,sum=0;
    cin>>a;
    int b;
    cin>>b;
    int n[b];
    for(int i=0;i<b;i++){
        cin>>n[i];
        sum+=n[i];
    }
    cout<<a-sum;
    return 0;
}

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

#include <iostream>
#include <cmath>

using namespace std;
int main(void){
    // Your code here!
    
    long long N;
    long M;
    long A[16448];
    long ans;
    
    cin >> N >> M;
    ans = N;
    
    for(int i=0;i<M;i++){
        
        cin >> A[i];
        ans = ans -A[i];
        
    }
    
    if(ans<0){
        ans = -1;
    }

    
    cout << ans <<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 m,n,a,sum=0;
	cin >> m >> n;
	for(int i=0;i<n;i++){
		cin >> a;
		sum+=a;
	}
	if(sum>m) cout << -1 << endl;
	else cout << m-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: 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;
  }
  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>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: expected initializer before 'int'
    8 |   int sum = 0;
      |   ^~~
a.cc:10:12: error: 'A' was not declared in this scope
   10 |     cin >> A[i];
      |            ^
a.cc:11:5: error: 'sum' was not declared in this scope
   11 |     sum += A[i];
      |     ^~~
a.cc:13:10: error: 'sum' was not declared in this scope
   13 |   if(N - sum > 0){
      |          ^~~
Language: C

#include<bits/stdc++.h>
using namespace std;
int main()
{int n , m;
 cin>>n>>m;
 int a[m];
 
 for(int i=0;i<m;i++)
 {  cin>>a[i];
  sum+=a[i];
  
 }
  if(n<sum)
    cout<<-1
    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 <bits/stdc++.h>
using namespace std;

int main(){
    int N, M,L,K;
    cin >> N >> M;
    L = 0;
    vector<int> Ass(M);

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

    for(int j = 0;j<M;j++){
        L = L + Ass.at(j)
    }

    if(N<L)
        K = -1;
    else 
        K = L - N;

    cout << K << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:26: error: expected ';' before '}' token
   15 |         L = L + Ass.at(j)
      |                          ^
      |                          ;
   16 |     }
      |     ~