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

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

int main(){
  int N,M;
  cin>>N>>M;
  int i=0;
  while(i<M){
    int A;
    cin>>A;
    if(M<100000 %% N-A>0){
      cout<<N=N-A<<endl;
    }
    else{
      cout<<-1<<endl;
    }
  }
}
    


  
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:11:18: error: expected primary-expression before '%' token
   11 |     if(M<100000 %% N-A>0){
      |                  ^
a.cc:12:18: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   12 |       cout<<N=N-A<<endl;
      |               ~~~^~~~~~
Language: C

#include<iostream>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <iomanip>//setprecision
using namespace std;
#define rep(i, n)        for(int i=0; i<(int)(n); ++i)
int main(){
    long long int a,b,c,d=0;
    cin>>a>>b;
    rep(i,b){
        cin>>c;
        d+=c;
    }
    a-=b;
    if(a>0)cout<<-1;
    else cout<<a;
}


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

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

int main() {
  int m,n
    cin>>m>>n;
    vector<int>A(m);
    int sum=0;
    rep(i,m){sum+A.at(i)};
  if(n-sum<0){cout<<-1<<endl;}
  else{cout<<n-sum<<endl;}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: expected initializer before 'cin'
    7 |     cin>>m>>n;
      |     ^~~
a.cc:10:25: error: expected ';' before '}' token
   10 |     rep(i,m){sum+A.at(i)};
      |                         ^
      |                         ;
a.cc:11:6: error: 'n' was not declared in this scope
   11 |   if(n-sum<0){cout<<-1<<endl;}
      |      ^
Language: Java

import java.util.*;
 
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 Ai = sc.nextInt();
          N = N - Ai;
        }
        if(N < 0){
          System.out.plintln("-1");
        }else{
          System.out.plintln(N);
        }
    }
}

Compiler output:
Main.java:13: error: cannot find symbol
          System.out.plintln("-1");
                    ^
  symbol:   method plintln(String)
  location: variable out of type PrintStream
Main.java:15: error: cannot find symbol
          System.out.plintln(N);
                    ^
  symbol:   method plintln(int)
  location: variable out of type PrintStream
2 errors
Language: C++

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

int main(){
  int N,M;
  cin>>N>>M;
  int i=0;
  while(i<M){
    int A;
    cin>>A;
    if(M<100000 %% N-A>0){
      cout<<N-=A<<endl;
    }
    else{
      cout<<-1<<endl;
    }
  }
}
    


  
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:11:18: error: expected primary-expression before '%' token
   11 |     if(M<100000 %% N-A>0){
      |                  ^
a.cc:12:17: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   12 |       cout<<N-=A<<endl;
      |                ~^~~~~~
Language: C++

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


int32_t main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
//#ifndef ONLINE_JUDGE
    //freopen("input.txt" , "r", stdin);
   // freopen("output.txt" , "w", stdout);
//#endif
    int n , m;
    cin >> n >> m;
    int sum = 0 , temp ;
    while (m--) {

        cin >> temp;
        sum += temp;

    }
  if(m==0){cout<n<<"\n";}
  else{
    cout << n - sum << "\n";
  }
    return 0;

}





Compiler output:
a.cc: In function 'int32_t main()':
a.cc:23:18: error: invalid operands of types 'long long int' and 'const char [2]' to binary 'operator<<'
   23 |   if(m==0){cout<n<<"\n";}
      |                 ~^~~~~~
      |                 |  |
      |                 |  const char [2]
      |                 long long int
Language: Java

import java.util.*;
 
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 Ai = sc.next();
          N = N - Ai;
        }
        if(N < 0){
          System.out.plintln(-1);
        }else{
          System.out.plintln(N);
        }
    }
}

Compiler output:
Main.java:9: error: incompatible types: String cannot be converted to int
          int Ai = sc.next();
                          ^
Main.java:13: error: cannot find symbol
          System.out.plintln(-1);
                    ^
  symbol:   method plintln(int)
  location: variable out of type PrintStream
Main.java:15: error: cannot find symbol
          System.out.plintln(N);
                    ^
  symbol:   method plintln(int)
  location: variable out of type PrintStream
3 errors
Language: C++

#include<bits/stdc++.h>
#define ll long long
#define pi acos(-1)
using namespace std;
int main(){
    ll n,k;
    cin>>n>>k;
    ll arr[k];
    for(ll i=0;i<k;i++){
      ll sum=0;
      sum=arr[i];
    }

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

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

#include<bits/stdc++.h>
#define fo(i,a,b) for(int i=(a);i<(b);i++)
#define qi queue<int>
#define vi vector<int>
#define ll long long
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define pii pair<int,int>
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define fi first
#define se second 
#define prq priority_queue
#define foreach(it,c) for(__typeof((c).begin()) it=c.begin();it!=c.end();it++)
//#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
using namespace std;
inline ll read(){
	ll x=0;
	int f=1;
	char c=getchar();
	for(;!isdigit(c);c=getchar()) if(c=='-')f=-f;
	for(;isdigit(c);c=getchar())x=x*10+(c-'0');
	return x*f;
}
inline void out(int x){
	if(x>=10)out(x/10);
	putchar(x%10+'0');
}
int n,m;
int main(){
	//freopen("a.in","r",stdin);
	//freopen("a.out","w",stdout);
	cin>>n>>m;
	fo(i,0,m){
		int x;
		cin>>x;
		n-=x;
	}
	cout<<max(n,-1)<<endl;
	return 0;
}

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

import java.util.*;
 
class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int Ai = sc.nextLine();
        int Answer;
        for(int i=0; i<M; i++){
            N = N - Ai[i];
        }
        if(N < 0){
          System.out.plintln(-1);
        }else{
          System.out.plintln(N);
        }
    }
}

Compiler output:
Main.java:8: error: incompatible types: String cannot be converted to int
        int Ai = sc.nextLine();
                            ^
Main.java:11: error: array required, but int found
            N = N - Ai[i];
                      ^
Main.java:14: error: cannot find symbol
          System.out.plintln(-1);
                    ^
  symbol:   method plintln(int)
  location: variable out of type PrintStream
Main.java:16: error: cannot find symbol
          System.out.plintln(N);
                    ^
  symbol:   method plintln(int)
  location: variable out of type PrintStream
4 errors
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:18: error: expected ';' before '}' token
   14 |   else cout<<"-1"
      |                  ^
      |                  ;
   15 | }
      | ~
Language: Java

import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;


public class hef {
	

	
	
	public static void main(String[] args) {

		
		Scanner s = new Scanner(System.in);
		
		int n = s.nextInt();
		int m = s.nextInt();
		
		int sum=0;
		for(int i=0;i<m;i++) {
			sum+=s.nextInt();
		}
		if(sum>n) {
			System.out.println(-1);
		}
		else {
			System.out.println(n-sum);
		}
		
	}
}

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

#include<iostream>
#include<vector>

using namespace std;

int main(){
    int num,task;
    cin >> num >> task;

    vector<int> vec(task);
    for(int i=0; i<task; i++){
        cin >> vec.at(i);
    }
    for(int i=0;i<task;i++){
        num = num - vec[i];
    }
    if(num<0){
        cout << "-1" << endl;
    }
    else{
        cout << num << 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,M;
    scanf("%d %d", &N, &M);
    int A[M],i,h,s;
    for(i=1;i<=M;i++){
       scanf("%d ", &A[i]);
      s=A[1];
      s+=A[i];
        }
    if(N>s){
        h=N-s;
     printf("%d\n",h);}
    else if(N<s){
      printf("-1\n"); }
    else{
    printf("0\n");}
    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;
  cin >> N >> M;
  
  vector<int> A(M);
  for (int i =0; i < M; i++) {
    cin >> A.at(i);
  }
  int B;
  B = 0;
 for (int i =0; i < M; i++) { 
    B += A[i];
                              }
  
  cout << N-B << endl;
  
  if ( N-B >= 0 ) {
    cout << N-B << 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>
#include<conio.h>
int main()
{
    int N,M;
    scanf("%d %d", &N, &M);
    int A[M],i,h,s;
    for(i=1;i<=M;i++){
       scanf("%d ", &A[i]);
      s=A[1];
      s+=A[i];
        }
    if(N>s){
        h=N-s;
     printf("%d\n",h);}
    else if(N<s){
      printf("-1\n"); }
    else{
    printf("0\n");}
    return 0;
}

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

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


Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespaces'
    2 | using namespaces 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:12:15: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |   if (sum<=n) 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
      |                  ^~~~
a.cc:13:8: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |   else cout<<"-1";
      |        ^~~~
      |        std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C

#include <stdio.h>
#include <math.h>
double f[1000000000000],a;
int i, n;

int main(void){
  for(i=1;i=f[2];i=i++){
  	scanf("%lf",&f[i]);
  }
  for(n=3;n=f[2]+2;n=n++){
  	a = f[1] - f[n];
  }
  if(a>=0){
  	printf("%lf",a);
  }
  if(a<0){
  	printf("-1");
  }
  

}



Compiler output:
/tmp/ccADRCgR.o: in function `main':
main.c:(.text+0x6): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccADRCgR.o
main.c:(.text+0x12): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccADRCgR.o
main.c:(.text+0x43): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccADRCgR.o
main.c:(.text+0x4c): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccADRCgR.o
main.c:(.text+0x52): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccADRCgR.o
main.c:(.text+0x64): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccADRCgR.o
main.c:(.text+0x6a): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccADRCgR.o
main.c:(.text+0x74): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccADRCgR.o
main.c:(.text+0x88): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccADRCgR.o
main.c:(.text+0xaa): relocation truncated to fit: R_X86_64_PC32 against symbol `a' defined in .bss section in /tmp/ccADRCgR.o
main.c:(.text+0xb0): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

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

int main(){
  int N,M;
  cin>>N>>M;
  int i=0;
  while(i<M){
    int A;
    cin>>A;
    if(M<100000; %% N-A>0;){
      cout<<N-A<<endl;
    }
    else{
      cout<<-1<<endl;
    }
  }
}
    


  
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:11:18: error: expected primary-expression before '%' token
   11 |     if(M<100000; %% N-A>0;){
      |                  ^
a.cc:11:19: error: expected primary-expression before '%' token
   11 |     if(M<100000; %% N-A>0;){
      |                   ^
a.cc:11:26: error: expected ')' before ';' token
   11 |     if(M<100000; %% N-A>0;){
      |       ~                  ^
      |                          )
a.cc:11:27: error: expected primary-expression before ')' token
   11 |     if(M<100000; %% N-A>0;){
      |                           ^
a.cc:14:5: error: 'else' without a previous 'if'
   14 |     else{
      |     ^~~~
Language: C++

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

int main(){
  int N,M;
  cin>>N>>M;
  int i=0;
  while(i<M){
    int A;
    cin>>A;
    if(M<100000 %% N-A>0){
      cout<<N-A<<endl;
    }
    else{
      cout<<-1<<endl;
    }
  }
}
    


  
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:11:18: error: expected primary-expression before '%' token
   11 |     if(M<100000 %% N-A>0){
      |                  ^
Language: C++

#include <iostream>
using namespaces std;
int main()
{
  long long n,m,sum=0,a;
  cin<<n<<m;
  for (int i;i<=m;i++)
  {
    cin<<a;
    sum=sum+a;
  }
  if (sum<=n) cout<<n-sum;
  else cout<<"-1";
}


Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespaces'
    2 | using namespaces 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 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:12:15: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |   if (sum<=n) 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
      |                  ^~~~
a.cc:13:8: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |   else cout<<"-1";
      |        ^~~~
      |        std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C

#include<iostream>
using namespace std;

main()
{
	int a,b,s[205],c,d;
	cin>>a,b;
	cout<<30;
	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;
 
void main()
{
  int n;
  int m;
  cin>>n>>m;
  int a[m];
  int sum=0;
  for(int i=0;i<m;i++)
  {
    sum+=a[i];
  }
  if(sum>n)
    cout<<"-1";
  else 
    cout<<(n-sum);
}


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

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

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

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


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()
{
    long long int A,M,N,v,s=0;
    cin>>n>>m;
    for(int i=1;i<=M;i++)
    {
        cin>>A;
        s=s+A;
    }
    v=N-s;
    if(v>0||v==0)
    cout<<v;
    else
        cout<<-1;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: 'n' was not declared in this scope
    6 |     cin>>n>>m;
      |          ^
a.cc:6:13: error: 'm' was not declared in this scope
    6 |     cin>>n>>m;
      |             ^
Language: C++

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

int main(){
  int N,M;
  cin>>N>>M;
  int i=0;
  while(i<M){
    int A;
    cin>>A;
    if(M<100000 %% N-A>0){
      cout<<N-A<<endl;
      else{
        cout<<-1<<endl;
      }
    }
}
    


  
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:11:18: error: expected primary-expression before '%' token
   11 |     if(M<100000 %% N-A>0){
      |                  ^
a.cc:13:7: error: expected '}' before 'else'
   13 |       else{
      |       ^~~~
a.cc:11:26: note: to match this '{'
   11 |     if(M<100000 %% N-A>0){
      |                          ^
Language: C++

include<iostream>
using namespace std;
 
void main()
{
  int n;
  int m;
  cin>>n>>m;
  int a[m];
  int sum=0;
  for(int i=0;i<m;i++)
  {
    sum+=a[i];
  }
  if(sum>n)
    cout<<"-1";
  else 
    cout<<(n-sum);
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc:4:1: error: '::main' must return 'int'
    4 | void main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope
    8 |   cin>>n>>m;
      |   ^~~
a.cc:16:5: error: 'cout' was not declared in this scope
   16 |     cout<<"-1";
      |     ^~~~
a.cc:18:5: error: 'cout' was not declared in this scope
   18 |     cout<<(n-sum);
      |     ^~~~
Language: C++

include<iostream>
using namespace std;
 
void main()
{
  int n;
  int m;
  cin>>n>>m;
  int a[m];
  int sum=0;
  for(int i=0;i<m;i++)
  {
    sum+=a[i];
  }
  if(sum>n)
    cout<<"-1";
  else 
    cout<<(n-sum);
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc:4:1: error: '::main' must return 'int'
    4 | void main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope
    8 |   cin>>n>>m;
      |   ^~~
a.cc:16:5: error: 'cout' was not declared in this scope
   16 |     cout<<"-1";
      |     ^~~~
a.cc:18:5: error: 'cout' was not declared in this scope
   18 |     cout<<(n-sum);
      |     ^~~~
Language: C++

include<iostream>
unsing namespace std;
 
void main()
{
  int n;
  int m;
  cin>>n>>m;
  int a[m];
  int sum=0;
  for(int i=0;i<m;i++)
  {
    sum+=a[i];
  }
  if(sum>n)
    cout<<"-1";
  else 
    cout<<(n-sum);
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc:4:1: error: '::main' must return 'int'
    4 | void main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope
    8 |   cin>>n>>m;
      |   ^~~
a.cc:16:5: error: 'cout' was not declared in this scope
   16 |     cout<<"-1";
      |     ^~~~
a.cc:18:5: error: 'cout' was not declared in this scope
   18 |     cout<<(n-sum);
      |     ^~~~
Language: C++

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

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

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


}


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

#include <bits/stdc++.h>
using namespace std;
constexpr long long MOD = 1000000007;
using ll = long long;
int main() {
    ll n, m;
    cin >> n >> m;
    ll ans = n;
    for(ll i = 0; i < m;i++){
        ll a;
        cin >> a;
        ans -= a;
    }
    cout << max(-1, ans) << endl;
}


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

#include<iostraem>
unsing namespace std;

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


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

#include <bits/stdc++.h>

#define st              first
#define nd              second
#define pb              push_back
#define lwb             lower_bound
#define upb             upper_bound
#define all(a)          (a).begin(), (a).end()
#define Reset(s, n)     memset(s, n, sizeof(s))
#define Sz(a)           int((a).size())
#define Max(a, b, c)    max(max((ll)(a), (ll)(b)), (ll)(c))
#define Min(a, b, c)    min(min((ll)(a), (ll)(b)), (ll)(c))
#define Unique(a)       (a).resize(unique(all(a)) - (a).begin())
#define bit(n, i)       (((n) >> (i)) & 1)
#define cntbit(n)       __builtin_popcountll(n)

using namespace std;

typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;

const int MOD = 1e9 + 7;
const ll INF = 1e18;
const ld PI = acos((ld) -1);
const ld EPS = 1e-12;
inline bool isPrime (ll x){ if(x <= 1) return 0; if(x <= 3) return 1; if (!(x % 2) || !(x % 3)) return 0; ll s = sqrt(1.0 * x) + EPS; for(ll i = 5; i <= s; i += 6){if (!(x % i) || !(x % (i + 2))) return 0;}return 1;}
inline ll fpow(ll n, ll k, ll p = MOD) {ll r = 1; for (; k; k >>= 1) {if (k & 1) r = r * n % p; n = n * n % p;} return r;}
inline int inv(int a, ll p = MOD) {return fpow(a, p - 2, p);}
inline ll gcd(ll a, ll b) {ll r; while (b) {r = a % b; a = b; b = r;} return a;}
inline ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
inline void onbit(ll &a, int i){a |= 1LL << i;}
inline void offbit(ll &a, int i){onbit(a, i), a -= (1LL << i);}

const int N = 1e6 + 5;

ll n, m, k;
ll a[N], b[N];

void solve(){
   cin >> m >> n;
   for(int i = 0; i < n; i++){
      int x;
      cin >> x;
      m -= x;
   }
   cout << max(m, -1ll);

}

int main(){
   ios_base::sync_with_stdio(0);
   cin.tie(0); cout.tie(0);
   cout << fixed << setprecision(10);
   //    freopen("input.txt", "r", stdin);
   //    freopen("output.txt", "w", stdout);
   int query = 1;
   // cin >> query;
   int start = 1000 * clock() / CLOCKS_PER_SEC;
   while(query--) solve();
   cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC  - start << "ms\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() {
              float R;
              cin >> R;
             
              cout << 2 * M_PI * R;
            }

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

#include<cstdio>
#include<cstring>
#include<string>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<queue>
#include<map>
#include<ctime>

using namespace std;

template <typename T>

inline T read()
{
	T x=0,f=1;char c=getchar();
	while(!isdigit(c))
	{if(c=='-') f=-f;c=getchar();}
	while(isdigit(c))
	{x=(x<<3)+(x<<1)+(c-48);c=getchar();}
	return x*f;
}

#define lint long long int
#define ulint unsigned lint

const int inf=1e9+1e7;

int main(void)
{

	// freopen("testdata.in","r",stdin);
	// freopen("testdata.out","w",stdout);

	lint n=read<lint>();
	lint m=read<lint>();

	for(int i=1;i<=m;i++)
	{
		n-=read<lint>();
		if(n<0) break;
	}

	if(n<0) puts("-1");
	else printf("%lld\n",n);

	return 0;

}


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

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

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

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

int main() {
  int N, M, sum;
  cin >> N >> M;
  sum =0;
  vector <int> vec (M);
  
  for (int i =0; i<M; i++){
    cin >> vec.at(i);
    sum += vec.at(i);
  }
  
  if (N>sum){
  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

N, M = map(int, input().split())
A = input().split()
A_int = [int(n) for n in A]

rest = sum(A_int)
if rest >= 0:
  print(rest)
else:
  print(-1)

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

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

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

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

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

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

int main() {
    int N, M, avec;
    cin >> N >> M;
    for(int i = 0; i < M; i++){
        cin >> avec;
        if(N > 0){
            N -= avec;
        }
        else{
            N = -1;
            break;
        }
    }
    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 <stdio.h>
#include<math.h>

int main(void){
    int i,n,m,count=0;
    if(scanf("%d %d",&n,&m)!=0){
    int* a=new int[m];
    for(i=0;i<m;i++) {if(scanf("%d",&a[i])!=0) count+=a[i];  }
    if(count<=m)printf("%d\n",m-count);
    else printf("-1");
    }}

Compiler output:
main.c: In function 'main':
main.c:7:12: error: 'new' undeclared (first use in this function)
    7 |     int* a=new int[m];
      |            ^~~
main.c:7:12: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:16: error: expected ',' or ';' before 'int'
    7 |     int* a=new int[m];
      |                ^~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <functional>

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 998244353

typedef long long ll;
typedef pair<ll,ll> P;

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

	ll n, m;cin >> n >> m;
	ll sum;
	vector<ll> v(m);
	REP(i, m)cin >> v[i];
	REP(i, m)sum += v[i];
	cout << (n - sum >= 0) ? n - sum : -1 << endl;

	return 0;
}


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

/*
    @uthor: Amit Kumar
    user: CodeChef: dr_virus_ ; Codeforces,Hackerearth,Hakerrank: dr_virus;
*/
#include <bits/stdc++.h>
using namespace std;
//#include <boost/multiprecision/cpp_int.hpp>
//namespace mp = boost::multiprecision;
//#define ln mp::cpp_int;
#define ll long long
#define ld double
#define pp pair<ll,ll>
#define endl "\n"
#define nfrep(a) for(size_t i=0;i<a;i++)
#define fnrep(a,b) for(size_t i=a;i<=b;i++)
#define nbrep(a) for(size_t i=a;i>=0;i--)
#define bnrep(a,b) for(size_t i=a;i>=b;i--)
 
const ll mod = 1e9+7;
const ll inf = 1e18;
 
 
int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    
 /* #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif */
 ll n,m,s=0;
  cin>>n>>m;
  
  for(auto i=0;i<m;i++){
  ll t;
  cin>>t;
  sum+=t;
  }
  if(sum>=n) cout<<sum-n;
  else cout<<"-1";
  //cerr<<"Time Elapsed: "<<clock()/(double)CLOCKS_PER_SEC<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:38:3: error: 'sum' was not declared in this scope
   38 |   sum+=t;
      |   ^~~
a.cc:40:6: error: 'sum' was not declared in this scope
   40 |   if(sum>=n) cout<<sum-n;
      |      ^~~
Language: C++

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

int main(){
  int N,M,A;
  cin>>N>>M>>A;
  int i=0;
  while(i<M){
    cout<<N-A<<endl;
  }
}
  
  
  
UVVVMM!!!なんでとけへんねん！

Compiler output:
a.cc:15:1: error: 'UVVVMM' does not name a type
   15 | UVVVMM!!!なんでとけへんねん！
      | ^~~~~~
Language: C++


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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin>>N;
      |   ^~~
a.cc:14:5: error: 'cout' was not declared in this scope
   14 |     cout<<(N-sum);
      |     ^~~~
a.cc:16:5: error: 'cout' was not declared in this scope
   16 |     cout<<-1;
      |     ^~~~
Language: C

#include <bits/stdc++.h>
        using namespace std;
         
        int main() {
          float R;
          cin >> R;
         
          cout << 2 * M_PI * R;
        }

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,A;
  cin>>N>>M>>A;
  int i=0;
  while(i<M){
    cout<<N-A<<endl;
  }
}
EX11やってなかったから無理かもしれん


Compiler output:
a.cc:12:1: error: 'EX11\U00003084\U00003063\U00003066\U0000306a\U0000304b\U00003063\U0000305f\U0000304b\U00003089\U00007121\U00007406\U0000304b\U00003082\U00003057\U0000308c\U00003093' does not name a type
   12 | EX11やってなかったから無理かもしれん
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++


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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |         cin >> N >> M;
      |         ^~~
a.cc:14:17: error: 'cout' was not declared in this scope
   14 |                 cout << -1 << endl;
      |                 ^~~~
a.cc:14:31: error: 'endl' was not declared in this scope
   14 |                 cout << -1 << endl;
      |                               ^~~~
a.cc:16:17: error: 'cout' was not declared in this scope
   16 |                 cout << val << endl;
      |                 ^~~~
a.cc:16:32: error: 'endl' was not declared in this scope
   16 |                 cout << val << endl;
      |                                ^~~~
Language: C++

#include <iostream>
using namespace std;
 
int main(){
  int N,M;
  int sum=0;
  cin>>N;
  cin>>M;

  for(int i = 0; i < M ; i++){
    sum+=cin>>sum;
  }
  
  if((N-M) > 0){
    cout<<(N-M);
  }else{
    cout<<-1;
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:8: error: no match for 'operator+=' (operand types are 'int' and 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'})
   11 |     sum+=cin>>sum;
      |     ~~~^~~~~~~~~~
a.cc:11:8: note: candidate: 'operator+=(int&, int)' (built-in)
a.cc:11:8: note:   no known conversion for argument 2 from 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} to 'int'
Language: C

        #include <bits/stdc++.h>
        using namespace std;
         
        int main() {
          float R;
          cin >> R;
         
          cout << 2 * M_PI * R;
        }

Compiler output:
main.c:1:18: 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() {
      		unsigned long long N;
      int M;
      cin >> N >> M;
      vector<unsigned long long> A[M];
      unsigned long long 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:14: 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,day=0;
  vector<int>  a(m);
  for (int i=0; i<m; i++) {
    cin >> a[i];
    day+=a[i];
  }
  if (n<day) cout << -1 << endl;
  else cout << n-day<< 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 i;
  i = 0;
  
  vector<int> A(M);
  
  for (i < M; i++;){
    cin >>A.at(i);
  }
  int sum=0;
  for(i < M; i++;){
    sum += A.at(i);
  }
  
  if( A.at(i) <= M;){
    cout << M - A.at(i) <<endl;
  }
  
  else{
    cout << "-1" <<endl;
  }
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:21:20: error: expected primary-expression before ')' token
   21 |   if( A.at(i) <= M;){
      |                    ^
Language: C++

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

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

    
   

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

#include <bits/stdc++.h>

using namespace std;
#define rep(i, n) for(int i=0;i<n;i++)
#define REP(i, n) for(int i=1;i<=n;i++)
typedef long long ll;

int main() {
	ll n, m;
	cin >> n >> m;
	ll sum = 0;
	rep(i, m) {
		ll a;
		cin >> a;
		sum += a;
	}
	cout << max(n - sum, -1) << endl;
	return 0;
}


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

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

int main () {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	ll N,M, A, res = 0;
	
	cin >> N >> M;
	while (M--){
		cin >> A;
		res += A;
	}
	if ((N-res) >= 0) cout<< N-res;
	else cout << -1;
}

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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  		unsigned long long N;
  int M;
  cin >> N >> M;
  vector<unsigned long long> A[M];
  unsigned long long 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: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, sum = 0;
  cin >> n >> m;
  int a[m];
  
  for(int i = 1; i <= m; i++){
    cin >> a[i];
    sum += a[i];
  }
  
  int result = n - sum;
  
  if(result >= 0)
  {
     cout << result << "\n";
  }
  else {
      cout << "-1" << "\n";
  }
}


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

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

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

  int sum = 0; // 合計点を表す変数
  int x;       // 入力を受け取る変数
  int i = 0;   // カウンタ変数

  while (i < M) {
    cin >> x;
    sum += x;
    i++;
  }

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



Compiler output:
a.cc: In function 'int main()':
a.cc:18:12: error: 'o' was not declared in this scope
   18 |  if(N-sum>=o){
      |            ^
Language: C++

#include <iostream>

using namespace std;

int main() {
  long log n, m, a, sum;
  cin >> n >> m;

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

  long long diff;
  diff = n - sum;

  if(diff < 0){
    cout << -1 << endl;
  }else{
    cout << diff << endl;
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: expected initializer before 'n'
    6 |   long log n, m, a, sum;
      |            ^
a.cc:7:10: error: 'n' was not declared in this scope
    7 |   cin >> n >> m;
      |          ^
a.cc:7:15: error: 'm' was not declared in this scope; did you mean 'tm'?
    7 |   cin >> n >> m;
      |               ^
      |               tm
a.cc:10:12: error: 'a' was not declared in this scope
   10 |     cin >> a;
      |            ^
a.cc:11:5: error: 'sum' was not declared in this scope
   11 |     sum += a;
      |     ^~~
a.cc:15:14: error: 'sum' was not declared in this scope
   15 |   diff = n - sum;
      |              ^~~
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 a;
		cin>>a;
		n-=a;
	}
	if(n<0)cout<<-1<<'\n';else cout<<n<<'\n';
	return 0;
}


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

#include <stdio.h>

int N;
int M;
int i;
int A_i[M];
int sum;
int answer;

int main(){
scanf("%d %d", N, M);
for(i=0;i<M;i++){
scanf("%d",&A_i[i]);
sum=sum+A_i[i];
}
if(sum>N){
answer=-1;
}else{
answer=N-sum;
}
printf("%d\n",answer);
return 0;
}

Compiler output:
main.c:6:5: error: variably modified 'A_i' at file scope
    6 | int A_i[M];
      |     ^~~