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

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

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

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

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

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

int n,d,a;
long long tt;
int main(){
	cin>>d>>n;
	for (int i=0;i<n;i++) {
		cin>>a;
		tt+=a;
	}
	if (d-tt>=0) cout<<d-tt<<"\n";
	else cout<<-1<<"\n";
	return 0  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: expected ';' before '}' token
   14 |         return 0
      |                 ^
      |                 ;
   15 | }
      | ~
Language: C

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

int main()
{
    int n,m;
    vector<int> a(m);
    cin >> n >> m;
    rep(i,m) {
        cin >> a[i];
    }
    int sum_cost;
    sum_cost = accumulate(a.begin(), a.end(), 0);
    if (n < sum_cost) {
        cout << "-1" << endl;
    } else {
        cout << n - sum_cost << 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"
#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)
    	printf("%d", -1);
        
    else
    	printf("%d", N);
    
    
    
    printf("%lf", 2.0 * R * 3.1415);
	
	
}
 
int main()
{
	std::cin.tie(nullptr);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	Main();
}

Compiler output:
a.cc:2:9: fatal error: boost/multi_array.hpp: No such file or directory
    2 | #include<boost/multi_array.hpp>
      |         ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C

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

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

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define vi vector<ll>
#define vvi vector<vi >
#define pi pair<ll,ll>
#define vvpi vector<vector<pi > >
#define vpi vector<pi >
#define vppi vector<pair<ll,pi > >
#define vs vector<string>
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define pb push_back
#define eb emplace_back
#define mkp make_pair
#define fs first
#define se second
#define fast ios_base::sync_with_stdio(false)
#define cintie cin.tie(NULL)
int main()
{
	ll sum,x,d,n,i;
	cin>>d>>n;
	sum=0;
	for(i=0;i<n;i++)
	{
		cin>>x;
		sum=sum+x;
	}
	if(sum<=d)
	cout<<d-sum<<endl;
	else
	cout<<-1<<endl;
}


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

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

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


Compiler output:
main.c: In function 'main':
main.c:18:3: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   18 |   print(ans);
      |   ^~~~~
      |   printf
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: 'days' was not declared in this scope; did you mean 'day'?
   10 |     cin >> days.at(i);
      |            ^~~~
      |            day
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: expected primary-expression before ')' token
   14 |   if (n - sum >=)
      |                 ^
Language: Java

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

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

Compiler output:
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C

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


Compiler output:
main.c: In function 'main':
main.c:13:16: error: stray '\' in program
   13 |     printf("-1"\n);
      |                ^
main.c:13:16: error: expected ')' before 'n'
   13 |     printf("-1"\n);
      |           ~    ^~
      |                )
Language: C

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

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


Compiler output:
main.c: In function 'main':
main.c:10:23: error: expected ';' before ':' token
   10 |   scanf("%d %d",&N,&M):
      |                       ^
      |                       ;
main.c:18:3: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   18 |   print(ans);
      |   ^~~~~
      |   printf
Language: C

#include<bits/stdc++.h>

using namespace std;

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

using namespace std;

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

    long long sum = 0;

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

    if (N < sum) {
        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>
 
//g++ -std=c++11
//g++ -std=c++1z 

using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector< pair<int,int> > vp;

int main() {
 
    //freopen("input.txt", "r", stdin); 
    //freopen("output.txt", "w", stdout);
 
    std::ios::sync_with_stdio(false);
    cin.tie(nullptr);

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

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

    return 0;
}

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

#include <iostream>
#include <vector>
#include <numeric>
using namespace std;

int main() {
  int n, m;
  cin >> n >> m;
  vector<int> A(m);
  for(int& a : A)
    cin >> a;
  int play = accumulate(A.begin(), A.end(), -n);
  cout << ((play > 0) ? -1 : -play) << "\n";
  return 0;
}


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

inputLine=input()
N = int(inputLine.split(" ")[0])
M = int(inputLine.split(" ")[1])

inputLine=input()
A = inputLine.split(" ")

for i in range(len(A)):
    A[i] = int(A[i])

result = N - sum(A)

if result < 0:
    print(-1)
else:
    print(result)















Compiler output:
a.cc:1:1: error: 'inputLine' does not name a type; did you mean 'inline'?
    1 | inputLine=input()
      | ^~~~~~~~~
      | inline
Language: C++

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




int main()
{

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

if(total>N)
{
    cout<<-1;
}
else{
    cout<<N-total;
}

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:11: error: 'A' was not declared in this scope
   21 |    total+=A[i];
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define pi 3.14159265358979323846
int main(){
int n;
cin>>n>>m;
long long int sum=0;
int a[m];
for(int i=0;i<m;i++){
	cin>>a[i];sum+=a[i];
}
int ans=n-sum;
if(ans<0) cout<<"-1";
else cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'm' was not declared in this scope
    6 | cin>>n>>m;
      |         ^
a.cc:10:14: error: 'a' was not declared in this scope
   10 |         cin>>a[i];sum+=a[i];
      |              ^
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];

  int wd = 0;
  for(int i = 0; i<M; i++) {
    wd += A[i];
  }
  if(N >= wd) cout << N - wd << 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;
// type alias
typedef long long LL;
typedef pair<int,int> II;
typedef tuple<int,int,int> III;
typedef vector<int> VI;
typedef vector<string> VS;
typedef unordered_map<int,int> MAPII;
typedef unordered_set<int> SETI;
template<class T> using VV=vector<vector<T>>;
// minmax
template<class T> inline T SMIN(T& a, const T b) { return a=(a>b)?b:a; }
template<class T> inline T SMAX(T& a, const T b) { return a=(a<b)?b:a; }
// repetition
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define REPE(i,n)  for(int i=0;i<=(n);++i)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  for(int i=0;i<(n);++i)
#define FORR(x,arr) for(auto& x:arr)
#define SZ(a) int((a).size())
// collection
#define ALL(c) (c).begin(),(c).end()
// DP
#define MINUS(dp) memset(dp, -1, sizeof(dp))
#define ZERO(dp) memset(dp, 0, sizeof(dp))
// stdout
#define println(args...) fprintf(stdout, ##args),putchar('\n');
// debug cerr
template<class Iter> void __kumaerrc(Iter begin, Iter end) { for(; begin!=end; ++begin) { cerr<<*begin<<','; } cerr<<endl; }
void __kumaerr(istream_iterator<string> it) { (void)it; cerr<<endl; }
template<typename T, typename... Args> void __kumaerr(istream_iterator<string> it, T a, Args... args) { cerr<<*it<<"="<<a<<", ",__kumaerr(++it, args...); }
template<typename S, typename T> std::ostream& operator<<(std::ostream& _os, const std::pair<S,T>& _p) { return _os<<"{"<<_p.first<<','<<_p.second<<"}"; }
#define __KUMATRACE__ true
#ifdef __KUMATRACE__
#define dump(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); __kumaerr(_it, args); }
#define dumpc(ar) { cerr<<#ar<<": "; FORR(x,(ar)) { cerr << x << ','; } cerr << endl; }
#define dumpC(beg,end) { cerr<<"~"<<#end<<": "; __kumaerrc(beg,end); }
#else
#define dump(args...)
#define dumpc(ar)
#define dumpC(beg,end)
#endif

// $ cp-batch Homework | diff Homework.out -
// $ g++ -std=c++14 -Wall -O2 -D_GLIBCXX_DEBUG -fsanitize=address Homework.cpp && ./a.out

/*
 
 4/19/2020
 
 5:12-
 
 */

const int MAX_N=1e6+1;
LL A[MAX_N];
int N,M;

void solve() {
  LL sum=accumulate(A,A+M,0LL);
  LL res=max(N-sum,-1LL);
  cout<<res<<endl;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout<<setprecision(12)<<fixed;
  
  cin>>N>>M;
  REP(i,M) cin>>A[i];
  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>
#include<cmath>

using namespace std;

#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
#define vi vector<ll>
#define vvi vector<vi>
#define pii pair<ll, ll>
#define vii vector<pii>
#define pb push_back
#define B begin()
#define E end()
#define sz(A) (ll)(A).size()
#define F first
#define S second
#define loop(z, v) for(auto &z: v)
#define sps << ' '
#define sp << ' ' << 
# define M_PI   3.14159265358979323846
#define nl "\n"
// #define nl endl
#define fat 1000000007
// #define fat 998244353
ll u, r, l, d;

bool check(ll x, ll y){
  if(x >= l and x <= r and y >= u and y <= d) return false;
  else return true;
}

int main()
{
  boost;
  ll tt = 1, n, m, i, a;

  // cin >> tt;

  for(int _ = 1; _ <= tt; _++){
    // cout << "Case #" << _ << ": ";
    cin >> n >> m;
    ll sum = 0;

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

    ll diff = n - sum;
    cout << max(-1LL, diff) << nl;
  }

  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 lower(s) transform(s.begin(), s.end(), s.begin(), ::tolower)
using namespace std;
using ll = long long;

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

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | n,m=map(int,input().split())
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int]
    1 | n,m=map(int,input().split())
      |   ^
main.c:1:5: error: implicit declaration of function 'map' [-Wimplicit-function-declaration]
    1 | n,m=map(int,input().split())
      |     ^~~
main.c:1:9: 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 <bits/stdc++.h>
using namespace std;

typedef unsigned long long  ULL;
typedef long long LL;

#define pb push_back
#define mp make_pair
#define reset(a, b) memset(a, b, sizeof(a))
#define rep(i,b) for(int i=0; i<b; i++)
#define F first 
#define S second

 
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    
    int T;
//    cin>>T;
    T=1;
    while(T--){
       
       int n,m;
       cin>>n>>m;
       int x;
       int sum=0;
       rep(i,m){
           cin>>x;
           sum+=x;
       }
       
       if(sum<=n) cout<<(n-sum);
       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 <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
*/
#include <bits/stdc++.h>

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

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


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

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

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

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

#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
using namespace std;
using ll = long long;
#define Ma_PI 3.141592653589793
#define eps 0.00000001
#define LONG_INF 3000000000000000000
#define rep(i,n) for(long long i = 0;i < n;++i)    
#define seg_size 524288

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

    return 0;
}

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

#inlcude <iostream>
using namespace std;
int main()
{
    long long holiday, assign;
    cin>>holiday>>assign;
    long task=0;
    while(assign--)
    {
        long x;
        cin>>x;
        task+=x;
    }
    cout<<holiday-task<<"\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:14:5: error: 'cout' was not declared in this scope
   14 |     cout<<holiday-task<<"\n";
      |     ^~~~
a.cc:14:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define ok() puts(ok?"Yes":"No");
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef set<int> si;
typedef map<string, int> msi;
typedef greater<int> gt;
typedef priority_queue<int, vector<int>, gt> minq;
typedef long long ll;
const ll LINF = 1e18L + 1;
const int INF = 1e9 + 1;
//clang++ -std=c++11 -stdlib=libc++ 

int main() {
  ll N,M; cin >> N>>M;
  vi a(M);
  ll sum = 0;
  rep(i,M) {
    cin >> a[i];
    sum += a[i];
  }
  ll ans = N-sum;
  if (ans<0) ans = -1;
  printf("%lld\n", ans);
  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;
#define MOD 1000000007
#include <map>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
typedef long long ll;


template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}




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

}


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

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


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

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

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

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;
using ll = long long;

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

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

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

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

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


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

N, M = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
p = N - sum(A)
print(max(p, -1))

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:4: error: type defaults to 'int' in declaration of 'M' [-Wimplicit-int]
    1 | N, M = [int(i) for i in input().split()]
      |    ^
main.c:1:8: error: expected expression before '[' token
    1 | N, M = [int(i) for i in input().split()]
      |        ^
main.c:2:1: error: expected ',' or ';' before 'A'
    2 | A = [int(i) for i in input().split()]
      | ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:17:5: error: continue statement not within a loop
   17 |     continue;
      |     ^~~~~~~~
a.cc:22:5: error: continue statement not within a loop
   22 |     continue;
      |     ^~~~~~~~
Language: C

#include <bits/stdc++.h>

#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i <= n; i++)
#define FORR(i, m, n) for(int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define VSORTR(v) sort(v.rbegin(), v.rend());
#define ALL(v) (v).begin(),(v).end()
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;
const ll mod = 1e9+7;


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

    ll n,m;cin>>n>>m;
    vll a(n); REP(i,n) cin>>a[i];
    ll sum = accumulate(ALL(a), 0LL);
    if (n>=sum){
        cout<<n-sum<<endl;
        return 0;
    }
    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(void){
    int n,m, sum = 0;
    cin >> n >> m;
    std::vector<int> a(n);
    for(int i = 0; i < m; i++){
        cin >> a[i];
        sum += a[i];
    }
    if(n >= sum) cout << n - sum;
    else cout << "-1";
    
    
}


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

#include<bits/stdc++.h>
using namespace std;
const double pi = acos(-1);

int32_t main () {
	int n, m; cin >> n >> m;
	vector<int> arr(m, 0);
	for(int i = 0; i < m; i ++) cin >> arr[i];
	int sum = accumulate(arr.begin(), arr.end(), 0);
	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 <bits/stdc++.h>
using namespace std;

int main(){
    int N,M,A,ans=0;
    cin >> N >> M;
    for (int i=0 ; i<M ; i++){
        cin >> A;
        ans+=A;
    }
    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 n,m,sum;
int main()
{
	scanf("%d%d",&n,&m);
	for (int i=1,a;i<=m;i++) scanf("%d",&a), sum+=a;
	printf("%d",(sum>n)?-1:n-sum);
}

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 <vector>
using namespace std;
int main(void){
    int days;
    int num;
    int requ=0;
    
    cin >> days;
    cin >> num;
    
    int tmp
    while(cin>>tmp){
        requ+=tmp;
    }
    
    int result = days - requ;
    
    if(result<0){
        result=-1;
    }
    
    cout << result << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: expected initializer before 'while'
   13 |     while(cin>>tmp){
      |     ^~~~~
Language: C

#include <bits/stdc++.h>
#define For(i,a,b) for(int i=(a); i<(b); i++)
using namespace std;

int main(){
	int n,m;
	cin>>n>>m;
	int a[m];
	int sum=0;
	For(i,0,m){
		cin>>a[i];
		sum+=a[i];
	}
	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

n, m = map(int, input().split())
arr = map(int, input().split())
res = n-sum(arr) 
if res >= 0:
    print(res)
else:
    print(-1)


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

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

#define pb push_back
#define mp make_pair
#define M 1000000007
int main()
{
	ll n,m,num;
	cin >> n>>m;
	while(m--){
		cin >> num;
		n=n-num;
	}
	if(n<0)
		cout << "-1\n";
	else
		cout << 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<bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define rep(i,n) for(ll i=0;i<n;++i)
#define ocut cout
#define ouct cout
#define itn int

struct Union{
  vector<ll> par;
  Union(ll a){
  par=vector<ll>(a,-1);
  }
  ll find(ll a){
    if(par[a]<0){
      return a;
    }
    else{
      return par[a]=find(par[a]);
    }
  }
  bool same(ll a,ll b){
    return (find(a)==find(b));
  }
  ll size(ll a){
    return -par[find(a)];
  }
  void unite(ll a,ll b){
    ll c=find(a),d=find(b);
    if(c==d)
      return;
    if(size(c)<size(d)){
      swap(c,d);
    }
    par[c]+=par[d];
    par[d]=c;
  }
};

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

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

using System;
using System.Collections.Generic;
using System.Linq;

namespace AtCoderCs
{

    class Program
    {

        const int Mod = 1000000007;

        static void Main()
        {

            var arg = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();

            var useDays = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).Sum();

            Console.WriteLine(arg[0] < useDays ? -1 : arg[0] - useDays);

        }


    }
}


Compiler output:
main.c:1:1: error: unknown type name 'using'
    1 | using System;
      | ^~~~~
main.c:2:1: error: unknown type name 'using'
    2 | using System.Collections.Generic;
      | ^~~~~
main.c:2:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | using System.Collections.Generic;
      |             ^
main.c:3:1: error: unknown type name 'using'
    3 | using System.Linq;
      | ^~~~~
main.c:3:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    3 | using System.Linq;
      |             ^
main.c:5:1: error: unknown type name 'namespace'
    5 | namespace AtCoderCs
      | ^~~~~~~~~
main.c:6:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    6 | {
      | ^
Language: C

//Bismillahir Rahmanir Raheem
//In the name of Allah , Most Gracious , Most Merciful

/*

  * * * * * * *   * * * * * * *   *           *   * * *   * * * * * *
              *   *           *   *           *     *     *           *
              *   *           *   *           *     *     *             *
              *   *           *   *           *     *     *             *
              *   * * * * * * *   * * * * * * *     *     *             *
  *           *   *           *   *           *     *     *             *
  *           *   *           *   *           *     *     *             *
  *           *   *           *   *           *     *     *           *
  * * * * * * *   *           *   *           *   * * *   * * * * * *

*/

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

#define BOOST ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define DEBUG freopen("input.txt","r",stdin)


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





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

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

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


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

#include <iostream>

using namespace std;

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


    return 0;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:8: error: 'A' was not declared in this scope
   16 |     if(A>N) {
      |        ^
Language: C

#include <bits/stdc++.h>
using namespace std;
int main()
{
//    quick();
//    readFromText();
    int r ; cin >> r ;
    double c = 2*3.14159*r;
    cout << c << 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;
#define ll int64_t
#include <cstdlib> 
#include <math.h>
#include<cstdio>
#include<cstring>
#define FOR(I, A, B) for (ll I = (A); I <= (B); I++)
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fo(i,n) for(ll i=0;i<n;i++)
#define sz(a) ll((a).size())
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define tr(c,i) for(auto i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define dbg(x) cout << #x << " = " << x << endl
#define dbg2(x,y) cout << #x << " = " << x << ", " << #y << " = " << y << endl
#define dbg3(x,y,z) cout << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << endl
#define dbg4(x,y,z,q) cout << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << ", " << #q << " = " << q << endl
#define scan(char_array) scanf("%[^\n]s",&char_array);

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

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

}
#include <bits/stdc++.h>
using namespace std;
#define ll int64_t
#include <cstdlib> 
#include <math.h>
#include<cstdio>
#include<cstring>
#define FOR(I, A, B) for (ll I = (A); I <= (B); I++)
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fo(i,n) for(ll i=0;i<n;i++)
#define sz(a) ll((a).size())
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define tr(c,i) for(auto i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define dbg(x) cout << #x << " = " << x << endl
#define dbg2(x,y) cout << #x << " = " << x << ", " << #y << " = " << y << endl
#define dbg3(x,y,z) cout << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << endl
#define dbg4(x,y,z,q) cout << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << ", " << #q << " = " << q << endl
#define scan(char_array) scanf("%[^\n]s",&char_array);

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

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

}


Compiler output:
a.cc:63:5: error: redefinition of 'int main()'
   63 | int main(){
      |     ^~~~
a.cc:23:5: note: 'int main()' previously defined here
   23 | int main(){
      |     ^~~~
Language: C

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

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


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

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

int main(){
  // 入力
  long int N, M;
  cin >> N >> M;
  vector<long int> A(M);
  long int sum = 0;
  for (long int i=0; i<M; i++) {
    cin >> A[i];
    sum += A[i];
  } 

  long int result = -1;
  if (N>=sum) {
    result = N - sum;
  }

  cout << result << endl;
  return 0;
}

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

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

int main()
{
    int n,m;
    cin>>n>>m;
    int arr[m],sum=0;
    for(int i=0;i<m;i++)
    {
        cin>>arr[i];
        sum+=arr[i];
    }
    int out=-1;
    if(sum<=n)
    {
        out=n-sum;
    }
    cout<<out<<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>
#define pb push_back
//#define int long long
#define mod 1000000007
#define mp make_pair
#define fi first
#define se second
#define ll long long
#define scan(n) ll a[n]; for(ll i = 0 ; i<n ; i++) cin>>a[i]
#define print(a,n) for(int i = 0 ; i < n ; i++) cout<<a[i]<<' '
#define fast ios_base::sync_with_stdio(false); cin.tie(0);cout.tie(0);
#define rep(i,x,y) for(ll i=x;i<y;i++)
using namespace std;
typedef vector<int>vi ;
typedef vector<ll>vll ;
typedef vector<vector<ll> >vvl ;
typedef pair<ll,ll> pll ;
/*vi adj[200005];
ll vis[200005];
ll parent[200005];
ll level[200005];*/
int main()
{
	fast;
	ll n,m;
	cin>>n>>m;
	scan(m);
	ll sum=0;
	for(ll i=0;i<m;i++)
	{
		sum+=a[i];
	}
	if(sum<=n)
	{
		cout<<n-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 <iostream>
#include <vector> 
#include <set>
#include <map>
#include <math.h>

using namespace std;

#define loop(i,a,b) for(int i = a; i<b; i++)
#define square(a) (a)*(a)

typedef long long ll;
typedef string str;


int main ()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	int a, b;
	cin >> a >>b;
	
	int c[100];
	
	int sum = 0;
	loop(i,0,b)
	{
		cin >> c[i];
		sum += c[i];
	} 
	
	if (a >= sum)
	cout << a - sum;
	else
	cout << -1;
}


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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:20:14: error: expected '}' at end of input
   20 |     cout<<-1;
      |              ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

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

ll n, m, l, ans;

inline ll read(){
	ll s = 0, w = 1;
	char ch = getchar();
	for (; ch < '0' || ch > '9'; ch = getchar()) w *= ch == '-' ? -1 : 1;
	for (; ch >= '0' && ch <= '9'; ch = getchar()) s = s * 10 + ch - '0';
	return s * w;
}

inline void work(){
	n = read(), m = read();
	REP(i, 1, m) l = read(), ans += l;
	if (ans > n) puts("-1");
	else printf("%lld\n", n - ans);
}

int main(){
	work();
	return 0;
}

Compiler output:
a.cc: In function 'void work()':
a.cc:17:13: error: 'i' was not declared in this scope
   17 |         REP(i, 1, m) l = read(), ans += l;
      |             ^
a.cc:17:9: error: 'REP' was not declared in this scope
   17 |         REP(i, 1, m) l = read(), ans += l;
      |         ^~~
Language: C

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

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

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

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

int main()
{
    ll n, m;
    cin >> n >> m;
    ll a = 0;
    rep(i, m) {
        ll ai;
        cin >> ai;
        a += ai;
    }
    if (a > n) {
        cout << -1 << endl;
    } else {
        cout << n - a << 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;
using Graph = vector<vector<int>>;
#define ll long long
#define _GLIBCXX_DEBUG
const ll MOD = 1000000007;
const int MAX = 510000;

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> A(M);
  for (int i=0; i<M; i++) cin >> A[i];
  ll sum = accumulate(A.begin(), A.end(), 0LL);
  if (N<sum) cout << -1 << endl;
  else cout << N-sum << endl;
}

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

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

int main()
{
    ll N,M;
    cin >> N >> M;
    ll sum = 0;

    for(ll i = 0; i < M; i++)
    {
        ll tmp;
        cin >> tmp;
        sum += tmp;
    }

    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()
{
  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;
  }
  printf(N-sum);
  return 0;
}
  
    
    


Compiler output:
main.c: In function 'main':
main.c:9:23: error: expected ';' before ':' token
    9 |   scanf("%d %d",&N,&M):
      |                       ^
      |                       ;
Language: C

/*
	Name:
	Author: xiaruize
	Date:
*/

#include<algorithm>
#include<bitset>
#include<cctype>
#include<cerrno>
#include<clocale>
#include<cmath>
#include<complex>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<deque>
#include<exception>
#include<fstream>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<iomanip>
#include<ios>
#include<iosfwd>
#include<iostream>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<stdexcept>
#include<streambuf>
#include<string>
#include<utility>
#include<vector>
#include<cwchar>
#include<cwctype>
using namespace std;
#define ull unsigned long long
#define MOD 1000000007
#define ALL(a) (a).begin(), (a).end()
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define ll long long
#define form(i,j,n) for(int i=int(j);i<=int(n);i++)
#define pb push_back
#define mk make_pair
#define pii pair<int,int>
#define pis pair<int,string>
#define sec second

inline int read()
{
    char ch=getchar();
    int x=0,f=1;
    while(ch<'0'||ch>'9'){if(ch=='-') f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9') x=x*10+(ch^48),ch=getchar();
    return x*f;
}

int main()
{
 	ios::sync_with_stdio(false);
	cin.tie(0);
 	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	int n,m;
	cin>>n>>m;
	int x;
	for(int i=0;i<m;i++)
	{
		cin>>x;
		n-=x;
	}
	if(n<0)
	{
		cout<<"-1"<<endl;
		return 0;
	}
	cout<<n<<endl;
	return 0;
}

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


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

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



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