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

#include<stdio.h>
#include<math.h>
#define pb push_back
//#define FAST ios::sync_with_stdio(false);cin.tie(NULL),cout.tie(NULL);
//typedef long long ll;
#define pi acos(-1.0)
using namespace std;

int main()
{
     int n,m,a,b=0,ans=0;
scanf("%d%d",&n,&m);
     while(m--)
     {
scanf("%d",&a) ;
        b+=a;
     }
     if(n-b>=0)
        printf("%d\n",n-b);
     else
        printf("-1\n");
//    cin>>r;
//    cout<<2*pi*r<<fixed<<setprecision(12)<<endl;
    return 0;
}


Compiler output:
main.c:7:1: error: unknown type name 'using'
    7 | using namespace std;
      | ^~~~~
main.c:7:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    7 | using namespace std;
      |                 ^~~
Language: C

#include<stdio.h>
#include<stdlib.h>

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


Compiler output:
main.c: In function 'main':
main.c:14:25: error: expected expression before ')' token
   14 |     if (scanf("%d",&a)==){
      |                         ^
Language: C

/*input
314 15
9 26 5 35 8 9 79 3 23 8 46 2 6 43 3
*/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 

#define rep(i,j,n) for(i=j;i<n;i++)
#define repi(i,j,n) for(i=j;i>n;i--)
#define inf 100001
#define M 1000000007
#define ll long long
#define ld long double
#define vll vector<long long>
#define vi vector<int>
#define pll pair<long long,long long>
#define pii pair<int,int>
#define vpii vector<pair<int,int> >
#define vpll vector<pair<long long,long long> >
#define pb push_back
#define pf pop_front
#define F first
#define S second
#define endl '\n'

using namespace std;
using namespace __gnu_pbds; 

template<typename T>
using ordered_set=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;


ll power(ll a,ll m,ll mod){
	ll ans=1;
	while(m){
		if(m%2){
			ans*=a;
			ans%=(mod);
		}
		a=(a*a)%(mod);
		m>>=1;
	}
	return ans;
}


void init(ll* a,ll n,ll val){
	for(ll i=0;i<n;i++)
		a[i]=val;
}



int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);	
	ll t=1,i,j;
	ll n,m;
	cin>>n>>m;
	ll a;
	ll k=0;
	rep(i,0,m)cin>>a,k+=a;
	n-=k;
	if(n<0)n=-1;
	cout<<n<<endl;
	return 0;
}




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

#include<stdio.h>
int main(){
  int day, work, i, sum=0, fun;
  int d[];
  
  scanf("%d %d", &day, &work);
  
  for(i=0;i<work;i++){
  	scanf("%d", d[i]);
    sum+=d[i];
  }
  
  fun=day-sum;
  if(fun<0){
  	printf("-1\n");
  }
  else{
  	printf("%d", &fun);
  }
  
  return 0;
  
  
  
}

Compiler output:
main.c: In function 'main':
main.c:4:7: error: array size missing in 'd'
    4 |   int d[];
      |       ^
Language: C

// 154 B

#include <iostream>
#include <string>
#include <vector>
#include <numeric>

using namespace std;

int main(){
    int n, m, tmp, sum;
    cin >> n >> m;
    vector<int > v;
    for(int i=0; i<m; i++){
        cin >> tmp;
        v.push_back(tmp);
    }
    sum = accumulate(v.begin(), v.end(), 0);
    if(n-sum < 0) cout << -1 << endl;
    else cout << n-sum << endl;
    return 0;
}


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

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

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

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


Compiler output:
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;
  cin>>N>>M;
  int D,S;
  for(int i=0;i<M;i++){
    cin>>D;
    S+=D;
  }

  if((N-S)<0)cout<<-1<<endl;
  else cout<<N-S<<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 <bit/stdc++.h>
using namespace std;

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

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

#include <bits/stdc++.h>

using namespace std;

long long n, m;
vector <int> a;
int main(){
  int tmp;
  cin >> n >> m;
  cin.ignore();
  long long sum = 0;
  for (int i = 0; i < m; i++){
    cin >> tmp;
    sum += tmp;
  }

  if(n < sum){
    cout << "-1" << endl;
    return 0;
  }
  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

N,M = map(int,input().split())
A = list(map(int,input().split()))
print(N-sum(A) if N>=sum(A) else -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:3: error: type defaults to 'int' in declaration of 'M' [-Wimplicit-int]
    1 | N,M = map(int,input().split())
      |   ^
main.c:1:7: error: implicit declaration of function 'map' [-Wimplicit-function-declaration]
    1 | N,M = map(int,input().split())
      |       ^~~
main.c:1:11: error: expected expression before 'int'
    1 | N,M = map(int,input().split())
      |           ^~~
main.c:2:1: error: expected ',' or ';' before 'A'
    2 | A = list(map(int,input().split()))
      | ^
Language: C

#include <iostream>
#include <array>
using namespace std;

int main(){
    int n,m,sum=0;
    array<int,1000> working_day;
    cin >> n >> m;
    for(int i=1;i<=m;i++){
        cin >>  working_day[i];
        sum += working_day[i];
    }
    if(n >= sum ){
        cout << n - sum;
    }else{
        cout << -1;
    }
    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 ll long long
#define sf scanf
#define pf printf 
#define nl printf("\n")
#define pi acos(-1)

int main()
{
    #ifndef ONLINE_JUDGE
        //freopen("in.txt","r",stdin);
        //freopen("out.txt","w",stdout);
    #endif

    ll n,m,x,sum=0;
    sf("%lld %lld",&n,&m);
    for(int i=0; i<m; i++){
        sf("%lld",&x);
        sum += x;
    }
    if(sum>n) pf("-1\n");
    else  pf("%lld\n",n-sum);
    return 0;
}

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 't' was not declared in this scope
   10 |   t=n-v;
      |   ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
int main(void){
  int N,M;
  cin >> N >> M;
  int sum=0;
  for(i=0;i<M;i++){
    int tmp = 0;
     cin >> tmp;
     sum+= tmp;
  }
  if(N-sum>=0) cout << N-sum << endl;
  else cout << -1 << endl;
  return 0;
}


Compiler output:
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:8:7: error: 'i' was not declared in this scope
    8 |   for(i=0;i<M;i++){
      |       ^
a.cc:13:16: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |   if(N-sum>=0) cout << N-sum << endl;
      |                ^~~~
      |                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:33: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   13 |   if(N-sum>=0) cout << N-sum << endl;
      |                                 ^~~~
      |                                 std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:14:8: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |   else cout << -1 << endl;
      |        ^~~~
      |        std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:14:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   14 |   else cout << -1 << 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>
using namespace std;

#define ll long long int
#define pb push_back
#define fi first
#define se second
#define mp make_pair
#define mt make_tuple
#define all(A) A.begin(), A.end()
#define sz(A) (int)A.size()
typedef vector <int> vi;
typedef vector <ll> vl;
typedef pair <int, int> pii;
const ll mod = 1e9 + 7;
//const ll mod = 998244353;
const int inf = 1e9;
//const ll inf = 1e18;
const int N = 2e5;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll n, m;
	cin >> n >> m;
	ll a[n];
	ll res = 0;
	for (ll i = 0; i < m; i++) {
		cin >> a[i];
		res += a[i];
	} 
	if (res > n) cout << -1 << "\n";
	else cout << (n - res) << "\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 <bits/stdc++.h>

int main(int, char**) {
        int64_t N, M, A;
        std::cin >> N >> M;
        for (int i; i<M; i++) {
                std::cin >> A;
                N = N - A;
                if (N < 0) {
                        N = -1;
                        break;
                }
        }
        std::cout << N << std::endl;
        return 0;
}
~   

Compiler output:
a.cc:17:2: error: expected class-name at end of input
   17 | ~
      |  ^
Language: C

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

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

#include <iostream>
using namespace std;

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

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

#include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <list>
#include <numeric>
#include <map>	
#include <cmath>
#include <string>
#define rep(i,n) for(int i=0;i<n;i++)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define Cout(s) cout<<s<<endl
using namespace std;
typedef long long ll;
string Yes(bool b) { if (b) { return "Yes"; } else { return "No"; } }
string YES(bool b) { if (b) { return "YES"; } else { return "NO"; } }
//================================================
int ketawa(int a) {
	if (a < 10)return a;
	else return a % 10 + ketawa(a / 10);
}

int a = 1, b = 0, c, d, n, k = 0, ans = 0;
string s, t;

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

	return 0;
}


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

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

template<typename T>
istream& operator >> (istream& istr, vector<T>& v){
    for(T& x: v) istr >> x;
    return istr;
}

template<typename T, typename U>
istream& operator >> (istream& istr, pair<T,U>& p){
    istr >> p.first >> p.second;
    return istr;
}

template<typename T>
ostream& operator << (ostream& ostr, vector<T>& v){
    if(!v.empty()){
        ostr << v.front();
        for(auto itr = ++v.begin(); itr != v.end(); itr++)
            // ostr << *itr;
            ostr << " " << *itr;
    }
    return ostr;
}

template<typename T, typename U>
ostream& operator << (ostream& ostr, pair<T,U>& p){
    // ostr << p.first << p.second;
    // ostr << p.first << ", " << p.second;
    ostr << "(" << p.first << ", " << p.second << ")";
    return ostr;
}

template<typename T>
ostream& operator << (ostream& ostr, vector<vector<T>>& vv){
    if(!vv.empty()){
        ostr << vv.front();
        for(auto itr = ++vv.begin(); itr != vv.end(); itr++)
            ostr << endl << *itr;
    }
    return ostr;
}

template<typename T, typename U>
ostream& operator << (ostream& ostr, vector<pair<T,U>>& vp){
    if(!vp.empty()){
        ostr << vp.front();
        for(auto itr = ++vp.begin(); itr != vp.end(); itr++)
            ostr << endl << *itr;
    }
    return ostr;
}

typedef long long ll;
typedef vector<ll> vll;
typedef vector<char> vc;
typedef vector<double> vd;
// vll v(n); v[i]=x;
typedef vector<vll> vvll;
typedef vector<vc> vvc;
typedef vector<vd> vvd;
// vvll v(m,vll(n)); v[i][j]=x;
typedef pair<ll,ll> pll;
typedef pair<double,double> pd;
typedef vector<pll> vpll;
typedef vector<pd> vpd;
// vpll v(n); v[i]=make_pair(x,y); v[i].first/second;
// v.front() : v[0]
// v.back()  : v[v.size()-1]

#define PI 3.1415926535897932
#define EPS 1e-12
#define INF ((ll)1e+12)
#define REP(i,n) for(ll i=0; i<(n); i++)
#define RREP(i,n) for(ll i=(n)-1; i>=0; i--)
#define FOR(i,a,b) for(ll i=(a); i<=(b); i++)
#define FORR(i,a,b) for(ll i=(b); i>=(a); i--)
#define fix(x) cout << fixed << setprecision(x)
#define dump(x) cout << #x << " = " << (x) << endl
#define all(x) (x).begin(),(x).end()

template<typename T> T sum(vector<T>& v){return accumulate(all(v), (T)0);}
template<typename T> inline void sort(vector<T>& v){sort(all(v));}
template<typename T> inline void rsort(vector<T>& v){sort(all(v), greater<T>());}
template<typename T> inline void chmin(T& a, T b){if(a>b) a=b;}
template<typename T> inline void chmax(T& a, T b){if(a<b) a=b;}

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


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

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

int main(){
	int n, m;
	scanf("%d%d", &n, &m);
	int sum = 0;
	rep(i, m){
		int a;
		scanf("%d", &a);
		sum += a;
	}
	if(sum > n) cout << "-1" << endl;
	else cout << n - sum << endl; 
	return 0;
}

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

#include <stdio.h>
#include <stdlib.h>
int main(void){
  int days;
  int num;
  int sum;
  int day;
  
  scanf("%d %d",&days,&num);

  for(int i = 0; i < num; i++){
    scanf("%d",day);
    sum += day;
  if(days - sum > 0){
    printf("%d\n",(days - sum));
  }else{
    printf("-1");
  }
  return 0;
  }

Compiler output:
main.c: In function 'main':
main.c:20:3: error: expected declaration or statement at end of input
   20 |   }
      |   ^
Language: C

#include <bits/stdc++.h>
using namespace std;
#define M 1000000007
#define ll long long
int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output1.txt", "w", stdout);
#endif
	int n, m, a, sum = 0;
	cin >> n  >> m;
	for (int i = 0; i < m; i++) {
		cin >> a;
		sum += a;
	}
	if (sum > n) {
		cout << -1 ;
	}
	else {
		cout << (n - sum);
	}
}

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

#include <stdio.h>

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

Compiler output:
main.c: In function 'main':
main.c:9:29: error: expected ')' before ';' token
    9 |   for (int i = 0; i < m; i++;)
      |       ~                     ^
      |                             )
Language: C

#include<stdio.h>
int main()
{
int a,b,d,j;
  d=0;
scanf("%d %d",&a,&b);
int c[b];
  for(j=0;j<b;++j)
  {
  scanf("%d",&c[j]);
  d=d+c[j];
  }
if(a<d) printf("-1");
  else printf("%d",a-d)
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:24: error: expected ';' before 'return'
   14 |   else printf("%d",a-d)
      |                        ^
      |                        ;
   15 | return 0;
      | ~~~~~~
Language: C

#include <iostream>
using namespace std;
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
typedef long long ll;
#include <cmath>

int main(int argc, char *argv[])
{
	int n,m;
	cin >>n>>m;
	for (int i=0;i<m;i++)
	{
		int t;
		cin>>t;
		n-=t;
	}
	if (n<0) n=-1;


	cout<< n<< endl;
	return 0;
}


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

#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define nl '\n'
#define pi 2.0*acos(0.0)
#define mod maxm+7
#define FOR(i,j,n)    for(ll i=j;i<n;i++)
#define RFOR(i,j,n)    for(ll i=j;i>=n;i--)
#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef long long int ll;
typedef unsigned long long ull;
typedef long double ld;

int main(){
    ll m,n,sum = 0;
    cin>>m>>n;
    ll arr[n];
    FOR(i,0,n) cin>>arr[i] , sum += arr[i];
    ll ans = m - sum;
    if(ans < 0) cout<< - 1 <<nl;
    else cout<< ans <<nl;
}


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

#include <iostream>
using namespace std;
int main()
{
    int holiday, assign;
    cin>>holiday>>assign;
    long task=0;
    while(assign--)
    {
        long x;
        cin>>
        task+=x;
    }
    long rem = holiday-task;
    if(task<0){
        cout<<-1<<"\n";
    }
    else
    {
        cout<<rem<<"\n";
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: no match for 'operator+=' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'long int')
   11 |         cin>>
      |         ~~~~~
   12 |         task+=x;
      |         ~~~~^~~
Language: C++

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

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

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin >> N >> M;
      |   ^~~
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> A(M);
      |   ^~~~~~
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> A(M);
      |          ^~~
a.cc:10:12: error: 'A' was not declared in this scope
   10 |     cin >> A[i];
      |            ^
a.cc:14:5: error: 'cout' was not declared in this scope
   14 |     cout << -1 << endl;
      |     ^~~~
a.cc:14:19: error: 'endl' was not declared in this scope
   14 |     cout << -1 << endl;
      |                   ^~~~
a.cc:16:5: error: 'cout' was not declared in this scope
   16 |     cout << N - ans << endl;
      |     ^~~~
a.cc:16:24: error: 'endl' was not declared in this scope
   16 |     cout << N - ans << endl;
      |                        ^~~~
Language: C

#include<iostream>
using namespace std;
int main()
{
    long double p = 3.14159265359;
    long long  n,m;
    cin>>m>>n;
    long long a[n];
    long long sum = 0;
    long long o = -1;
    for(int i=0;i<n;i++){
        cin>>a[i];
        sum += a[i];
    }
    cout<<max(m-sum,o);
    }



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

#include <iostream>
#include<algorithm>
using namespace std;

int fre[1000000+1];
int main()
{
    cin.tie(0);
    cin.sync_with_stdio(0);
    int n,x,a; cin>>n>>x;
    long long s=0;
    for(int i=0;i<x;i++){
            cin>>a;
            s+=a;
    }
    if(s>n) cout<<-1;
    else cout<<n-s;
}


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

#inlcude <iostream>
using namespace std;
int main()
{
    int holiday, assign;
    cin>>holiday>>assign;
    long task=0;
    while(assign--)
    {
        long x;
        cin>>
        task+=x;
    }
    long rem = holiday-task;
    if(task<0){
        cout<<-1<<"\n";
    }
    else
    {
        cout<<rem<<"\n";
    }
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    1 | #inlcude <iostream>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin>>holiday>>assign;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inlcude <iostream>
a.cc:16:9: error: 'cout' was not declared in this scope
   16 |         cout<<-1<<"\n";
      |         ^~~~
a.cc:16:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:20:9: error: 'cout' was not declared in this scope
   20 |         cout<<rem<<"\n";
      |         ^~~~
a.cc:20:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C

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


public class Main {

	public static void main(String[] args) throws IOException {
			BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
			String W = in.readLine();

			int N= Integer.parseInt(W.split(" ")[0]);
			int M= Integer.parseInt(W.split(" ")[1]);
			W = in.readLine();
//			int[] A = new int[M];
			int homework =0;

			for(int i=0;i<M;i++) {
				homework+= Integer.parseInt(W.split(" ")[i]);
			}

			int ans = N - homework;

			if(ans >=0) {
				System.out.println(ans);
			}else {
				System.out.println(-1);
			}

	}

}


Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.io.BufferedReader;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.io.BufferedReader;
      |            ^
main.c:2:1: error: unknown type name 'import'
    2 | import java.io.IOException;
      | ^~~~~~
main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | import java.io.IOException;
      |            ^
main.c:3:1: error: unknown type name 'import'
    3 | import java.io.InputStreamReader;
      | ^~~~~~
main.c:3:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    3 | import java.io.InputStreamReader;
      |            ^
main.c:6:1: error: unknown type name 'public'
    6 | public class Main {
      | ^~~~~~
main.c:6:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    6 | public class Main {
      |              ^~~~
Language: C++

#include <iostream> // cout, endl, cin
#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 <cmath>
#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
using namespace std;

int Main(){
  int N,M;
  vector<int> homework(M);
  int kei=0;

  cin >> N;
  cin >> M;

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


Compiler output:
a.cc: In function 'int Main()':
a.cc:38:1: warning: no return statement in function returning non-void [-Wreturn-type]
   38 | }
      | ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C

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

# define C continue;
# define R return

# define D double
# define I insert
# define ll long long
# define ld long double

# define ull unsigned long long
# define ui unsigned int

# define pb push_back
# define pf push_front

# define vi vector < int >
# define vc vector < char >
# define vs vector < string >
# define vb vector < bool >
# define vd vector < D >
# define vll vector < ll >
# define vull vector < ull >
# define vld vector < ld >
# define PQ priority_queue

# define vvi vector < vector < int > >
# define vvb vector < vector < bool > >
# define vvc vector < vector < char > >
# define vvs vector < vs >
# define vvll vector < vector < ll > >
# define vvd vector < vector < D > >
# define vvld vector < vector < ld > >

# define all(v) (v).begin() , (v).end()
# define allrev(v) (v).rbegin() , (v).rend()
# define allcomp(v) v.begin() , v.end() , comp
# define allrevcomp(v) v.rbegin() , v.rend() , comp

# define pii pair < int , int >
# define pll pair < ll , ll >
# define pld pair < ld , ld >
# define pDD pair < D , D >

# define vpld vector < pld >
# define vpii vector < pii >
# define vpll vector < pll >
# define vpDD vector < pDD >

# define vvpii vector < vector < pii > >
# define F first
# define S second
# define mp make_pair

# define dist(a,b,p,q) sqrt((p-a)*(p-a) + (q-b)*(q-b))

# define pp(n) printf("%.10Lf",n);
# define line cout<<"\n";
# define fast ios_base::sync_with_stdio(false) ; cin.tie(0) ; cout.tie(0);

string vow = "aeiou";
int month[] = {-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

const int dxhorse[] = {-2, -2, -1, -1, 1, 1, 2, 2};
const int dyhorse[] = {1, -1, 2, -2, 2, -2, 1, -1};

const int dx[] = { -1 , 0 , 1 , 0 } ;
const int dy[] = { 0 , 1 , 0 , -1 } ;

const ld pie = 3.1415926535897932384626 ;
const ll mod = 1e9 + 7 ;

/// Tip : If a and b are positive integers ; we may say - ceil (a/b) = 1 + floor ( (a-1)/b ) .

void solve ( int test_case )
{
    ll d , n ;
    cin >> d >> n ;

    ll s = 0 ;
    for ( int i=0 ; i < n ; i ++ )
    {
        ll t ;
        cin >> t ;

        s += t ;
    }

    ll ans = d - s ;

    if ( ans < 0 ) cout << -1 ;
    else cout << ans ; line ;

}

int main()
{
    int t = 1;
    // cin >> t;

    for ( int i=1 ; i <= t ; i ++ ) solve ( i ) ;
    return 0;
}


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

#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp> // Common file
#include<ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;
using namespace __gnu_pbds;
#define ll long long
#define pp pair<ll,ll>
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin() , (x).end()
#define rep(i,a,b) for( ll i = a ; i < b ; i+=1 )
#define sz(v) (ll)(v.size())
#define hell (ll)998244353
#define slld(x) scanf("%lld",&x)
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> oset;
#define ld long double
ll t = 1, tt;
inline ll add(ll x,ll y){x+=y;return x%hell;}
inline ll mult(ll x,ll y){x%=hell;y%=hell;return (x*y)%hell;}
inline ll powMod(ll base,ll expo){
	ll ans=1;
	expo%=(hell-1);
	while(expo){
		if(expo&1)ans=mult(ans,base);
		base=mult(base,base);
		expo>>=1;
	}
	return ans;
}
void solve(){
	ll n, m;
	cin>>n>>m;
	rep(i,0,m){
		ll x;
		cin>>x;
		n-=x;
	}
	if(n<0)cout<<"-1";
	else
		cout<<n;
}
signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
	//cin>>t;
	tt=t;
    while(t--){
        solve();
        if(t!=0)cout<<"\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: Java

import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int holiday = sc.nextInt();
		int homework = sc.nextInt();
		int days = 0;
		for (int i = 0; i < homework; i++) {
			days += sc.nextInt();
		}
		sc.close();

		if (holiday < days) {
			System.out.print(-1);
		} else {
			System.out.print(holiday - days);
		}
	}


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

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

int main() {
  int N, M, temp, sum = 0;

  cin >> N >> M;

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

  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++

int main() {
 cin.tie(0);
 ios::sync_with_stdio(false);
 int n;
 int m;
 int work = 0;
 cin >> n >> m;
 vector<int> vec(m);
 for (int i = 0; i < m; ++i){
	 cin >> vec[i];
	 work += vec[i];
 }
 cout << n - work;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:2:2: error: 'cin' was not declared in this scope
    2 |  cin.tie(0);
      |  ^~~
a.cc:3:2: error: 'ios' has not been declared
    3 |  ios::sync_with_stdio(false);
      |  ^~~
a.cc:8:2: error: 'vector' was not declared in this scope
    8 |  vector<int> vec(m);
      |  ^~~~~~
a.cc:8:9: error: expected primary-expression before 'int'
    8 |  vector<int> vec(m);
      |         ^~~
a.cc:10:17: error: 'vec' was not declared in this scope
   10 |          cin >> vec[i];
      |                 ^~~
a.cc:13:2: error: 'cout' was not declared in this scope
   13 |  cout << n - work;
      |  ^~~~
Language: C

#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define fi first
#define se second
ll sieve[1000001]={0},i,j;
ll m=1e9+7;
ll lev=0;
ll n,k;
ll power(ll p, ll k)
{
ll a=1;
while(k)
{
if(k&1)
a=(a*p)%m;
p=(p*p)%m;
k>>=1;
}
return a;
}
using namespace std;
vector<ll> v[1000000+1];
ll vis[1000000+1]={0};
void dfs(ll u,ll p,ll lev)
{
    vis[u]=lev;
for(auto x: v[u])
{
if(x!=p)
{
dfs(x,u,lev+1);
}
}
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
 int tc=1;
//cin>>tc;
ll cas=1;
 while(tc--)
 {
  
 ll n,m;
 cin>>n>>m;
 ll a[m];
 ll ans=n;
 for(i=0;i<m;i++)
 {
 cin>>a[i];
 ans-=a[i];
  }
  if(ans>=0)
  cout<<ans;
  else
  cout<<-1;
     cout<<"\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

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

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

using namespace std;

int main(int argc, const char * argv[]) {
    // insert code here...
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);


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

    
    int total =0;

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


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

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

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

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

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

    
}

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

import java.util.*;
public  class Main
{
public static void main(String args[])
{
  Scanner sc=new Scanner(System.in);
  String h[]=sc.nextLine().split(" ");
  String hh[]=sc.nextLine().split(" ");
  int s=0;
  int a=Integer.parseInt(h[0]);
  for(int i=0;i<hh.length;i++)
  {s+=Integer.parseInt(hh[i]);
    if(s>a){flag=1;break;}
  }
  System.out.println(s>a?-1:(a-s));
}}

Compiler output:
Main.java:13: error: cannot find symbol
    if(s>a){flag=1;break;}
            ^
  symbol:   variable flag
  location: class Main
1 error
Language: C

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

// Homework
#include <iostream>
using namespace std;

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

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

import static org.hamcrest.CoreMatchers.*;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;

import org.junit.Assert;
import org.junit.Test;

public class MainTest {

	@Test
	public void 入力例_1() throws Exception {
		String input =
			"41 2" + System.lineSeparator() +
			"5 6";
		String output =
			"30";

		assertIO(input, output);
	}

	@Test
	public void 入力例_2() throws Exception {
		String input =
			"10 2" + System.lineSeparator() +
			"5 6";
		String output =
			"-1";

		assertIO(input, output);
	}

	@Test
	public void 入力例_3() throws Exception {
		String input =
			"11 2" + System.lineSeparator() +
			"5 6";
		String output =
			"0";

		assertIO(input, output);
	}

	@Test
	public void 入力例_4() throws Exception {
		String input =
			"314 15" + System.lineSeparator() +
			"9 26 5 35 8 9 79 3 23 8 46 2 6 43 3";
		String output =
			"9";

		assertIO(input, output);
	}

	private void assertIO(String input, String output) throws Exception {
		ByteArrayInputStream in = new ByteArrayInputStream(input.getBytes());
		System.setIn(in);

		ByteArrayOutputStream out = new ByteArrayOutputStream();
		System.setOut(new PrintStream(out));

		Main.main(new String[0]);

		Assert.assertThat(out.toString(), is(output + System.lineSeparator()));
	}
}


Compiler output:
Main.java:10: error: class MainTest is public, should be declared in a file named MainTest.java
public class MainTest {
       ^
Main.java:1: error: package org.hamcrest does not exist
import static org.hamcrest.CoreMatchers.*;
                          ^
Main.java:7: error: package org.junit does not exist
import org.junit.Assert;
                ^
Main.java:8: error: package org.junit does not exist
import org.junit.Test;
                ^
Main.java:12: error: cannot find symbol
	@Test
	 ^
  symbol:   class Test
  location: class MainTest
Main.java:23: error: cannot find symbol
	@Test
	 ^
  symbol:   class Test
  location: class MainTest
Main.java:34: error: cannot find symbol
	@Test
	 ^
  symbol:   class Test
  location: class MainTest
Main.java:45: error: cannot find symbol
	@Test
	 ^
  symbol:   class Test
  location: class MainTest
Main.java:63: error: cannot access Main
		Main.main(new String[0]);
		^
  bad source file: ./Main.java
    file does not contain class Main
    Please remove or make sure it appears in the correct subdirectory of the sourcepath.
Main.java:65: error: cannot find symbol
		Assert.assertThat(out.toString(), is(output + System.lineSeparator()));
		^
  symbol:   variable Assert
  location: class MainTest
Main.java:65: error: cannot find symbol
		Assert.assertThat(out.toString(), is(output + System.lineSeparator()));
		                                  ^
  symbol:   method is(String)
  location: class MainTest
11 errors
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int N,M;
  vector<int> A(M);
  cin >> N >> M;
  cin >> A;
  int sum = 0;
  for(i=0;i<M;i++){
  sum = sum + A[i]
  }
  int ans = N - sum;
  if(sum > N){
  ans = -1
  }
  cout<< ans << endl;
  
 return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> A(M);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> A(M);
      |          ^~~
a.cc:8:10: error: 'A' was not declared in this scope
    8 |   cin >> A;
      |          ^
a.cc:10:7: error: 'i' was not declared in this scope
   10 |   for(i=0;i<M;i++){
      |       ^
a.cc:15:11: error: expected ';' before '}' token
   15 |   ans = -1
      |           ^
      |           ;
   16 |   }
      |   ~
Language: C

#include<stdio.h>
#include<stdlib.h>

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


Compiler output:
main.c: In function 'main':
main.c:16:3: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   16 |   print("%d",N-sum);
      |   ^~~~~
      |   printf
Language: C

#include<iostream>
#include<iomanip>
#include<cassert>
#include<math.h>
#include<complex>
#include<algorithm>
#include<utility>
#include<queue>
#include<string.h>
#include<string>
#include<set>
#include<map>
#include<unordered_map>
#include<functional>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll INF=2e18;
const ll MOD=1e9+7;

ll N,M;
ll a[1000010];
int main(){
    cin>>N>>M;
    ll sum=0;
    for(ll i=0;i<M;i++){
        cin>>a[i];
        sum+=a[i];
    }
    cout<<((sum>N)?(-1):(N-sum))<<endl;

    return 0;
}

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

n,m = [int(i) for i in input().split()]

a = [int(i) for i in input().split()]

temp = sum(a)

if n>=temp:
    ans = n-temp
else:
    ans = -1
    
print(ans)
    

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

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const ll maxn=2e5+1;
void solve()
{
	ll N,M;
	cin>>N>>M;
	ll a[maxn],sum=0;
	for(ll i=0;i<M;i++)
	{
		cin>>a[i];
		sum+=a[i];
	}
	if(sum>N) cout<<-1<<"\n";
	else cout<<N-sum<<"\n";
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll T=1,p=0;
	//cin>>T;
	do
	{
		solve();
		p++;
	}while(p<T);
	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() { 
    // freopen("charnum.in","r",stdin);
    // freopen("charnum.out","w",stdout);
	int n,m;
	cin>>n>>m;
	while (m--) {
		int t;
		cin>>t;
		n-=t;
	}
	cout<<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;
    ll sum=0;
    for(int i=0;i<m;i++)
    {
        int a;
        cin>>a;
        sum+=a;
    }
    cout<<(n>=sum?n-sum:-1);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'll' was not declared in this scope
    7 |     ll sum=0;
      |     ^~
a.cc:12:9: error: 'sum' was not declared in this scope
   12 |         sum+=a;
      |         ^~~
a.cc:14:15: error: 'sum' was not declared in this scope
   14 |     cout<<(n>=sum?n-sum:-1);
      |               ^~~
Language: C

#include <bits/stdc++.h>

using namespace std;
//FILE *fi=freopen("1.txt","r",stdin);
int n,m;
int main()
{
    cin>>n>>m;
    int sum = 0;
    for(int i=1;i<=m;i++)
    {
        int x;
        cin>>x;
        sum+=x;
    }
    if(n-sum<0)
    {
        cout<<-1;
        return 0;
    }
    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

n, m = gets.strip.split.map(&:to_i)
a = gets.strip.split.map(&:to_i)
p max(n - a.sum, -1)

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | n, m = gets.strip.split.map(&:to_i)
      | ^
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 = gets.strip.split.map(&:to_i)
      |    ^
main.c:1:8: error: 'gets' undeclared here (not in a function)
    1 | n, m = gets.strip.split.map(&:to_i)
      |        ^~~~
main.c:1:30: error: expected expression before ':' token
    1 | n, m = gets.strip.split.map(&:to_i)
      |                              ^
main.c:2:1: error: expected ',' or ';' before 'a'
    2 | a = gets.strip.split.map(&:to_i)
      | ^
Language: C

#include<iostream>

using namespace std;

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

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

#include<iostream>
#include <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() {
}
 
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:
a.cc:24:5: error: redefinition of 'int main()'
   24 | int main(){
      |     ^~~~
a.cc:21:5: note: 'int main()' previously defined here
   21 | int main() {
      |     ^~~~
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[i];
		N = N - A[i];
	}

	if(N<0)
		cout << "\n-1";
	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.