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

#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
#define REP3(i,x,n) for(int i=x; i>(n); i--)
#define ALL(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
const long long INF = numeric_limits<long long>::max();
int main(){
    ll N,M;
    ll a,sum=0,b;
    scanf("%lld%lld",&N,&M);
    for(ll i=0;i<M;i++){
        scanf("%lld",&a);
        sum += a;
    }
    b= -1;
    if(sum > N) printf("-1\n");
    else printf("%lld\n",N-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<vector>
using namespace std;
       int main()
  {   
     int n,h;
     cin>>n;
     cin>>h;
     vector<int>human;
     int temp;
     for(int i=0;i<n;i++)
     {   
         cin>>temp;
         human.push_back(temp);
     }
   int sum=0;
    for(auto x:human)
    {
        sum=sum+x;
    }
    
   if(sum>n)
     cout<<"-1"<<endl;
    if(sum==n)
    cout<<"0"<<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<iostream>
#include<vector>
using namespace std;
       int main()
 {   int n,h;
     cin>>n;
     cin>>h;
     vector<int>human;
     int temp;
     for(int i=0;i<n;i++)
     {   
         cin>>temp;
         human.push_back(temp);
     }
   int sum=0;
    for(auto x:human)
    {
        sum=sum+x;
    }
     
   if(sum>n)
     cout<<"-1"<<endl;
     if(sum==n)
       cout<<"0"<<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() {
	int n;
	cin>>n;
	int m;
	cin>>m;
	int sum= 0;
	vector<int> a(m);
	for(int i=0 ; i< m; i++){
		int x;
		cin>> x;
		a[i]= x;
		sum+= a[i];
	}
	int k = n-sum;
	if(k<0){cout<<-1;
		return 0;
	}
	cout<<k;
	

Compiler output:
a.cc: In function 'int main()':
a.cc:21:17: error: expected '}' at end of input
   21 |         cout<<k;
      |                 ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C

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

int main(){
  int x,n,m;
  cin>>n>>m;
  vector<int> arr;
  for(int i=0;i<m;i++){
  	cin>>x;
    arr.push_back(x);
  }
  int sum=0;
  for(auto i :arr){
  	sum+=i;
  }
  if(sum>n){
  cout<<-1;
    return 0;
  }
  else{
  cout<<n-m;
  }
}

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;
main()
{
int N,M,z,s=0;
cin>>N>>M;
vector<int> A;
for(int i=0; i<A.size();i++)
{
	cin>>z;
	A.push_back(z);
}
for(int i=0;i<A.size();i++)
{
	s=s+A[i];
}
if(s<N)
{
	cout<<N-s<<endl;
}
else{
	cout<<-1<<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<iostream>

using namespace std;

int main()
{
    int N,M;
    cin >> N >> M;
    int A[10000];
    for(int i=0;i<M;i++)
        cin >> A[i];
        int s=0;
    for(int i=0;i<M;i++)
        s+=A[i];
        if(s>N)
        {
            cout << "-1";
        }
        else
        {
            cout << "\n" << N=s;
        }
        return 0;
}

Compiler output:
a.cc:1:1: error: stray '##' in program
    1 | ##include<iostream>
      | ^~
a.cc:1:3: error: 'include' does not name a type
    1 | ##include<iostream>
      |   ^~~~~~~
a.cc: In function 'int main()':
a.cc:8:5: error: 'cin' was not declared in this scope
    8 |     cin >> N >> M;
      |     ^~~
a.cc:17:13: error: 'cout' was not declared in this scope
   17 |             cout << "-1";
      |             ^~~~
a.cc:21:13: error: 'cout' was not declared in this scope
   21 |             cout << "\n" << N=s;
      |             ^~~~
Language: C++

#include<iostream>
 
using namespace std;
 
int main()
{
    int N,M;
    cin >> N >> M;
    int A[10000];
    for(int i=0;i<M;i++)
        cin >> A[i];
        int s=0;
    for(int i=0;i<M;i++)
        s+=A[i];
        if(s>N)
        {
            cout << "-1";
        }
        else
        {
            cout << "\n" << N=s;
        }
        return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:31: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>' and 'int')
   21 |             cout << "\n" << N=s;
      |                               ^
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:458:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator=(std::basic_ostream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]'
  458 |       operator=(basic_ostream&& __rhs)
      |       ^~~~~~~~
/usr/include/c++/14/ostream:458:33: note:   no known conversion for argument 1 from 'int' to 'std::basic_ostream<char>&&'
  458 |       operator=(basic_ostream&& __rhs)
      |                 ~~~~~~~~~~~~~~~~^~~~~
Language: C++

#include<iostream>

using namespace std;

int main()
{
    int N,M;
    cin >> N >> M;
    int A[10000];
    for(int i=0;i<M;i++)
        cin >> A[i];
        int s=0;
    for(int i=0;i<M;i++)
        s+=A[i];
        if(s>N)
        {
            cout << "-1";
        }
        else
        {
            cout << "\n" << N=s;
        }
        return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:31: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>' and 'int')
   21 |             cout << "\n" << N=s;
      |                               ^
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:458:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator=(std::basic_ostream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]'
  458 |       operator=(basic_ostream&& __rhs)
      |       ^~~~~~~~
/usr/include/c++/14/ostream:458:33: note:   no known conversion for argument 1 from 'int' to 'std::basic_ostream<char>&&'
  458 |       operator=(basic_ostream&& __rhs)
      |                 ~~~~~~~~~~~~~~~~^~~~~
Language: C

#include <bits/stdc++.h>//復習必須
#include<iostream>
#include<vector>
#include <cmath>
#include <map>
#include <algorithm>
#include <string>
#define rep(i, n) for (int i = 0; i < n; ++i)
using ll = long long;
using namespace std;
#define P pair<int, int>
int main () {
    int n , m ;
    cin >> n >> m ;
    int a ;
    int ans = 0 ;
    for(int i = 0 ; i < m ; i++){
        cin >> a ;
        ans += a ;
    }

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

    return 0 ;
}

 


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

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

int main(void){
  int N, M, i, S;
  int A[M];
  
  scanf("%f,%f\n",N,M);
  for(i=1;i<=M;i++){
	  scanf("%f",A[i]);
  }
  
  for(i=1;i<=M;i++){
    S=N-A[i];
  }
  
  if(S<=0){
    primtf("-1\n");
  }else{
    primtf("%d\n",S);
  }
}



Compiler output:
main.c: In function 'main':
main.c:18:5: error: implicit declaration of function 'primtf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   18 |     primtf("-1\n");
      |     ^~~~~~
      |     printf
Language: C

#include <bits/stdc++.h>
#define rep(i,a,b) for(int i = a; i < b; ++i)
#define all(c) c.begin(), c.end()
#define gmax(x,y) x=max(x,y)
#define gmin(x,y) x=min(x,y)
#define gadd(x,y) x=add(x,y)
#define gmul(x,y) x=mul(x,y)
using namespace std;

typedef pair<int,int> pii;
typedef long long ll;
typedef vector<int> vi;

int main(){
	cin.tie(0);
	cout.tie(0);
	ios_base::sync_with_stdio(0);
	int n,m;
	cin >> n >> m;
	vector<int> v(m);
	rep(i,0,m)cin >> v[i];
	ll ans = n - accumulate(all(v), 0LL);
	cout << (ans >= 0?ans:-1) << '\n';
}


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

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

int main(){
    bool b1 = true;
    int N, M, A;
    A = 0;
    cin >> N >> M;

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

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

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



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

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

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

  
  if (sum =< N) {
    cout << N - sum << endl;
  }
  else{
    cout << -1 <<endl;
  }
  // ここにプログラムを追記
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: expected primary-expression before '<' token
   15 |   if (sum =< N) {
      |            ^
Language: C++

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

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




Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: request for member 'at' in 'A', which is of non-class type 'int [10110]'
    9 |   cin >> A.at(i) ;
      |            ^~
a.cc:11:14: error: request for member 'at' in 'A', which is of non-class type 'int [10110]'
   11 |     sum += A.at(i) ;
      |              ^~
a.cc:14:7: error: 'sum' was not declared in this scope
   14 |   if (sum > N) cout << "-1" << endl;
      |       ^~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: 'M' was not declared in this scope
    7 |   vector<int> A(M);
      |                 ^
Language: C

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

int main(int argc, char *argv[]) {
  ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);

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

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

Compiler output:
main.c: In function 'main':
main.c:5:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |   scanf("%d %d", &N, &M);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main (void) {
main.c:5:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    5 |   scanf("%d %d", &N, &M);
      |   ^~~~~
main.c:5:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:11:19: error: expected ';' before 'return'
   11 |   if(N<0)return -1
      |                   ^
      |                   ;
   12 |    return N;
      |    ~~~~~~
Language: C

n,m = map(int, input().split())
a = input().split()
num = 0
s = 0
#while num != (m):
#    s += int(a[num])
#    num += 1
for i in a:
    s += i
ans = n - s
if ans < 0:
    ans = -1
print(ans)

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 = input().split()
      | ^
main.c:5:2: error: invalid preprocessing directive #while
    5 | #while num != (m):
      |  ^~~~~
main.c:6:6: error: invalid preprocessing directive #s
    6 | #    s += int(a[num])
      |      ^
main.c:7:6: error: invalid preprocessing directive #num
    7 | #    num += 1
      |      ^~~
Language: C

#include <bits/stdc++.h>
using namespace std;
#define fo(i,n) for(int i = 0; i < n; i++)
#define pb push_back
#define all(c) c.begin(),c.end()



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


}



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

/// Author : HASEBUL HASSAN TANIM ///
#include <bits/stdc++.h>
using namespace std;

#define fast ios_base::sync_with_stdio(0);cin.tie(0);
#define pb push_back
#define pp pop_back
#define scan(t) scanf("%d",&t)
#define sscan(t) scanf("%lld",&t)
#define MEM(a, b) memset(a, (b), sizeof(a))
#define LL long long
#define ull unsigned long long
#define rock(cont) cont.begin(), cont.end()
#define roll(a,n) arr,arr+n
#define rep(i,n) for(int i=0 ; i<n ; i++)
#define repp(i, n) for(int i=1 ; i<=n ; i++)
#define print(t) printf("%d",t)
#define pprint(t) printf("%lld",t)
#define co(x) cout<<x
#define nl printf("\n")
#define el cout<<endl
#define INF (int)1e9

const int RT = 10000000;

vector<int>prime;
vector<LL>factor;
bitset<10000003> status;



int gcd(LL a,LL b){ return b==0 ? a: gcd(b,a%b);}
int lcm(LL a,LL b) { return a* (b/gcd(a,b));}

vector<int> Divisors(int n)
{
    vector<int> v;
    int limit=sqrt(n);
    for (int i=1; i<=limit; i++)
    {
        if (n%i==0)
        {
            if (n/i == i)
                v.push_back(i);
            else
            {
                v.push_back(i);
                v.push_back(n/i);
            }
        }
    }
    return v;
}

void sieve()
{
    int rt = sqrt(RT);
    //for(int i = 4; i <= rt; i+=2) status[i]=true;
    for(int i = 3; i <= rt; i+=2)
        if(!status[i])
            for(int j = i*i; j < RT; j+=(i<<1))
                status[j] = true;

    prime.push_back(2);

    for(int i = 3; i <= RT; i+=2)
        if(!status[i])
            prime.push_back(i);
}

LL primefac(LL n)
{
    int pf_idx=0,pf=prime[pf_idx],SIZE=prime.size();
    LL ANS=1,step=0;
    while(pf*pf<=n&&pf<SIZE)
    {
        if(n%pf==0)
        {
            while(n%pf==0) {n/=pf;}
            ANS=pf;
            step++;
        }
        pf=prime[++pf_idx];
        //cout<<pf<<" "<<n<<" "<<ANS<<endl;
    }
    if(n!=1) { ANS=max(ANS,n); step++; }
    if(step>1)
    {
      return ANS;
    }
    else
    {
        return -1;
    }
}

int main()
{
    int n,m,x,sum=0;
    scan(n);
    scan(m);
    repp(i,m)
    {
        scan(x);
        sum+=x;
    }
    if(sum>n)
    {
        print(-1);
        el;
    }
    else
    {
        print(n-sum);
        el;
    }
}


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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: request for member 'at' in 'A', which is of non-class type 'int'
    8 |     cin>>A.at(i);
      |            ^~
a.cc:9:10: error: request for member 'at' in 'A', which is of non-class type 'int'
    9 |     N-=A.at(i);
      |          ^~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: invalid types 'int[int]' for array subscript
    8 |     cin>>A[i];
      |           ^
a.cc:9:9: error: invalid types 'int[int]' for array subscript
    9 |     N-=A[i];
      |         ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: 'A' was not declared in this scope
    8 |     cin>>A[i];
      |          ^
Language: C++

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

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


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

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

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

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

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


  return 0;
}

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

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

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


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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: expected ',' or ';' before 'int'
   10 |   int sum =0;
      |   ^~~
a.cc:11:15: error: 'o' was not declared in this scope
   11 |     for(int i=o;i<M;i++){
      |               ^
a.cc:13:7: error: 'sum' was not declared in this scope
   13 |       sum += vec.at(i);
      |       ^~~
a.cc:16:6: error: 'sum' was not declared in this scope
   16 |   if(sum <= N){
      |      ^~~
Language: C++

int a[10010];
 int main(){
 int n,m;
 scanf("%d%d",&n,&m);
 for(int i=0;i<m;i++)scanf("%d",&a[i]);
 int s=0;
 for(int i=0;i<m;i++)s+=a[i];
 if(s>n){
 printf("-1\n");
 }else{
 printf("%d\n",n-s);
 }
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:4:2: error: 'scanf' was not declared in this scope
    4 |  scanf("%d%d",&n,&m);
      |  ^~~~~
a.cc:9:2: error: 'printf' was not declared in this scope
    9 |  printf("-1\n");
      |  ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int a[10010];
a.cc:11:2: error: 'printf' was not declared in this scope
   11 |  printf("%d\n",n-s);
      |  ^~~~~~
a.cc:11:2: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C

#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
ll n, m, x, s;
int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n >> m;
    while(m--)
        cin >> x, s += x;
    cout << max(-1LL, n - s);
    return 0;
}


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

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

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

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


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

#include <stdio.h>

int Question163B(void) {
	int insdate = 0;
	int inhome = 0;
	int inhdate[10001] = { 0 };
	int output = 0;

	scanf("%d %d", &insdate,&inhome);
	for (int k = 0; k < inhome; k++) scanf("%d", &inhdate[k]);
	
	int num = 0;
	for (int i = 0; i < inhome ; i ++) num = num + inhdate[i];

	if(num > insdate) printf("%d\n", -1);
	else printf("%d\n", insdate - num);

	return 0;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: Java

import java.util.Scanner;

public class ABC163B {
  public static void main(String[] main) {
    Scanner input = new Scanner(System.in);
    String[] ss = input.nextLine().split(" ");
    int n = Integer.parseInt(ss[0]);
    int m = Integer.parseInt(ss[1]);
    ss = input.nextLine().split(" ");
    int total = 0;
    for (int i = 0; i < m; i++) {
      total += Integer.parseInt(ss[i]);
    }
    if (n < total) {
      System.out.println("-1");
    } else {
      System.out.println(n - total);
    }
  }
}

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

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

typedef long long int ll;

int main()
{
    int n, m;
  	cin>>n>>m;
  	
  	int sum = 0;
  	for(int i=0;i<n;i++)
    {
      int var;
      cin>>var;
      sum+=var;
    }
  	is(sum > n)
    {
      cout<<"-1";
    }
  else
  {
    cout<<(n - sum);
  }
   	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'is' was not declared in this scope
   18 |         is(sum > n)
      |         ^~
a.cc:22:3: error: 'else' without a previous 'if'
   22 |   else
      |   ^~~~
Language: C++

#include <iostream>
using namespace std;
int main () {
  int N, M;
  cin >> N >> M;
  int cost;
  for (int i = 0; i < M; i++){
    int v;
    cin >> v;
    ans += v;
  }
  cout << N-cost;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |     ans += v;
      |     ^~~
      |     abs
Language: C++

#include <iostream>
using namespace std;
int main () {
  int N, M;
  cin >> N >> M;
  int cost;
  for (int i = 0; i < M; i++){
    int v;
    cin >> v;
    ans += v
  }
  cout << N-cost
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |     ans += v
      |     ^~~
      |     abs
a.cc:12:17: error: expected ';' before '}' token
   12 |   cout << N-cost
      |                 ^
      |                 ;
   13 | }
      | ~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:17:12: error: expected primary-expression before ',' token
   17 |   cout<<-1<,endl;
      |            ^
Language: C

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

/* Typedefs */

typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;

/* Consts */

const ll INF = 1e18;
const ll MOD = 998244353;
const ll MX = 1000001;

void solve() {
    
}

int main() {
	cin.sync_with_stdio(0); cin.tie(0);
    // ll T; cin >> T;
    // while (T--) solve();
    int N, M; cin >> N >> M;
    int total = 0, day = 0;
    for(int i = 0; i < M; i++) {
        cin >> day;
        total += day;
    } 
    if (N - total >= 0) cout << N - total;
    else cout << -1;
    return 0;
    // You should actually read the stuff at the bottom
}

/* Stuff to Look For
 * -----------------
 * Int overflow, array bounds
 * Initializing all variables, avoid weird behavior
 * Edge cases(n = 0, n = 1)
 * Just return 0 after result
 */


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 main{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		for(int i = 0;i<m;i++)
		{
			int temp = sc.nextInt();
			n -=temp;
		}
		if(n<0)
		{
			System.out.println(-1);
		}
		else
			System.out.println(n);
	}
}

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

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

int main(){
    int day;
    int co;
    int to;

    to = 0;

    cin >> day >> co;
vector<int> data(co);
for (int i = 0; i < co; i++){
    cin >> data.at(i);
}
for (int i = 0; i < co; i++){
   to += data.at(i);
}
if (day - to < 0){
    cout << -1 << endl;
}

else  (day - to >= 0){
    cout << day - to << endl;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:22: error: expected ';' before '{' token
   23 | else  (day - to >= 0){
      |                      ^
      |                      ;
Language: C

#include<iostream>
#include<string>
using namespace std;
    
int main(){
    int n,m;
    cin>>n;
    cin>>m;
    int a[m];
    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:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

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

Compiler output:
a.cc:2:1: error: 'uisng' does not name a type
    2 | uisng namespace std;
      | ^~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin>>n>>m;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:16:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |     cout<<-1;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:18:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   18 |     cout<<n-sum;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C

n, m = map(int,input().split())
a_list = list(map(int,input().split()))

free = n - sum(a_list)
if free<-1:
    free = -1

print(free)

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_list'
    2 | a_list = list(map(int,input().split()))
      | ^~~~~~
Language: Java

import java.util.Scanner;

public class abc163b {
    public static void main(String[] args){
        Scanner scan=new Scanner(System.in);
        int n=scan.nextInt();
        int m=scan.nextInt();

        long cnt=0;
        for(int i=0;i<m;i++){
            cnt+=scan.nextLong();
        }
        if(n-cnt>-1) System.out.println(n-cnt);
        else System.out.println(-1);
    }
}

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:20: error: expected ')' before ';' token
   14 |    s>n? (cout<<"-1";):(cout<<s-n;);
      |         ~          ^
      |                    )
a.cc:14:20: error: expected ':' before ';' token
   14 |    s>n? (cout<<"-1";):(cout<<s-n;);
      |                    ^
      |                    :
a.cc:14:20: error: expected primary-expression before ';' token
a.cc:14:21: error: expected primary-expression before ')' token
   14 |    s>n? (cout<<"-1";):(cout<<s-n;);
      |                     ^
a.cc:14:34: error: expected primary-expression before ')' token
   14 |    s>n? (cout<<"-1";):(cout<<s-n;);
      |                                  ^
Language: C

#include <bits/stdc++.h>
#include <iomanip>

using namespace std;

int main()
  {
  int n,m;cin >> n>>m;
  int sum,j=0;
  while (cin>>j)sum+=j;
  if(sum>n) cout<<-1;
  else cout<<n-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()
{
   int n,m;
   long long  sum=0;
   cin>>n>>m;
   for(int i=0;i<m;i++)
   {
       int days;
       cin>>days;
       sum+=days;
       
   }
    cout<<max(n-sum,-1);
}

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

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

#include<stdio.h>
int main()
{
	long n,m,i,s=0,h;

	scanf("%ld%ld",&n,&m);

	long a[m];

	for(i=0;i<m;i++)
		scanf("%ld",&a[i])
	for(i=0;i<m;i++)
		s+=a[i];
	h=n-s;
	if(h>=0)
		printf("%ld",h);
	else
		printf("-1");
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:35: error: expected ';' before 'for'
   11 |                 scanf("%ld",&a[i])
      |                                   ^
      |                                   ;
   12 |         for(i=0;i<m;i++)
      |         ~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

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

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

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

typedef long long ll;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<vector<vector<ll>>> vvvll;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<vector<vector<bool>>> vvvb;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<vpll> vvpll;
typedef vector<double> vd;
typedef vector<vd> vdd;

#define FOR(i,x,y) for(ll i=(ll)x; i<(ll)y; ++i)
#define REP(i,y) FOR(i, 0, y)
#define RFOR(i,x,y) for(ll i=(ll)x; i>=(ll)y; --i)
#define RREP(i,x) RFOR(i, x, 0)
#define ALL(a) a.begin(), a.end()
#define pb push_back
#define debug_print(x...) cerr << "line " << __LINE__ << " : "; debug_print_in(x);

template <typename First>
void debug_print_in(First first){
  cerr << first << endl;
  return;
}

template <typename First, typename... Rest>
void debug_print_in(First first, Rest... rest){
  cerr << first << " ";
  debug_print_in(rest...);
  return;
}

void IN(void){
  return;
}

template <typename First, typename... Rest>
void IN(First& first, Rest&... rest){
  cin >> first;
  IN(rest...);
  return;
}

template <typename First>
void OUT(First first){
  cout << first << endl;
  return;
}

template <typename First, typename... Rest>
void OUT(First first, Rest... rest){
  cout << first << " ";
  OUT(rest...);
  return;
}

template<class t, class u> void chmax(t&a,u b){if(a<b)a=b;};
template<class t, class u> void chmin(t&a,u b){if(a>b)a=b;};
int popcount(int t){return __builtin_popcount(t);} //GCC
int popcount(ll t){return __builtin_popcountll(t);} //GCC

template <typename T>
void vec_print(vector<T> VEC){
  REP(i, VEC.size()){
    cerr << VEC[i] << " ";
  }
  cerr << endl;
};

template <typename T>
void mat_print(vector<vector<T> > MAT){
  REP(i,MAT.size()){
    REP(j,MAT[i].size()){
      cerr << MAT[i][j] << " ";
    }
    cerr << endl;
  }
};

constexpr int INF = (1<<30);
constexpr ll INFLL = 1LL<<62;
constexpr long double EPS = 1e-12;
constexpr ll MOD = (ll)((1E+9)+7);

int main(){
  cin.tie(0); // cut the cin and cout (default, std::flush is performed after std::cin)
  ios::sync_with_stdio(false); // cut the iostream and stdio (DON'T endl; BUT "\n";)

  ll N, M;
  IN(N,M);
  ll A_total = 0;
  REP(i,M){
    ll A;
    IN(A);
    A_total += A;
  }

  if(N>=A_total){
    OUT(N-A_total);
  }else{
    OUT(-1);
  }

  return 0;
}

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

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

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

#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <numeric>
#include <fstream>
#include <iomanip>

typedef long double ld;
typedef long long ll;
const ll INF = (ll)1e18 + 1;
const ll MOD = 1e9 + 7;

// Split
namespace util {

std::vector< std::string > split(std::string s, char delimiter)
{
  std::vector< std::string > vs;
  std::string sub;
  for (auto c : s) {
    if (c == delimiter) vs.push_back(sub), sub.clear();
    else sub += c;
  }
  vs.push_back(sub);
  return vs;
}

} // namespace util

// Minimum, Maximum
template<class T> T minimum(T head, T tail) { return std::min(head, tail); }
template<class H, class... T> H minimum(H head, T... tail) { return std::min(head, minimum(tail...)); }
template<class T> T maximum(T head, T tail) { return std::max(head, tail); }
template<class H, class... T> H maximum(H head, T... tail) { return std::max(head, maximum(tail...)); }

// Output
template<class T, class S> std::ostream& operator << (std::ostream& os, std::pair<T, S> p)
{
  return os << "(" << p.first << " " << p.second << ")";
}

template<class T> std::ostream& operator << (std::ostream& os, std::vector< T > v)
{
  for (ll i = 0; i < (ll)v.size(); i++){ os << " [" << i << "]" << v[i]; if (i % 10 == 9) os << std::endl; }
  //os << v[0]; for (ll i = 1; i < (ll)v.size(); i++){ os << " " << v[i]; }
  return os;
}

template<class T, class S> std::ostream& operator << (std::ostream& os, std::map< T, S > m)
{
  ll i = 0; for (auto p : m){ os << " [" << i << "]" << p.first << "->" << p.second; i++;}
  return os;
}

void print(){ std::cout << std::endl; }
template<typename H> void print(H head) { std::cout << head << std::endl; }
template<typename H, typename... T> void print(H head, T... tail){ std::cout << head << " ", print(tail...); }

// GCD, LCM
ll gcd(ll a, ll b) {
  while (b != 0) { a %= b; std::swap(a, b); }
  return a;
}
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }

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

  ll N, M;
  std::cin >> N >> M;
  std::vector< ll > va(M, 0LL);
  for (ll i = 0; i < M; i++) {
    std::cin >> va[i];
  }

  ll sum = std::accumulate(va.begin(), va.end(), 0LL);
  ll ans = N - sum < 0 ? -1 : N - sum;

  print(ans);
  
  return 0;
}


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

#include<iostream>
using namespace std;
int main()
  {int n,m;
   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+=a[i];
   int d=n-sum;
   if(d<0)
     cout<<-1;
   else
     cout<<d;

Compiler output:
a.cc: In function 'int main()':
a.cc:16:14: error: expected '}' at end of input
   16 |      cout<<d;
      |              ^
a.cc:4:3: note: to match this '{'
    4 |   {int n,m;
      |   ^
Language: C++

#include<forward_list>
#include<algorithm>
#include<iostream>
#include<iomanip>
#include<iterator> 
#include<sstream>
#include<fstream>
#include<istream>
#include<utility>
#include<vector>
#include<stack>
#include<cmath>
#include<queue>
#include<deque>
#include<list>
#include<map> 
#include<set>
#define TitansGo ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define all(v) v.begin(),v.end()
#define YES cout << "YES\n";
#define NO cout << "NO\n";
#define ll long long 
#define endl "\n"
#define S second
#define F first
using namespace std;

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







}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:32: error: expected ';' before ')' token
   34 |         for (int i = 0 < n; i++)
      |                                ^
      |                                ;
Language: C

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

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

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

#include<bits/stdc++.h>

using namespace std;
using ll = long long;


int main()
{
    int n, m;
    cin >> n >> m;
    int a[m], sum = 0;
    for(int i = 0; i < m; i++){cin >> a[m];sum += a[m];}
    cout << (n - sum < 0 ? -1 :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<iostream>

using namespace std;

int N,M = 0;
int A[10001] = 0;

int main(){

	cin >> N >> M;

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


	int answer = N - sum;

	if(answer < 0)
		cout << -1<< endl ;
	else
		cout << answer << endl;


	return 0;
}





Compiler output:
a.cc:6:16: error: array must be initialized with a brace-enclosed initializer
    6 | int A[10001] = 0;
      |                ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N,M,A[M];
  cin>>N>>M;
  for(int i=0;i<N;i++){
    cin>>A[i];
    c+=A[i];
  }
  cout<<N-c;
  return 0;
}  

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'c' was not declared in this scope
    8 |     c+=A[i];
      |     ^
a.cc:10:11: error: 'c' was not declared in this scope
   10 |   cout<<N-c;
      |           ^
Language: C++

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


int N,M;
const int MAX_M = 10^4;
int A[MAX_M];

int main(){

	std::cin >> N >> M;

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

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

	if(answer < 0)
		printf("%d",-1);
	else
		printf("%d",answer);


	return 0;
}




Compiler output:
a.cc:7:21: warning: result of '10^4' is 14; did you mean '1e4'? [-Wxor-used-as-pow]
    7 | const int MAX_M = 10^4;
      |                     ^
      |                   ---
      |                   1e
a.cc:7:19: note: you can silence this warning by using a hexadecimal constant (0xa rather than 10)
    7 | const int MAX_M = 10^4;
      |                   ^~
      |                   0xa
a.cc: In function 'int main()':
a.cc:15:17: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   15 |                 cin >> A[i];
      |                 ^~~
      |                 std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: expected primary-expression before '<' token
   14 |         if(sum=<a)
      |                ^
Language: C++

#include <iostream>
using namespace std;
 
int main() {
  	int day, hw, req[1000] = {};
  	cin >> day >> hw;
  	for (int i = 0; i < hw; ++i) {
    	cin >> req[i];
      	day -= req[i];
    }
  	cout << (day >= 0) ? day : "-1";
    cout << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:28: error: operands to '?:' have different types 'int' and 'const char*'
   11 |         cout << (day >= 0) ? day : "-1";
      |         ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;
 
int main() {
  	int day, hw, req[1000] = {};
  	cin >> day >> hw;
  	for (int i = 0; i < hw; ++i) {
    	cin >> req[i];
      	day -= req[i];
    }
  	cout << (day >= 0) ? day : -1 << endl;
	return 0;
}

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

// created by mtnshh
 
#include<bits/stdc++.h>
#include<algorithm>
using namespace std;

#define ll long long
#define ld long double
 
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define repb(i,a,b) for(ll i=a;i>=b;i--)
 
#define err() cout<<"=================================="<<endl;
#define errA(A) for(auto i:A)   cout<<i<<" ";cout<<endl;
#define err1(a) cout<<#a<<" "<<a<<endl
#define err2(a,b) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<endl
#define err3(a,b,c) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<endl
#define err4(a,b,c,d) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<" "<<#d<<" "<<d<<endl

#define pb push_back
#define all(A)  A.begin(),A.end()
#define allr(A)    A.rbegin(),A.rend()
#define ft first
#define sd second
 
#define pll pair<ll,ll>
#define V vector<ll>
#define S set<ll>
#define VV vector<V>
#define Vpll vector<pll>
 
#define endl "\n"
 
const ll logN = 20;
const ll M = 1000000007;
const ll INF = 1e12;
#define PI 3.14159265
 
const ll N = 100005;

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

int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	ll no;
	// cin>>no;
	no = 1;
	while(no--){
		solve();
	}
    return 0;
}

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

//Created by Kira

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

#define IOS cin.sync_with_stdio(0);cin.tie(0); cout.tie(0);
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
#define pii pair<int,int> 
#define pb push_back
#define vi vector<int> 
using ll = long long;

const int mod = 1e9 + 7;

ll pwr(ll a, ll b);
    



int main(){
   IOS

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

   vi a(m);

   int s = 0;
   for(int & x : a)cin>>x,s += x;

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

   



}

ll pwr(ll a, ll b){
   a %= mod;	//Remove mod if not required
   ll res = 1;
   while(b > 0){
    if(b&1)
        res = res * a % mod;
        a = a * a % mod;
    b >>= 1;
    }

    return res;
}



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;

#define rep(i,n) for (int i = 0; i< (n); ++i)
#define vvec(m,n) vector<vector<int>> (int(m), vector<int>(n))
#define ALL(a) (a).begin(), (a).end()

using ll = long long;

int main(){
    int N, M;
    cin >> N >> M;
    vector<int> A(M);
    int EnjoyDay = N;
    rep(i,M){
        cin >> A.at(i);
        EnjoyDay -= A.at(i);
    }
    if(EnjoyDay < 0) cout << -1 << endl;
    else cout << EnjoyDay << 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: Java

import java.util.*;

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

        int n = sc.nextInt();
        int m = sc.nextInt();

        int[] a = new int[m];

        for(int i = 0; i < m; i++)
            a[i] = sc.nextInt();

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

        if(ans < 0){
            System.out.println(-1);
        }else{
            Syst4em.out.println(ans);
        }
    }
}

Compiler output:
Main.java:22: error: package Syst4em does not exist
            Syst4em.out.println(ans);
                   ^
1 error