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

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

void solve(long long N, long long M, std::vector<long long> A)
{
    long long res = 0;
    for (int i = 0; i < M; i++)
    {
        res += A[i];
    }

    cout << max(-1LL, N - res) << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main()
{
    long long N;
    scanf("%lld", &N);
    long long M;
    scanf("%lld", &M);
    std::vector<long long> A(M);
    for (int i = 0; i < M; i++)
    {
        scanf("%lld", &A[i]);
    }
    solve(N, M, std::move(A));
    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 rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i < (int)(n); i++)
#define rep2(i, j, n) for (int i = j; i < (int)(n); i++)

int main() {
	int N, M;
	cin >> N >> M;
	int c = 0;
	rep(i, M) {
		int a;
		cin >> a;
		c += a;
	}
	if (c > N) {
		cout << "-1" << endl;
	}
	else {
		cout << N - c << endl;
	}
}

Compiler output:
a.cc:1:30: warning: extra tokens at end of #include directive
    1 | #include<bits/stdc++.h>using namespace std;
      |                              ^~~~~~~~~
a.cc:1:9: fatal error: bits/stdc++.h>usin: No such file or directory
    1 | #include<bits/stdc++.h>using namespace std;
      |         ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C

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

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

    vector<int> A(M);
    rep(i,M) cin >> A[i];

    ll sum = accumulate(A.begin(), A.end(), 0);
    cout << ((N >= sum) ? N - sum : -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,x;
int main()
{
	cin>>n>>m;
	while(m--)
	{
		cin>>x;
		n-=x;
	}
	if(n<0)cout<<"-1\n";
	else cout<<n<<"\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 <GOD>
#include <iostream>
using namespace std;
typedef long long ll;
#define pb push_back
#define len length
ll n,m,x,sum;
int main(){
	cin>>n>>m;
	for(int i=0;i<m;i++){
		cin>>x;
		sum+=x;
	}
	if(sum>n){
		cout<<-1<<endl;
	}else{
		cout<<n-sum<<endl;
	}
}


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

#include <algorithm>
#include<iostream>
#include<stdio.h>
#include<iostream>
#include<stdio.h>
#include<vector>
#include<set>
#include<string>
#include<iomanip>
#include<queue>
#include<functional>
#include<cmath>
#include<map>
#define rep(i,n) for(int i=0; i<(int)n; i++)//n回繰り返す
using namespace std;
using ll = long long;
using P = pair<int, int>;
using graph = vector<vector<int>>;


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

    


    








































































































































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

#include<iostream>
#include<math.h>
#include<stdlib.h>
#include<string>
#include<limits.h>
#include<utility>
#include<vector>
#include<tuple>
#include<algorithm>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i,n) for(int i=0;i<n;i++)
#define ALL(A) A.begin(),A.end()

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


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

#include <bits/stdc++.h>
using namespace std;
#define ll long long int 
#define ull unsigned long long int
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define mx *max_element
#define mn *min_element
#define fo(i,n) for(ll i=0;i<n;i++)
#define of(i,n) for(ll i=n-1;i>=0;i--)
#define all(x) x.begin(),x.end()
#define sortall(x) sort(all(x))
#define mem(x,p) memset(x,p,sizeof(x))
#define w(t) ll t;cin>>t;while(t--)
#define kk "\n"
const ll mod=1e9+7;
int main()
{
  IOS
  ll n,m;
  cin>>n>>m;
  ll a[m],s=0;
  fo(i,m)
  {
    cin>>a[i];
    s=s+a[i];
  }
  ll r=-1;
  cout<<max(r,n-s)<<kk;
  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;
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;   
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define ld long double
#define dd double
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define sz(a) (ll)(a.size())
typedef long long ll;
typedef unsigned long long ull;
typedef pair <ll, ll> pll;
typedef pair <int, int> pii;
typedef vector<pll> vplll;
ll mod = 1e9+7;
const ld PI = 2 * acos(0.0);
const vector<ll> dx = {1, -1, 0, 0};
const vector<ll> dy = {0, 0, 1, -1};
#define round(x, y) ((x + y - 1) / y)
#define ce(x, y) ((x + y - 1) / y)
#define amax(x, y) \
    if (y > x)     \
        x = y;
#define amin(x, y) \
    if (y < x)     \
        x = y;
#define lcm(x, y) ((x) * (y) / __gcd(x, y))
#define len(x) (ll) x.length()
#define sq(x) ((x) * (x))
#define cb(x) ((x) * (x) * (x))
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll a,b,c,t,n,m,k,q; 
    t = 1;
    // cin>>t;
    while(t--)
    {
    	cin>>n>>m;
    	ll sum = 0 ;
    	for(int i=0;i<m;i++)
    	{
    		cin>>a;
    		sum+=a;
    	}
    	if(n>=sum)
    	cout<<n-sum<<endl;
    else
    	cout<<-1<<endl;
    }
    return 0;
}

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:16:6: error: 'n' was not declared in this scope
   16 |   if(n<0){
      |      ^
Language: C

#include <bits/stdc++.h>

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, m;
    cin >> n >> m;
    int s = 0;
    for (int i = 0; i < m; ++i) {
        int x;
        cin >> x;
        s += x;
    }
    cout << max(-1, n - s) << endl;
    return 0;
}


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

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

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



Compiler output:
a.cc: In function 'int main()':
a.cc:6:15: error: expected primary-expression before ';' token
    6 |   cin>> n>>m>>;
      |               ^
Language: C++

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

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

#include <iostream>

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

    for (auto i = 0; i < M && N >= 0; i++) {
        int Ai;
        std::cin >> Ai;

        N -= Ai;
    }

    if (N < 0) {
        std::cout << "-1" << std::endl;
    } else {
        std::cout << N << std::endl;
    }

    return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
long long date,n,tmp,sum=0;
void solve(){
    if(date>=sum) {
        cout<<date-sum<<endl;
    }else{
        cout<<"-1"<<endl;
    }
}

int main(){
    cin>>date>>n;
    rep(i,n){
        cin>>tmp;
        sum+=tmp;
    }
    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>
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define pb push_back
#define mp make_pair
#define fir first 
#define sec second
#define int long long
#define endl "\n"
using namespace std;
const int nax=1e5+5;
vector<int>adj[nax];
const int mod=1e9+7;
const int inf=1e18+7;

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



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

#include <bits/stdc++.h>

using namespace std;

#define ll long long

int main() {

	ios::sync_with_stdio(false);
	cin.tie(0);
	
	ll n, m;
	cin >> n >> m;
	vector<int> a(m);
	int sum = 0;
	
	for(int i = 0; i < m; ++i) {
		cin >> a[i];
		sum += a[i];
	}
	
	if(sum > n) cout << -1 << "\n";
	else cout << n - sum << "\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>
using namespace std;

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

# -*- coding: utf-8 -*-
def main():
    N,M = map(int,input().split())
    A = [int(i) for i in input().split()]
    for i in A:
        N -= i
    if N < 0:
        print('-1')
    else:
        print(N)
if __name__ == '__main__':
    main()

Compiler output:
main.c:1:3: error: invalid preprocessing directive #-
    1 | # -*- coding: utf-8 -*-
      |   ^
main.c:2:1: error: unknown type name 'def'
    2 | def main():
      | ^~~
main.c: In function 'main':
main.c:2:11: error: expected declaration specifiers before ':' token
    2 | def main():
      |           ^
main.c:8:15: warning: multi-character character constant [-Wmultichar]
    8 |         print('-1')
      |               ^~~~
main.c:11:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   11 | if __name__ == '__main__':
      |                ^~~~~~~~~~
Language: C

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

typedef long long ll;

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

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

    cout<<((N < 0) ? -1 : N)<<endl;

    return 0;
}

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

#include <bits/stdc++.h>
#define r(i,n) for(int i = 0; i<n; i++)
typedef long long ll;
using namespace std;
const ll mod=1000000007;

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

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

#include <bits/stdc++.h>
 size_t strlen(const char *s);
#define rep(i,n) for(long long int i=0;i<n;i++)
#define sz(x) ((int)(x).size())

using namespace std;
std::vector<int> graph[10050];//graph頂点数のsize
const int N=200010;
const int P=1000000007;
using ll = long long;
vector<ll> prime;

//絶対値
int ze(int a, int b){
	if(a>b){
		return a-b;
	}else{
		return b-a;
	}
}
//小さい方
long long int min(long long int a,long long int b){
	if(a>b){
		return b;
	}else{
		return a;
	}
}
//大きい方
long long int max(long long int a,long long int b){
	if(a>b){
		return a;
	}else{
		return b;
	}
}
// a^n mod 
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

// a^{-1} mod 
long long modinv(long long a, long long mod) {
    return modpow(a, mod - 2, mod);
}

//mod掛け算
long long mt(long long a, long long b, long long mod){
	return (a*b)%mod;
}

//メモ

/*
	memset(b, '\0', sizeof(b));
初期化*/


/*
	string s;
	s.size()
*/

/*
	char s[N];
	strlen(s)
*/
/*
	if(  <  )puts("Yes");
	else puts("No");
*/

/*文字列比較
if(strcmp(name[i],s)==0)
*/

/*
	graph[a].push_back(b);//graph[a][i番目に入れた]==b
	graph[j].size()	//forで回すときとか

*/


int main(){
	ll n, m, l,ans;
	cin>>n>>m;
	rep(i, m){
	    cin>>l;
	    ans+=l;
	}
	if(ans<=n){
	    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;
#define int long long int
#define f first
#define s second
#define pb push_back

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


Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: expected ';' before '<' token
   13 |   for(int i=0,i<m;i++)
      |                ^
      |                ;
a.cc:13:16: error: expected primary-expression before '<' token
Language: C

#include<iostream>
#include<vector>
#include<algorithm>
#include<tuple>
#include<utility>

using namespace std;

typedef long long int64;

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

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

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

int main()
{
	int n, m;

	vector<int> vec;

	cin >> n >> m;

	for (int i = 0; i < ; ++i)
	{
		vec.emplace_back();
		cin >> vec.back();
	}

	int sum = 0;
	for (const auto& v : vec)
		sum += v;

	int ans = n - sum;
	if (ans < 0)
		ans = -1;

	cout << ans << "\n";

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:29: error: expected primary-expression before ';' token
   13 |         for (int i = 0; i < ; ++i)
      |                             ^
Language: C

/***************************************** START OF TEMPLATE *********************************************/

#include<bits/stdc++.h>

using namespace std;

#define  SPEED          ios:: sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision(10);
#define  randomINIT     mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define  foo(i,a,n)     for(ll i = (a); i <= n; i++)
#define  frr(i,a,n)     for(ll i = (a); i >= n; i--)
#define  fo(i,n)        for(ll i = 0; i < n; i++)
#define  all(x)         (x).begin(),(x).end()
#define  mset(x,val)    memset(x,val,sizeof(x))
#define  newl           cout<<"\n"
#define  f              first
#define  s              second
#define  pb             push_back
#define  INPa(a,n)      foo(i,1,n) cin>>a[i];
#define  deb2d(a,n,m)   foo(i,1,n){foo(j,1,m){cout<<a[i][j]<<" ";}newl;}    
#define  deb1d(a,n)     foo(i,1,n)cout<<a[i]<<" ";newl;
#define  debv(a)        for(auto it: a)cout<<it<<" ";newl;
#define  deb1(a)        cout<<a<<" ";newl;
#define  deb2(a,b)      cout<<a<<" "<<b<<" ";newl;
#define  deb3(a,b,c)    cout<<a<<" "<<b<<" "<<c<<" ";newl;
#define  deb4(a,b,c,d)  cout<<a<<" "<<b<<" "<<c<<" "<<d;newl;
#define  ll             long long
#define  ld             long double
#define  pll            pair<ll,ll>
#define  vll            vector<ll>
#define  vpll           vector<pll>

const ll   MOD   =  1e+9+7;
const ll   INF   =  LLONG_MAX;
const int  INFi  =  INT_MAX;
const ll   N     =  2e+5+8;

vll adj[N]; ll vis[N];
ll dx4[]={0,1,0,-1}, dy4[]={1,0,-1,0};

ll test_cases = 1; randomINIT;

/*********************************************************************************************************/
/***************************************** VARIABLE DECLARATIONS *****************************************/
ll a[N];


/***************************************** FUNCTION IMPLEMENTATIONS **************************************/



/***************************************** START OF MAIN FUNCTION ****************************************/
void MAIN(ll tc){
    ll n, m, sum =0;
    cin>>n>>m;
    INPa(a,n);
    foo(i,1,m){
        sum += a[i];
    }
    if(sum>n){
        cout<<-1;
    }else{
        cout<<n-sum;
    }
}

int main(){
    SPEED;

    //cin>>test_cases;
    foo(i,1,test_cases){
        MAIN(i);
    }
}

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

#include <iostream>

using namespace std;

const long MOD = 1000000007;
typedef pair<int, int> P;

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

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

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

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

    return 0;
}


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

nm = list(map(int,input().split()))
n,m = nm[0],nm[1]
a = list(map(int,input().split()))
sam = sum(a)
ans = n - sam
if ans >= 0:
    print(ans)
else:
    print(-1)

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

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

int main()
{
	ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	long n,m;
	cin>>n>>m;
	int a[m];
	for(int i=0;i<m;i++) {cin>>a[i];s+=a[i];}
	if(s<=n) cout<<n-s<<endl;
	else cout<<"-1\n";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:41: error: 's' was not declared in this scope
   10 |         for(int i=0;i<m;i++) {cin>>a[i];s+=a[i];}
      |                                         ^
a.cc:11:12: error: 's' was not declared in this scope
   11 |         if(s<=n) cout<<n-s<<endl;
      |            ^
Language: C

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

int main() {
  ll N,M;
  vector<ll> A(M);
  ll cost = 0;
  cin >> N >> M;
  for(ll i=0;i<M;i++){
    cin >> A.at(i);
  }
  
  for(ll i=0;i<M;i++){
    cost += A.at(i);
  }
  
  if(cost > N){
    cout << "-1" << endl;
  }else{
    cout << N - 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 <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <string>
using namespace std;

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

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

//
// Created by kinok on 2020/04/19.
//

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <iomanip>

using namespace std;

#ifndef UNTITLED2_ATCODER163_H
#define UNTITLED2_ATCODER163_H

#define ll long long
#define rep(t) for(int i=0;i<t;i++)
#define deb(a) cout<<#a<<" : "<<a<<endl
#define debv(v) do{cout<<#v<<" : ";for(auto a:v){cout << a <<" ";} cout<<endl;}while(0);
#define PI 3.141592653589793

class atcoder163{
public:void main(){
    b();
}

void a(){
    int a;
    cin>>a;
    cout<<fixed<<setprecision(8)<<a*2*PI<<endl;
}

void b(){
    ll n,m,total=0,k;
    cin>>n>>m;
    rep(m){
        cin>>k;
        total+=k;
    }
    cout<<(n<total?-1:n-total)<<endl;
}
void c(){

}

void d(){

}

void e(){

}

void f(){

}

};


#endif //UNTITLED2_ATCODER163_H


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

#include<bits/stdc++.h>
#include<iomanip>
using namespace std;
typedef long long ll;
typedef long  l;
typedef pair<int,int> P;
#define rep(i,n) for(int i=0;i<n;i++)
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
const double PI=3.141592653589;
const int INF=1000000007;
const ll LMAX=1000000000000001;
int gcd(int a,int b){if(a<b)swap(a,b);int c=a%b;while(c!=0){a=b;b=c;c=a%b;}return b;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
int dx[]={-1,0,1,0};
int dy[]={0,1,0,-1};

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

  return 0;
}


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

#include <bits/stdc++.h>
#define INF 1e9+7
using namespace std;
using ll=long long int;
using pii=pair<int,int>;

int main () {
    ios::sync_with_stdio(false); cin.tie(0);
    int n,m; cin>>n>>m;
    int sum=0;
    for(int i=0;i<m;i++) {
        int t; cin>>t;
        sum+=t;
    }
    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

//
//  main.cpp
//  atcoder
//
//  Created by Hisaki Kobayashi on 2020/04/14.
//  Copyright © 2020 Hisaki Kobayashi. All rights reserved.
//

#include <bits/stdc++.h>
#include <string>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <bitset>
typedef long long ll;
using namespace std;

int main(int argc, const char * argv[]) {
    
//    // input from txt （提出時にこの箇所は削除すること）
//    std::ifstream in("input.txt");
//    std::cin.rdbuf(in.rdbuf());
//
    
    ll N,M;
    cin >> N >> M;
    
    vector<ll> A(M);
    ll sum=0;
    for(ll i=0;i<M;i++){
        cin >> A[i];
        sum += A[i];
    }
    
    if(sum <= N){
        cout << N - sum << endl;
    }
    else{
        cout << -1 << endl;
    }
    
    
//    cout << fixed << setprecision(20) << R*2.0*M_PI << endl;
 
    return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n,m;

    cin >> n >> n;

    int sum = 0;

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

    if(n < sum) cout << "-2" << 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>
#include <string>
#include <algorithm>
#include <ctime>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cassert>
#include <bitset>
#include <list>
#include <cstdio>
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <math.h>
#include <cmath>
#include <tuple>
#include <cassert>
#include <array>
#include <iomanip>

using namespace std;
using ll = long long;
using pii = pair<int, int>;
using ti = tuple<int, int, int>;

#define REP(i,m,n) for(int i=(m); i<(n); i++)
#define RREP(i,n,m) for(int i=(n);i>=(m); i--)
#define pb push_back
#define mp make_pair
#define debug(x) cerr << #x << ": " << x << endl
// #define int long long 

const double eps=1e-14;
const int mod = 1e9 + 7;
const int inf = ((1<<30)-1);
const ll linf = (1LL<<60);
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    int sum = 0;
    REP(i,0,m)
    {
        int tmp;
        cin >> tmp;
        sum += tmp;
    }
    if(sum>n) cout << -1 << endl;
    else cout << n-sum << endl;
    return 0;
}



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

#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0;i < (n);i++)
#define all(v) v.begin(),v.end()
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using vl = vector<ll>;
using vvl = vector<vl>;

ll gcd(ll a,ll b){
  if(b == 0) return a;
  return gcd(b , a % b);
}

ll mod(ll a){
  return a % 1000000007;
}

ll lcm(ll a,ll b){
  return (a*b)/gcd(a,b);
}


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

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

#include<bits/stdc++.h>
typedef long long ll;
typedef long double ld;
#define FASTIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define PRECISION std::cout << std::fixed << std::setprecision(20);
#define setzero(x) memset(x,0,sizeof(x))
  
using namespace std;
 
const int inf = 2e9+500;
const int N = 1e3+10;
const int bits = 20;
const ld pi = 3.14159265358979323846;
const ll mod = 1e9;
const ll p = 29;


int main(){

    FASTIO;
    PRECISION; 
    
    ll n,m;
    cin>>n>>m;

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

    if(sum>n){
        cout<<-1<<"\n";
    }else{
        cout<<n-sum<<"\n";
    }
    

}

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

#include <iostream>

#define MAX(a, b) (a > b ? a : b)
#define MIN(a, b) (a < b ? a : b)

constexpr auto NMAX = (int)2e5 + 20;
constexpr auto INF = 2000000000;
using namespace std;

typedef unsigned long long ull;

int n, m;
int a;

int main()
{
	cin >> n >> m;
	while (m--) 
	{
		cin >> a;
		n -= a;
	}
	cout << (n >= 0 ? n : -1) << '\n';
	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 N 1000000
//int a[N];
main(){
	int n,m,a,all=0;
 	cin>>n>>m;
 	for(int i=0;i<m;i++)cin>>a,all+=a;
 	if(all>n)cout<<"-1\n";
 	else cout<<n-all<<"\n"; 
}

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

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

int keta(int n) {
    int res;
    for(int i = 0; i < 100; i++) {
        n = n / 10;

        if(n == 0) {
            res = i + 1;
            break;
        }
    }
    return res;
}

int main() {
    int n,m,sum=0;
    cin>>n>>m;
    vector<int> a;
    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

package main

import "fmt"

func main() {
	var n, m int
	fmt.Scan(&n, &m)
	for i := 0; i < m; i++ {
		var a int
		fmt.Scan(&a)
		n -= a
	}
	if n >= 0 {
		fmt.Println(n)
	} else {
		fmt.Println(-1)
	}
}


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

/*
AuThOr GaRyMr
*/
#include<bits/stdc++.h>
#define rb(a,b,c) for(int a=b;a<=c;++a)
#define rl(a,b,c) for(int a=b;a>=c;--a)
#define LL long long
#define IT iterator
#define PB push_back
#define II(a,b) make_pair(a,b)
#define FIR first
#define SEC second
#define FREO freopen("check.out","w",stdout)
#define rep(a,b) for(int a=0;a<b;++a)
#define KEEP while(1)
#define SRAND mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define random(a) rng()%a
#define ALL(a) a.begin(),a.end()
#define POB pop_back
#define ff fflush(stdout)
#define fastio ios::sync_with_stdio(false)
#define debug_pair(A) cerr<<A.FIR<<" "<<A.SEC<<endl;
using namespace std;
const int INF=0x3f3f3f3f;
typedef pair<int,int> mp;
typedef pair<mp,mp> superpair;
int main(){
	fastio;
	int n,m;
	cin>>n>>m;
	rb(i,1,m){
		int ai;
		cin>>ai;
		n-=ai;
		
	}
	n=max(n,-1);
	cout<<n<<endl;
	return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
typedef int64_t ll;
typedef long double ld;
const ll MOD=1000000007;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
long long gcd(long long a,long long b){
    ll gcdmax=max(a,b);
    ll gcdmin=min(a,b);
    while(true){
        if(gcdmax%gcdmin==0)break;
        else gcdmax%=gcdmin;
        swap(gcdmin,gcdmax);
    }
    return gcdmin;
}
ll powerup(ll N,ll P,ll M){
    if(P==0)return 1;
    else if(P%2==0){
        ll t=powerup(N,P/2,M);
        return t*t%M;
    }
    else return N*powerup(N,P-1,M)%M;
}
vector<ll> find_divisor(ll N){
  ll k=1;
  while(k*k<=N){
    k++;
  }
  vector<ll> A(1);
  rep(i,k){
    if(i==1)A.at(0)=1;
    else if(i>=2){
      if(N%i==0)A.push_back(i);
    }
  }
  ll t=0;
  t=A.size();
  rep(i,t){
    if(A.at(t-i-1)*A.at(t-i-1)!=N)A.push_back(N/A.at(t-1-i));
  }
  return A;
}
int main()
{
  ll sum=0;
  ll N,M,A;
  cin>>N>>M;
  rep(i,M){
    cin>>A;
    sum+=A;
  }
  ll B=-1
  cout<<max(B,N-sum)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:54:3: error: expected ',' or ';' before 'cout'
   54 |   cout<<max(B,N-sum)<<endl;
      |   ^~~~
Language: C

#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define int long long
#define mkp make_pair
#define pb push_back
#define ff first
#define ss second
#define debug1(a) cout<<a<<endl;
#define debug2(a,b) cout<<a<<' '<<b<<endl;
#define debug3(a,b,c) cout<<a<' '<<b<<' '<<c<<endl;
#define rep(i,n) for(int i=0;i<n;i++)
#define repre(i,a,b)for(int i=a;i<=b;i++)
#define clr1(arr) memset(arr,-1,sizeof(arr));
#define clr0(arr) memset(arr,0,sizeof(arr));
#define pi pair<int,int>
#define pii pair<int,pi>
#define aint(v) v.begin(),v.end()
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace __gnu_pbds;
using namespace std;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> orderedSet;
typedef tree<int,null_type,less_equal<int>,rb_tree_tag,tree_order_statistics_node_update> orderedMSet;
struct custom_hash {
static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
#define ump gp_hash_table<int,int,custom_hash>
//*p.find_by_order(index) return value at index
//p.order_of_key(key) return index
/*int **dp,in main function,int row,col;dp=new int*[n];rep(i,n)dp[i]=new int[m]*/
//**** Maths Section*******/
int power(int x,int y);
bool isPrime(int n);
int modInv(int a,int b);
int gcdExtended(int a,int b,int *x,int* y);
int mpower(int a,int b,int p);
/***************************/
int32_t main()
{
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
  fastio
  int n,m;
  cin>>n>>m;
  int s=0;
  rep(i,m)
  {
    int a;
    cin>>a;
    s+=a;
  }
  int left=n-s;
  if(left<0)left=-1;
  cout<<left<<endl;
  return 0;
}

int modInv(int a, int m)
{
int x, y;
int g = gcdExtended(a, m, &x, &y);
int res = (x%m + m) % m;
return res;
}

int gcdExtended(int a, int b, int *x, int *y)
{
if (a == 0){
    *x = 0, *y = 1;
    return b;
  }
  int x1, y1;
  int gcd = gcdExtended(b%a, a, &x1, &y1);
  *x = y1 - (b/a) * x1;
  *y = x1;
  return gcd;
}

int mpower(int x, int y, int p)
{
int res = 1;
x = x % p;
while(y > 0){
    if(y & 1) res = (res*x) % p;
      y = y>>1;
      x = (x*x) % p;
    }
    return res;
}
int power(int x, int y)
{
int res = 1;
while (y > 0){
    if (y & 1) res = res*x;
      y = y>>1;
      x = x*x;
    }
    return res;
}

bool isPrime(int n)
{
if (n <= 1)  return false;
  if (n <= 3)  return true;
    if (n%2 == 0 || n%3 == 0) return false;
      int p=sqrt(n);
      for(int i=5;i<=p;i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
          return false;
      return true;
}


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

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define MOD 1000000007;
#define MOD2 998244353;
#define INF ((1<<30)-1);
#define LINF (1LL<<60);
#define EPS (1e-10);
typedef long long Int;
typedef pair<Int, Int> P;

Int n, m;
Int a;

int main() {
    cin >> n >> m;
    Int sm = 0;
    rep(i,m) {
        cin >> a;
        sm += a; 
    }
    Int ans = n - sm;
    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

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
#define repd(i, n) for (ll i = (ll)(n)-1; i >= 0; i--)
const ll INF = 1LL << 60;
const int INF32 = 1 << 29;
const ll MOD = 1000000007;
using Graph = vector<vector<int>>; // グラフ型
using pint = pair<int, int>;

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

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

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

using ll = long long;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define ddrep(i, n) for (int i = n; i > 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define ssrep(i, s, t) for (int i = s; i <= t; ++i)

#define rng(a) a.begin(), a.end()
#define rrng(a) a.rbegin(), a.rend()
#define pb push_back
#define eb emplace_back
#define fi first
#define se second

#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))

using pi = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using ld = long double;

template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}

template <class T> ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "{";
  rep(i, (int)v.size()) {
    if (i)
      os << ",";
    os << v[i];
  }
  os << "}";
  return os;
}

template <typename T, size_t S> void printArray(const T (&array)[S]) {
  for (auto val : array)
    std::cout << val << ", ";
  std::cout << "\n";
}

const int mod = 1e9 + 7;
const int inf = 1e9 + 5;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << std::setprecision(10);

  ll n, m; std::cin >> n >> m;
  ll sum = 0;
  rep(i, m) {
    ll a; std::cin >> a;
    sum += a;
  }
  std::cout << (sum <= n ? n-sum : -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>
#include<algorithm>
#include<vector>
#include<string>
#include<cmath>
#include<map>
#include<iomanip>
#define rip(i,n) for(int i=0;i<n;i++)
#define ll long long
#define lb long double
#define vec vector<int>
using namespace std;
int main() {
	int a, b;
	cin >> a >> b;
	int sum = 0;
	vec c(b);
	for (int i = 0; i < b; i++) {
		cin >> c[i];
		sum += c[i];
	}
	if (sum > a) cout << "-1" << endl;
	else cout << a - sum << endl;
}


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

#include <iostream>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);

#define ull unsigned long long int
#define ll long long int
#define ld double
#define ui unsigned int
#define pb push_back
#define mp make_pair
#define ff first
#define ss second 

#define fr(i,a,b) for (int i = (a), _b = (b); i <= _b; i++)
#define frr(i,a,b) for (int i = (a), _b = (b); i >= _b; i--)
#define rep(i,n) for (int i = 0, _n = (n); i < _n; i++)
#define repr(i,n) for (long long i = (n) - 1; i >= 0; i--)


ll gcd(ll a, ll b) 
{ 
    if (a == 0) return b; 
    return gcd(b % a, a); 
} 

int main(){

    ll t; t=1;
    while(t--){
        ll n,m; cin>>n>>m;
        ll a[m];
        ll sum=0;
        rep(i,m){
            cin>>a[i];
            sum+=a[i];
        }
        if(n-sum<0) cout<<-1;
        else cout<<n-sum;
    }
    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;
using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1LL << (n))
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
const lint mod=1e9+7;

int main()
{
  lint n, m;
  cin >> n >> m;
  vector<int> a(m);
  REP(i,m) cin >> a[i];

  lint sum = 0;
  REP(i,m){
    sum += a[i];
  }
  lint res;
  if(sum > n) res = -1;
  else res = n-sum;

  cout << res << "\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;
#define rep(i,n); for(int i = 0;i < (int)(n);i++)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
int main(){
    int n,m;
    cin >> n >> m;
    int a[m];
    rep(i,m)cin >> a[i];
    int sum = 0;
    rep(i,m){
        sum += a[i];
    }
    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<bits/stdc++.h>
using namespace std;
//Optimisations
#pragma GCC target ("avx2")
#pragma GCC optimization ("unroll-loops")
#pragma GCC optimize("O2")
//shortcuts for functions
#define pb push_back
#define mp make_pair
#define ff first 
#define ss second
#define all(v) v.begin(),v.end()
#define prec(n) fixed<<setprecision(n)
#define n_l '\n'
// make it python 
#define gcd __gcd
#define append push_back
#define str to_string
// utility functions shortcuts
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define sswap(a,b) {a=a^b;b=a^b;a=a^b;}
#define swap(a,b) {auto temp=a; a=b; b=temp;}
#define init(dp) memset(dp,-1,sizeof(dp));
#define set0(dp) memset(dp,0,sizeof(dp));
#define bits(x) __builtin_popcount(x)
#define SORT(v) sort(all(v))
#define endl "\n"
#define forr(i,n) for(ll i=0;i<n;i++)
// declaration shortcuts
typedef long long int ll;
#define int ll
// Constants
constexpr int dx[] = {-1, 0, 1, 0, 1, 1, -1, -1};
constexpr int dy[] = {0, -1, 0, 1, 1, -1, 1, -1};
constexpr ll INF = 1999999999999999997; 
constexpr int inf= INT_MAX;
constexpr int MAXSIZE = int(1e6)+5;
constexpr auto PI  = 3.14159265358979323846L;
constexpr auto oo  = numeric_limits<int>::max() / 2 - 2;
constexpr auto eps = 1e-6;
constexpr auto mod = 1000000007;
constexpr auto MOD = 1000000007;
constexpr auto MOD9 = 1000000009;
constexpr auto maxn = 100006;
//void IOfile(){
//freopen(file_name, reade_mode, stdin);
//freopen(file_name, write_mode, stdout);
//}
void fastio(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
}
int32_t main(){
	fastio();
	int n,m;
	cin>>n>>m;
	int s = 0 ;
	forr(i,m){
		int x;
		cin>>x;
		s+=x;
	}
	if(s>n) cout<<"-1";
	else cout<<n-s;
}

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 M, N, tmp;
    cin >> N >> M;
    int count = 0;
    for (int i = 0; i < M; i++)
    {
        cin >> tmp;
        count += tmp;
    }

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

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;
typedef pair<ll, ll> P;
typedef pair<int, int> i_i;

#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define ALL(v) v.begin(), v.end()
#define SZ(x) ((int)(x).size())
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main() {
    int N, M;
    int sum = 0, A;
    cin >> N >> M;
    //vector<int> A(M);
    rep(i, M){
        cin >> A;
        sum += A;
    }
    cout << max(-1, 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;
template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }
template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
typedef vector<long long> vlong;
typedef vector<string> vstring;
#define _GLIBCXX_DEBUG
#define vpush(a,x) a.push_back(x);
#define rep(i, n) REP(i, 0, n)
#define all(v) v.begin(), v.end()
#define REP(i, x, n) for(int i = x; i < n; i++)
const int INF = 1 << 30;
const int dx[] = {1,0,-1,0,1,1,-1,-1};
const int dy[] = {0,-1,0,1,1,-1,-1,1};
#define stp(x)  setprecision(x)
int main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n,m;
  cin>>n>>m;
  vint a(m);
  int sum=0;
  rep(i,m){
    cin>>a[i];
    sum+=a[i];
  }
  if(sum>n){
    cout<<-1<<'\n';
  }
  else{
    cout<<n-sum<<'\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.