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

include<stdio.h>

int main() {

	int n, m,i;

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

	for(i=0;i<m;i++){
		n -= a[i];
	}

	if (n < 0) { printf("-1\n"); }
	else printf("%d\n", n);

	return 0;
}

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

#include<bits\stdc++.h>

using namespace std;
int main()
{
    int day,n,a,sum=0,r;
    cin>>day>>n;
    for(int i=1;i<=n;i++){
        cin>>a;
        sum=sum+a;
    }
    r=day-sum;
    cout<<r<<'\n';
    return 0;
}


Compiler output:
a.cc: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 ;
   int a ;//受け取り用
  int sum ;
  cin >> N >> M ;
  for(i=0 ; i < M ; i++){
    cin >> a ;
    sum += a ;
  }
  
  if (sum > N){
    cout << "-1" << ednl;
  }
  else {
    cout << N - sum << endl;
  }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: 'i' was not declared in this scope
    9 |   for(i=0 ; i < M ; i++){
      |       ^
a.cc:15:21: error: 'ednl' was not declared in this scope
   15 |     cout << "-1" << ednl;
      |                     ^~~~
Language: C

#include<iostream>
using namespace std;
int main(){
	int n,m;
	cin>>n>>m;
	for(int i=0;i<m;i++){
		int x;
		cin>>x;
		n-=x;
		if(n<0) return cout<<-1,0;
	}
	cout<<n;
	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 <math.h>
using namespace std;

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

    return 0;
}


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

#include<stdio.h>
int main(){
  int n,m;
  scanf("%d %d",&n,&m);
  int sum=0;
  for (i=1;i<=m;i++){
    int x;
    scanf("%d",&x);
    sum=sum+x;
  }
  if (sum>n) printf("-1");else printf("%d",n-sum);
}

Compiler output:
main.c: In function 'main':
main.c:6:8: error: 'i' undeclared (first use in this function)
    6 |   for (i=1;i<=m;i++){
      |        ^
main.c:6:8: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
int main(){
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  lli n,m;
  cin >> n>> m;
  ll a[m];
  for(lli i=0;i<m;i++)	cin>>a[i];
  lli sum=0, f=1;
  for(lli i=0;i<m;i++){
    sum+=a[i];
    if(sum>n)
    {	f=0; cout << -1 << endl; break;}
  }
 	if(f)	cout << n - sum << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'll' was not declared in this scope; did you mean 'lli'?
   10 |   ll a[m];
      |   ^~
      |   lli
a.cc:11:30: error: 'a' was not declared in this scope
   11 |   for(lli i=0;i<m;i++)  cin>>a[i];
      |                              ^
a.cc:14:10: error: 'a' was not declared in this scope
   14 |     sum+=a[i];
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
int main(){
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  lli n,m;
  cin >> n>> m;
  for(lli i=0;i<n;i++)	cin>>a[i];
  lli sum=0, f=1;
  for(lli i=0;i<n;i++){
    sum+=a[i];
    if(sum>n)
    {	f=0; cout << -1 << endl; break;}
  }
 	if(f)	cout << n - sum << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:30: error: 'a' was not declared in this scope
   10 |   for(lli i=0;i<n;i++)  cin>>a[i];
      |                              ^
a.cc:13:10: error: 'a' was not declared in this scope
   13 |     sum+=a[i];
      |          ^
Language: C

#include <iostream>

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


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

import java.util.*;


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

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

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


int main(){
	
    int n,m;
	cin>>n>>m;
	vector<int> arr(m);
	for(int i=0;i<m;i++){
		cin>>arr[i];
	}
	long long suma = 0;
	for(int i=0;i<m;i++){
		suma += arr[i];
	}
	if(suma > n)
		cout<<-1<<endl;
	else
		cout<<suma<<endl;
	
	
	return 0;
}


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

#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
using namespace std;
int main(){
  int N,M;
  cin>>N>>M;
  int a[10000];
  int sum=0;
  for(int 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:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

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

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

  long int n , m , ans=0 , x ;
  cin>>n>>m;
  for(int i=0 ; i<m;i++){
    cin>>x;
    ans+=x;

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

Compiler output:
a.cc:2:3: error: 'cin' does not name a type
    2 |   cin>>n>>m;
      |   ^~~
a.cc:3:3: error: expected unqualified-id before 'for'
    3 |   for(int i=0 ; i<m;i++){
      |   ^~~
a.cc:3:17: error: 'i' does not name a type
    3 |   for(int i=0 ; i<m;i++){
      |                 ^
a.cc:3:21: error: 'i' does not name a type
    3 |   for(int i=0 ; i<m;i++){
      |                     ^
a.cc:8:3: error: expected unqualified-id before 'if'
    8 |   if(ans>n)
      |   ^~
a.cc:10:5: error: expected unqualified-id before 'else'
   10 |     else
      |     ^~~~
a.cc:12:1: error: expected declaration before '}' token
   12 | }
      | ^
Language: C++

#include <iostream>
using namespace std;

int main(){
  int n, m, sum=0;
  cin >> n >> m;
  int a[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:10:18: error: 'i' was not declared in this scope
   10 |         sum += a[i];
      |                  ^
a.cc:14:20: error: expected ';' at end of input
   14 |     cout << (n-sum)
      |                    ^
      |                    ;
a.cc:14:20: error: expected '}' at end of input
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C

#include <bits/stdc++.h>

using namespace std;

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

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

#include<bits/stdc++.h>

using  namespace std;

int main() {

        int n, m;
        cin >> n >> m;
        int sum = 0;
        for(int i=0; i <m ;i++) {

            int x;
            cin >> x;
            sum += x;
        }
        int ans = n - sum;
        if(ans < 0) {
            cout << -1 << endl;
        }
        else {
            cout << ans << endl;
        }
        return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(long long (i)=0;(i)<(n);++(i))
#define ref(i,a,b) for (long long (i)=(a); (i)<=(b); ++(i))
#define endl '\n'
#define st first
#define nd second
#define pb push_back
#define mp make_pair
const int mx=2e6+5;

int main(){
	ios_base::sync_with_stdio(false); cin.tie(0);
	ll n,m;cin >> n >> m;
	vector <int> a(n);
	int sum=0;
	rep(i,n){
		cin >> a[i];
		sum+=a[i];
	}
	if(sum>m)cout<<-1<<endl;
	else cout<<m-sum
}
	


Compiler output:
a.cc: In function 'int main()':
a.cc:23:25: error: expected ';' before '}' token
   23 |         else cout<<m-sum
      |                         ^
      |                         ;
   24 | }
      | ~
Language: C

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(long long (i)=0;(i)<(n);++(i))
#define ref(i,a,b) for (long long (i)=(a); (i)<=(b); ++(i))
#define endl '\n'
#define st first
#define nd second
#define pb push_back
#define mp make_pair
const int mx=2e6+5;

int main(){
	ios_base::sync_with_stdio(false); cin.tie(0);
	ll n,m;cin >> n >> m;
	vector <int> a(n);
	int sum=0;
	rep(i,n){
		cin >> a[i];
		sum+=a[i];
	}
	if(sum>m)cout<<-1<<endl;
	else cout<<m-sum
}
	


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

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

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


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

#include <iostream>
 
int main() {
	int summer_days {};
  	std::cin >> summer_days;
  	
  	int num_of_assignments {};
  	std::cin >> num_of_assignments;
  
  	while(num_of_assignments > 0) {
    	int days_for_assignment {};
      	std::cin >> days_for_assignment;
      	summer_days -= days_for_assignment;
      	
      	num_of_assignments -= 1;
    }
  
  	if(summer_days < 0) {
    	std::cout << -1 << endl;
    }else {
    	std::cout << summer_days << endl;
    }
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   19 |         std::cout << -1 << endl;
      |                            ^~~~
      |                            std::endl
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:21:37: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   21 |         std::cout << summer_days << endl;
      |                                     ^~~~
      |                                     std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>

int main() {
	int summer_days {};
  	std::cin >> summer_days;
  	
  	int num_of_assignments {};
  	std::cin >> num_of_assignments;
  
  	while(num_of_assignments > 0) {
    	int days_for_assignment {};
      	std::cin >> days_for_assignment;
      	summer_days -= days_for_assignment;
      	
      	num_of_assignments -= 1
    }
  
  	if(summer_days < 0) {
    	std::cout << -1 << endl;
    }else {
    	std::cout << summer_days << endl;
    }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:32: error: expected ';' before '}' token
   15 |         num_of_assignments -= 1
      |                                ^
      |                                ;
   16 |     }
      |     ~                           
a.cc:19:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   19 |         std::cout << -1 << endl;
      |                            ^~~~
      |                            std::endl
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:21:37: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   21 |         std::cout << summer_days << endl;
      |                                     ^~~~
      |                                     std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C

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

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

    int sum = 0;
    rep(i,0,M) {
        int A; cin >> A;
        sum += A;
    }

    cout << max(M - sum, -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 argc, char **argv)
{

int a, b, i;
cin >> a >> b;
int arr[b];
for(i = 0;i < b; i++){
	cin >> arr[i];
	
	}




cout << a - arr.sum(); 







}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:17:17: error: request for member 'sum' in 'arr', which is of non-class type 'int [b]'
   17 | cout << a - arr.sum();
      |                 ^~~
Language: C

# include <bits/stdc++.h>

using namespace std;

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


Compiler output:
main.c:1:11: 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>t(M);
  int a=0;
  for(int i=0; i<M;i++){
    cin>>t.at(i);
    a=a+t.at(i);
  }
  if(N<a){
    cout<<"-1"<< endl;
  }
  else{
    cout<<N-a<< 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>

int main(){
  long n,m,x,s=0;
  cin>>n>>m;
  while(m--){
    cin>>x; s+=x;
  }
  if(n-s < 0) cout<<-1;
  else cout<<n-s;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   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:9:15: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |   if(n-s < 0) 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:10:8: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |   else cout<<n-s;
      |        ^~~~
      |        std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

int main(){
  long n,m,x,s=0;
  cin>>n>>m;
  while(m--){
    cin>>x; s+=x;
  }
  if(n-s < 0) cout<<-1;
  else cout<<n-s;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
    3 |   cin>>n>>m;
      |   ^~~
a.cc:7:15: error: 'cout' was not declared in this scope
    7 |   if(n-s < 0) cout<<-1;
      |               ^~~~
a.cc:8:8: error: 'cout' was not declared in this scope
    8 |   else cout<<n-s;
      |        ^~~~
Language: C++

#include<bits/stdc++.h>

int main(){
  long n,m,x,s=0;
  cin>>n>>m;
  while(m--){
    cin>>x; s+=x;
  }
  if(n-s < 0) cout<<-1;
  else cout<<n-s;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   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:9:15: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |   if(n-s < 0) 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:10:8: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |   else cout<<n-s;
      |        ^~~~
      |        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 <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 <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 <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<<n-sum;
  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<stdio.h>
int main()
{
  int N,M;
  scanf("%d,%d",&N,&M);
  int *k;
  k=malloc(sizeof(int)*M);
  int p,l=0;
  for(p=0;p<=M;p++)
  {
    k->p=malloc(sizeof()int);
    scanf("%d",&k->p);
    l=l+(k->p);
  }
  N=M-l;
  printf("%d",N);
  for(p=0;p<=M;p++)
  {
    free(k->p);
  }
  free(k);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:7:5: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
    7 |   k=malloc(sizeof(int)*M);
      |     ^~~~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    1 | #include<stdio.h>
  +++ |+#include <stdlib.h>
    2 | int main()
main.c:7:5: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
    7 |   k=malloc(sizeof(int)*M);
      |     ^~~~~~
main.c:7:5: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:11:6: error: request for member 'p' in something not a structure or union
   11 |     k->p=malloc(sizeof()int);
      |      ^~
main.c:11:24: error: expected expression before ')' token
   11 |     k->p=malloc(sizeof()int);
      |                        ^
main.c:12:18: error: request for member 'p' in something not a structure or union
   12 |     scanf("%d",&k->p);
      |                  ^~
main.c:13:11: error: request for member 'p' in something not a structure or union
   13 |     l=l+(k->p);
      |           ^~
main.c:19:5: error: implicit declaration of function 'free' [-Wimplicit-function-declaration]
   19 |     free(k->p);
      |     ^~~~
main.c:19:5: note: include '<stdlib.h>' or provide a declaration of 'free'
main.c:19:5: warning: incompatible implicit declaration of built-in function 'free' [-Wbuiltin-declaration-mismatch]
main.c:19:5: note: include '<stdlib.h>' or provide a declaration of 'free'
main.c:19:11: error: request for member 'p' in something not a structure or union
   19 |     free(k->p);
      |           ^~
main.c:21:3: warning: incompatible implicit declaration of built-in function 'free' [-Wbuiltin-declaration-mismatch]
   21 |   free(k);
      |   ^~~~
main.c:21:3: note: include '<stdlib.h>' or provide a declaration of 'free'
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:22: error: 'emdl' was not declared in this scope
   15 |   else cout << -1 << emdl;
      |                      ^~~~
Language: C++

#include<bits/stdc++.h>
int main(){
int n,m;cin>>n>>n;
  	int sum,j=0;
	while(cin>>j)sum+=j;
	if(sum>n) cout<<-1;
	else cout<<sum-n;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    3 | int n,m;cin>>n>>n;
      |         ^~~
      |         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:6:19: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 |         if(sum>n) 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:7:14: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |         else cout<<sum-n;
      |              ^~~~
      |              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>
int main(void){
  int a[10001];
  int n,m;
  scanf("%d%d",&n,&m);
  for(i=0;i<m;i++)scanf("%d",a[i]);
  int s=0;
  for(i=0;i<m;i++)s+=a[i];
  if(s>n)printf("-1");
  else printf("%d",n-s);
  return(0);
}

Compiler output:
main.c: In function 'main':
main.c:6:7: error: 'i' undeclared (first use in this function)
    6 |   for(i=0;i<m;i++)scanf("%d",a[i]);
      |       ^
main.c:6:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
using namespace std;
int main{
	int n;
	cin >> n;
	cout << 2*n * 3.1415926 <<endl;
}


Compiler output:
a.cc:3:5: error: cannot declare '::main' to be a global variable
    3 | int main{
      |     ^~~~
a.cc:4:9: error: expected primary-expression before 'int'
    4 |         int n;
      |         ^~~
a.cc:4:9: error: expected '}' before 'int'
a.cc:3:9: note: to match this '{'
    3 | int main{
      |         ^
a.cc:5:9: error: 'cin' does not name a type
    5 |         cin >> n;
      |         ^~~
a.cc:6:9: error: 'cout' does not name a type
    6 |         cout << 2*n * 3.1415926 <<endl;
      |         ^~~~
a.cc:7:1: error: expected declaration before '}' token
    7 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#include <string>
#include <array>



using namespace std;

int main(){
	
	int n, m;
	array<int, 1000> a;
	
	
	cin >> n >> m;
	
	for(int l = 0; l < m; l++){
		cin >> a[l];
		int sum += a[l];
	}

	int b = n - sum;
	
	if(b < 0){
		cout << "-1";
	}
	else{
		cout << b;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:25: error: expected initializer before '+=' token
   19 |                 int sum += a[l];
      |                         ^~
a.cc:22:21: error: 'sum' was not declared in this scope
   22 |         int b = n - sum;
      |                     ^~~
Language: C++

#include <bits/stdc++.h>
#include <string>
#include <array>



using namespace std;

int main(){
	
	int n, m;
	array<int, 1000> a;
	
	
	cin >> n >> m;
	
	for(int l = 0; l < m; l++){
		cin >> a[l];
		int sum += a[l];
	}

	int b = n - sum;
	
	if(b < 0){
		cout << "-1";
	}
	else{
		cout << b;
	}
}



Compiler output:
a.cc: In function 'int main()':
a.cc:19:25: error: expected initializer before '+=' token
   19 |                 int sum += a[l];
      |                         ^~
a.cc:22:21: error: 'sum' was not declared in this scope
   22 |         int b = n - sum;
      |                     ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n, a; cin n >> a;
  while(a--){
    int b; cin >> b;
    n -= b;
    if(n < 0){
      cout << -1;
      break;
    }
  }
  cout << n;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:16: error: expected ';' before 'n'
    4 |   int n, a; cin n >> a;
      |                ^~
      |                ;
Language: C

#include <bits/stdc++.h>

#define int long long
#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)

const unsigned int mod = 1e9 + 7;

using namespace std;

int32_t main() {
	fastio;

	int n, m;
	cin >> n >> m;
	int tot = 0;
	while(m--) {
		int x;
		cin >> x;
		tot += x;
	}
	if(tot <= n)
		cout << n - tot;
	else
		cout << -1;

	return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
 
#define REPI(i, a, n)	for(ll (i)=(a);(i)<(n);(i++))
#define REP(i,n) REPI(i,0,n)
#define REP1(i,n) for(ll (i)=1;(i)<=(n);(i++))
#define ALL(x) x.begin(), x.end()
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
 
struct ProconInit {
	static constexpr int IOS_PREC = 15;
	static constexpr bool AUTOFLUSH = false;
 
	ProconInit() {
		cin.tie(nullptr);
		ios::sync_with_stdio(false);
		cout << fixed << setprecision(IOS_PREC);
		if (AUTOFLUSH)
			cout << unitbuf;
	}
} PROCON_INIT;
 
int vector_finder(std::vector<int> vec, int number) {
	auto itr = std::find(vec.begin(), vec.end(), number);
	size_t index = std::distance(vec.begin(), itr);
	if (index != vec.size()) { // 発見できたとき
		return 1;
	}
	else { // 発見できなかったとき
		return 0;
	}
}
ll gcd(ll a, ll b) {
	if (a < b)swap(a, b);
	if (a % b == 0)return b;
	return gcd(a % b, b);
}
ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}
ll fact(ll n) {
	ll m;
	if (n == 0) {
		return 1;
	}
	m = fact(n - 1);
	return n * m;
}
 
ll Combination(unsigned long long n, unsigned long long r) {
	if (r * 2 > n) r = n - r;
	uintmax_t dividend = 1;
	uintmax_t divisor = 1;
	for (unsigned int i = 1; i <= r; ++i) {
		dividend *= (n - i + 1);
		divisor *= i;
	}
	return dividend / divisor;
}
 
struct vec {
	ll x, y;
 
	bool operator == (const vec &v) const{
		return x == v.x && y == v.y;
	}
 
};
 
namespace std {
	template<>
	class hash<vec> {
	public:
		size_t operator () (const vec& p) const { return p.x%SIZE_MAX; }
	};
}
 
int main() {
	ll N, M;
	cin >> N >> M;
	vector<ll> A(M)
	REP(i,M) cin >> A[i];
	if (ll s = accumulate(ALL(A), 0) - N; s >= 0){
		cout << s << endl;
	}
	else{
		cout << -1 << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:25: error: expected ',' or ';' before 'for'
    5 | #define REPI(i, a, n)   for(ll (i)=(a);(i)<(n);(i++))
      |                         ^~~
a.cc:6:18: note: in expansion of macro 'REPI'
    6 | #define REP(i,n) REPI(i,0,n)
      |                  ^~~~
a.cc:84:9: note: in expansion of macro 'REP'
   84 |         REP(i,M) cin >> A[i];
      |         ^~~
a.cc:84:13: error: 'i' was not declared in this scope
   84 |         REP(i,M) cin >> A[i];
      |             ^
a.cc:5:41: note: in definition of macro 'REPI'
    5 | #define REPI(i, a, n)   for(ll (i)=(a);(i)<(n);(i++))
      |                                         ^
a.cc:84:9: note: in expansion of macro 'REP'
   84 |         REP(i,M) cin >> A[i];
      |         ^~~
Language: C++

#include <iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: 'i' was not declared in this scope
   13 |         n-=day[i];
      |                ^
Language: C

#include<bits/stdc++.h>
using namespace std;
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pil pair<int,ll>
#define pli pair<ll,int>
#define mod 1000000000
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
ll power(ll a,int n){
  if(n==0)
    return 1;
  if((n%2)==0)
    return power(a*a,n/2);
  else
    return a*power(a*a,n/2);    
}

int main(){
FASTIO
ll n,m;
cin>>n>>m;
vector<ll> a(m);
ll s=0;
for(int i=0;i<m;i++){
  cin>>a[i];
  s+=a[i];
}
ll ans=n-s;
if((n-s)<0){
  ans=-1;
}
cout<<ans;
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>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define REP1(i, n) for(int i = 1; i <= (n); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef vector<string> vs;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<int, int> Pi;
typedef queue<Pi> QPi;
typedef pair<ll, ll> Pll;
typedef queue<Pll> QPll;
typedef vector<vi> Graph;
const int mod = 1000000007;
// 小数点　<< fixed << setprecision(0) <<
// sort降順　sort(ALL(),greater<int>());
// 円周率　M_PI
// 文字判定　isupper islower
// 順列　do {} while(next_permutation(ALL(X)));
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
struct edge {
    int from; //出発点
    int to;   //到達点
    int cost; //移動コスト
};
typedef struct edge se;
typedef vector<edge> ve;
unsigned euclidean_gcd(unsigned a, unsigned b) {
  if(a < b) return euclidean_gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}

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

  return 0;
}


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

package main
 
import (
  "fmt"
  "math"
)
 
func main() {
  var n, m int
  fmt.Scan(&n, &m)
  a := make([]int, m)
  for i := range a {
    fmt.Scan(&a[i])
  }
  ans := 0
  for _, x := range a {
    ans += x
  }
  fmt.Println(math.Max(float64(n - ans), -1))
}

Compiler output:
main.c:1:1: error: unknown type name 'package'
    1 | package main
      | ^~~~~~~
main.c:3:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'import'
    3 | import (
      | ^~~~~~
Language: C

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

int main() {

    int N,M;
    cin >> N >> M;
    
    int sum = 0;
    int x;
    
    rep (i,M) {
        cin >> x;
        sum += x;
    }
    
    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 <bits/stdc++.h>
using namespace std;

#define ll long long
#define rep(i,x,y) for(int i=x;i<y;i++)
#define rel(i,x,y) for(int i=x-1;i>=y;i--)
#define all(x) x.begin(),x.end()

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    ll n,m; cin >> n >> m;
    ll ans = 0;
    rep(i,0,m){
        ll tmp;
        cin >> tmp;
        ans += tmp;
    }
    if(n-ans>=0) cout << n-ans << 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 a,b;
  cin>>a>>b;
  vector<int> v(b);
  for(int i=0;i<b;i++){
    cin>>v[i];
  }
  int count=0;
  for(int i=0;i<b;i++){
    count+=v[i];
  }
  if(count>a){
    cout<<-1<<endl;
  }
  else{
    cout<<a-count<<endl;
  }
}

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

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

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


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

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

int main() {
  int n, m;
  cin >> n >> m;
  vector<int>a(m);
  int ans = 0;
  rep(i,m) {
    cin >> a[i];
    ans += a[i];
  }
  ans = n-ans;
  if(ans >= 0) cout << ans << 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,s=0;
  cin>>n>>m;
  while(m--)
  {
     int x;
    fin>>x;
    s+=x;
  }
  if(s>n)cout<<-1;
  else cout<<n-s;
}

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

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

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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int M, N, D = 0;
  cin >> M >> N;
  
  vector<int> A(M);
  for (int i = 0; i < M; i++) {
    cin >> A.at(i);
  }
  for (int i = 0; i < N; i++) {
    D += A.at(i);
  }
  if (D > N) {
    cout << "-1" << endl;
  }
  else {
    cout << N-D << 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 M, N, D = 0;
  cin >> M >> N;
  
  vector<int> A(M);
  for (int i = 0; i < M; i++) {
    cin >> A.at(i);
  }
  for (int i = 0; i < M; i++) {
    D += A.at(i);
  }
  if (D > N) {
    cout << "-1" << endl;
  }
  else {
    cout << N-D << 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 M, N, D;
  cin >> M >> N;
  
  vector<int> A(M);
  for (int i = 0; i < M; i++) {
    cin >> A.at(i);
  }
  for (int i = 0; i < M; i++) {
    D += A.at(i);
  }
  if (D > N) {
    cout << -1 << endl;
  }
  else {
    cout << N-D << 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 M, N, D;
  cin >> M >> N;
  
  vector<int> A(M);
  for (int i = 0; i < M; i++) {
    cin >> A.at(i);
  }
  for (int i = 0; i < M; i++) {
    D += A.at(i);
  }
  if (D > N) {
    cout << "-1" << endl;
  }
  else {
    cout << N-D << 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 M, N, D = 0;
  cin >> M >> N;
  
  vector<int> A;
  for (int i = 0; i < M; i++) {
    cin >> A.at(i);
  }
  for (int i = 0; i < N; i++) {
    D = D + A.at(i);
  }
  if (D > N) {
    cout << "-1" << endl;
  }
  else {
    cout << N-D << 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 M, N, D = 0;
  cin >> M >> N;
  
  vector<int> A(M);
  for (int i = 0; i < M; i++) {
    cin >> A(i);
  }
  for (int i = 0; i < N; i++) {
    D += A(i);
  }
  if (D > N) {
    cout << "-1" << endl;
  }
  else {
    cout << N-D << 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;

#ifdef LOCAL
#define debug(var) cerr << (#var) << " = " << (var) << endl;
#else
#define debug(var)
#endif

void init() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
}

void solve() {
    int n, m; scanf("%d%d", &n, &m);
    for (int i = 0; i < m; ++i) {
        int a; scanf("%d", &a);
        ans += a;
    }
    ans = n-ans;
    printf("%d", ans>0?ans:-1);
}

int main() {
    init();
    int t = 1; //scanf("%d", &t);
    while (t--) {
        solve();
    }
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:19:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   19 |         ans += a;
      |         ^~~
      |         abs
a.cc:21:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   21 |     ans = n-ans;
      |     ^~~
      |     abs
Language: C

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

#ifdef LOCAL
#define debug(var) cerr << (#var) << " = " << (var) << endl;
#else
#define debug(var)
#endif

void init() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
}

void solve() {
    int n, m; scanf("%d%d", &n, &m);
    for (int i = 0; i < m; ++i) {
        int a; scanf("%d", &a);
        ans += a;
    }
    ans = n-ans;
    printf("%d", ans>0?ans:-1);
}

int main() {
    init();
    int t = 1; //scanf("%d", &t);
    while (t--) {
        solve();
    }
    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 a;
  cin >> a;
  int count = 0;
  int b;
  for(int i=0;i<a;i++){
  cin >> b;
    count += b;
  }
  if(a >= count){
  cout << a - count << endl;
  }
  else{
    cout << "-1" << endl;
}
}

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

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

int main() {
  int a;
  cin >> a;
  int count = 0;
  int b;
  for(int i=0;i<a;i++){
  cin >> b;
    count += b;
  }
  if(a >= count){
  cout << a - count << endl;
  }
  else{
    cout << "-1" << endl;
}


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

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

int main() {
  int a;
  cin >> a;
  int count = 0;
  int b;
  for(int i=0;i<a;i++){
  cin >> b;
    count += b;
  }
  cout << a - count << endl;
}


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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:21: error: 'N' was not declared in this scope
   12 | for (int i = 0; i < N; i++) {
      |                     ^
a.cc:20:2: error: expected '}' at end of input
   20 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C

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


return 0;
}


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

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

int main()
{
  int N, M; cin >> N >> M;
  vector<int> A(M);
  rep(i,M) cin >> A[i];
  
  int sum = 0;
  rep(i,M) sum += A[i];
  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;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const long long INF = 1LL << 60; 

int main()
{
  int N, M; cin >> N >> M;
  vector<int> A(M);
  rep(i,M) cin >> A[i];
  
  int sum = 0;
  rep(i,M) sum += A[i];
  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;

int main()
{
  int n,m,a;
  cin >> n >> m;
  
  for(int i = 0; i < m; i++)
  {
    cin >> a;
    n-= a;
  }
  
  cout << max(a,-1) << enld;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:24: error: 'enld' was not declared in this scope
   16 |   cout << max(a,-1) << enld;
      |                        ^~~~
Language: C

 #include<stdio.h>
 int main(void)
 {
     long A[10000];
     int N,M,i;
     scanf("%d%d",&N,&M);
     for(i=0;i<M;i++)
       scanf("%ld",&A[i]);
   
     for(i=0;i<M;i++)
       N=N-A[i];
     
     if(N>=0) printf("%d\n",N);
     else     printf("-1\n");
   return 0
 }

Compiler output:
main.c: In function 'main':
main.c:15:12: error: expected ';' before '}' token
   15 |    return 0
      |            ^
      |            ;
   16 |  }
      |  ~
Language: Java

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] homework = scanner.nextLine().split(" ");
        String[] days =scanner.nextLine().split(" ");
        int daySum = Arrays.stream(days).mapToInt(Integer::parseInt).sum();
        int d = Integer.parseInt(homework[0]) - daySum;
        if (d < 0) {
            System.out.println(-1);
        }else {
            System.out.println(d);
        }
    }
}


Compiler output:
Main.java:4: error: cannot find symbol
        Scanner scanner = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
        Scanner scanner = new Scanner(System.in);
                              ^
  symbol:   class Scanner
  location: class Main
Main.java:7: error: cannot find symbol
        int daySum = Arrays.stream(days).mapToInt(Integer::parseInt).sum();
                     ^
  symbol:   variable Arrays
  location: class Main
3 errors
Language: Java

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        // write your code here
        int N;
        int M;
        int i=0;
        int Sum=0;

       
        Scanner scan = new Scanner(System.in);
        N = scan.nextInt();

        Scanner scan2 = new Scanner(System.in);
        M = scan2.nextInt();

        int[] A = new int[M];

        while (i < M) {
            Scanner scan3 = new Scanner(System.in);

            A[i] = scan3.nextInt();
            Sum = Sum + A[i];
            i = i + 1;
        }
    int Days=N-Sum;
        
        if (Days<0){System.out.println("-1");}
        
        else {System.out.println(Days);
        
    }
}

Compiler output:
Main.java:35: error: reached end of file while parsing
}
 ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
  int N, M, X, Y;
  X = 0;
  cin >> N >> M;
  vector<int> vec(M);
  for (int i = 0; i < M; i++) {
    cin >> A.at(i);
  }
  for (int i = 0; i < M; i++) {
    X += A.at(i);
  }
  Y = N - X;
  cout << Y << endl;
}
  
    


Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: 'A' was not declared in this scope
   10 |     cin >> A.at(i);
      |            ^
a.cc:13:10: error: 'A' was not declared in this scope
   13 |     X += A.at(i);
      |          ^