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

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define repone(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define Rep(j,n) for(int j=0;j<(int)(n);++j)
#define Repo(j,o,n) for(int j=o;j<(int)(n);++j)
#define Repone(j,n) for(int j=1;j<(int)(n);++j)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define int long long
#define pb(a) push_back(a)
#define eraser(v,i) (v).erase(v.begin()+(i))
#define pbpair(a,b) push_back(make_pair(a,b))
#define Little 1
const long long INF = 1LL<<60;
#define pairint pair<int,int>
signed main(){
  int x=0,y=0,z=0,w=0,n=0,m=0,o=0;
  std::cin >> x >> y;
  std::vector<int> v(y);
  rep(i,y){
    std::cin >> z;
    x-=z;
  }
  if(x>=0)std::cout << x << '\n';
  else std::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 <iostream>

using namespace std;

int n, m, a;
long long sum;

int main()
{
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> a;
    sum += a;
  }
  int dif = n - sum;
  cout << max (-1, dif);
  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;
  long long int count=0;
  for(i=0;i<m;i++)
  {
    int x;cin>>x;
    count+=x;
  }
  if(count>n)
    cout<<-1<<endl;
  else
    cout<<n-count<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   for(i=0;i<m;i++)
      |       ^
Language: C++

#include <iostream>
using namespace std;

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

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

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

int main() {
  int n,m;
  cin >> n >> m;
  long long sum = 0;
  for (int i = 0; i < m; ++i) {
    int x;
    cin >> x;
    sum += x;
  }
 	
  cout << max(-1, n - sum) << "\n";
  return 0;
}

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

#include <bits/std++.h>
using namespace std;
int main()
{
	int n,m;
  	cin >> n >> m;
  	int a,ans = 0;
  	for(int i = 0;i < m;i++)
    {
       scanf("%d",&a);ans += a;
    }
  	if(n < ans)puts("-1");
  	else cout << n - ans;
  	return 0;
}

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

 
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  		unsigned long long N;
  int M;
  cin >> N >> M;
  vector<unsigned long long> A;
  unsigned long long sum = 0;
  for (int i= 0;i<M;++i){
    cin >> A[i];
    sum += A[i];
  }
  if(N - sum > 0){
    cout << N - sum;
  }else{ 
    cout << "-1";
   }
}

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

#include <iostream>
using namespace std;
int main(void){
    // Your code here!
  int N,M;
  int A[M-1];
  int total;
  int tota2;
  
  cin>>N>>M;
  
  for(int i=0;i<<M;i++){
      cin>>A[i];
  }
  for(int i=0;i<<M;i++){
     total=N-A[i]; 
  }
  for(int i=0;i<<M;i++){
     tota2=tota2+A[i];
  }
  
  
  if(N>total2){
      cout<<total;
      
  }
  else{
      cout<<"-1";
  }

  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:8: error: 'total2' was not declared in this scope; did you mean 'tota2'?
   23 |   if(N>total2){
      |        ^~~~~~
      |        tota2
Language: C++

#include <iostream>
using namespace std;
int main(void){
    // Your code here!
  int N,M;
  int A[M-1];
  int total;
  int tota2;
  
  cin>>N>>M;
  
  for(int i=0;i<<M;i++){
      cin>>A[i];
  }
  
   for(int i=0;i<<M;i++){
     total=N-A[i]; 
  }
  for(int i=0;i<<M;i++){
     tota2=total2+A[i];
  }
  
  
  if(N>total2){
      cout<<total;
      
  }
  else{
      cout<<"-1";
  }

  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:12: error: 'total2' was not declared in this scope; did you mean 'tota2'?
   20 |      tota2=total2+A[i];
      |            ^~~~~~
      |            tota2
a.cc:24:8: error: 'total2' was not declared in this scope; did you mean 'tota2'?
   24 |   if(N>total2){
      |        ^~~~~~
      |        tota2
Language: C

#include <iostream>
#include <string>
#include <math.h>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <queue>

using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i=0;i<(ll)n;i++)
#define rep1(i,n) for(ll i=1;i<(ll)n;i++)
#define repf(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define repr(i,a,b) for(ll i=(ll)a-1;i>=(ll)b;i--)
#define Fi first
#define Se second
typedef pair<ll, ll> pll;
const ll MAX = 1000000000000000000;
const char END = '\n';


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

	ll N, M, A, Ans = 0;
	cin >> N >> M;
	rep(i, M) {
		cin >> A;
		Ans += A;
	}
	if (N>= Ans)
		cout << N - Ans;
	else
		cout << -1;
	cout << END;
	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; scanf("%d%d",&n,&m);
    int res=0;
    for(int i=0;i<m;i++){
    	int x; scanf("%d",&x);
        res+=x;
    }
    if(res>=x) printf("%d",res);
    else puts("-1");
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: 'x' was not declared in this scope
   10 |     if(res>=x) printf("%d",res);
      |             ^
Language: C++

#include <bin/stdc++.h>

using namespace std;

int main()
{
	int N;
	int M;
	vector<int> A;

	cin >> N;
	cin >> M;

	int num;
	for (int i = 0; i < M; i++)
	{
		cin >> num;
		A.push_back(num);
	}

	int count = 0;
	for (int x : A)
	{
		count += x;
	}

	int ans = N - count;
	
	if (ans >= 0)
	{
		cout << ans;
	}
	else
	{
		cout << -1;
	}
}


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

import java.util.Scanner;
/**
 * Write a description of class Homework here.
 *
 * @author (your name)
 * @version (a version number or a date)
 */
public class Homework
{
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        
        int vacation = sc.nextInt();
        
        int assignments = sc.nextInt();
        
        int sum = 0;
        for(int i = 0; i < assignments; i++){
            int assign = sc.nextInt();
            
            sum += assign;
            
        }
        
        if(sum > vacation) {
            System.out.println("-1");
        } else {
            System.out.println(vacation - sum);
        }

    }
}

Compiler output:
Main.java:8: error: class Homework is public, should be declared in a file named Homework.java
public class Homework
       ^
1 error
Language: Java

import java.util.Scanner;
/**
 * Write a description of class Homework here.
 *
 * @author (your name)
 * @version (a version number or a date)
 */
public class Main
{
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        
        int vacation = sc.nextInt();
        
        int assignments = sc.nextInt();
        
        int sum = 0;
        for(int i = 0; i < assignments; i++){
            int assign = sc.nextInt();
            
            sum += assign;
            
        }
        
        if(assign > vacation) {
            System.out.println("-1");
        } else {
            System.out.println(vacation - assign);
        }

    }
}

Compiler output:
Main.java:25: error: cannot find symbol
        if(assign > vacation) {
           ^
  symbol:   variable assign
  location: class Main
Main.java:28: error: cannot find symbol
            System.out.println(vacation - assign);
                                          ^
  symbol:   variable assign
  location: class Main
2 errors
Language: C

#include <bits/stdc++.h>

#define ll long long
#define ld long double
#define COIN const int
#define ite iterator
#define PII pair<int,int>
#define PSI pair<string,int>
#define PIS pair<int,string>

#define REP(i,n) for((i)=0;(i)<(int)(n);(i)++)
#define REPD(i,n) for((i)=(n)-1;(i)>=0;(i)--)

#define ALL(c) (c).begin(), (c).end()
#define LEN(s) (s).size()
#define CLEAR(x) memset(x,0,sizeof x);

#define MP make_pair
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define X first
#define Y second

#define VI vector<int>
#define VS vector<string>
#define VII vector<PII>
#define VVI vector<VI>

#define PIII 3.1415926
#define PI 3.14
/*****************************************************************************/

using namespace std;

int n,m,a[10000],sum,i; 

int main()
{
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	cin >>n >>m;
	for (i=0;i<m;i++) {
		cin >>a[i];
		sum+=a[i];
	}
	if (sum>n) {
		cout <<"-1";
		return 0; 
	}
	cout <<n-sum;
	return 0;
}
/******************************************************************************
******************************************************************************/


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

#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

// increment
#define rep_n(_1, _2, _3, NAME, ...) NAME
#define rep_2(i, n) for (int(i) = 0; (i) < (int)(n); ++(i))
#define rep_3(i, initial, n) for (int(i) = (int)(initial); (i) < (int)(n); ++(i))
#define repeat(...) rep_n(__VA_ARGS__, rep_3, rep_2, rep_1)(__VA_ARGS__)
// decrement
#define rep_r_n(_1, _2, _3, NAME, ...) NAME
#define rep_r_2(i, n) for (int(i) = (int)(n); (i) > 0; (i)--)
#define rep_r_3(i, initial, n) for (int(i) = (int)(initial); (i) > (int)(n); (i)--)
#define repeat_r(...) rep_r_n(__VA_ARGS__, rep_r_3, rep_r_2)(__VA_ARGS__)
// define type definition
using namespace std;
typedef long long ll;
using mpint = boost::multiprecision::cpp_int; // 多倍長整数（任意精度）
typedef pair<int, int> P;

// define construct variable
const double EPS = numeric_limits<double>::epsilon();
// 10^9 + 7
const ll BIG_MOD = ll(1e9)+7;
const string ALPHABET = "abcdefghijklmnopqrstuvwxyz";

// define methods
// 最大公約数
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
// 最小公倍数
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
// char -> int
int ctoi(char c) { return (int)(c - '0'); }
// 素因数分解
vector< pair<ll, ll> > prime_factorize(ll n) {
  vector< pair<ll, ll> > p;
  for (ll i = 2; i * i <= n; i++) {
    if ((n % i) != 0) continue;
    p.push_back(make_pair(i, 0));
    while ((n % i) == 0) {
      n /= i;
      p[i].second += 1;
    }
    p.push_back(make_pair(n, 0));
  }

  if (n != 1) p.push_back(make_pair(n, 1));
  return p;
}
// 組み合わせの整合性を保つ（後ほど解析する）
ll modinv(ll a) {
	ll b = BIG_MOD, u = 1, v = 0;
	while (b) {
		ll t = a / b;
		a -= t * b;
		swap(a, b);
		u -= t * v;
		swap(u, v);
	}
	u %= BIG_MOD;
	if (u < 0) { u += BIG_MOD; }
	return u;
}
// 順列
ll permutation(ll n, ll m) {
	ll result = 1;
	for (ll i = n; i > n - m; i--) { result = (result * i) % BIG_MOD; }
	return result;
}
// 組み合わせ
ll combination(ll n, ll m) {
	ll p = permutation(n, m);
	ll div = 1;
	for (ll i = 2; i <= m; i++) { div = (div * i) % BIG_MOD; }
	return (p * modinv(div)) % BIG_MOD;
}

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

	repeat(i, M) {
		int n = 0;
		cin >> n;
		N -= n;
	}
	if (N < 0) N = -1;

	cout << 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>
using namespace std;

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


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() {
    long long N;
    long long M;
    cin >> N >> M;
    long long A[M];
    long long sum = 0;
    for (long long i = 0; i < M; ++i) {
        cin >> A[i];
        sum += A[i];
    }
    long long difference = (N - sum);
    if (difference < 0) {
        difference = -1;
    }
    cout << difference << endl;
    return 0;
}
#include <bits/stdc++.h>
using namespace std;

int main() {
    long long N;
    long long M;
    cin >> N >> M;
    long long A[M];
    long long sum = 0;
    for (long long i = 0; i < M; ++i) {
        cin >> A[i];
        sum += A[i];
    }
    long long difference = (N - sum);
    if (difference < 0) {
        difference = -1;
    }
    cout << difference << endl;
    return 0;
}


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

N,M=map(int,input().split())
A=list(map(int,input().split()))
t = N-sum(A)
if t>=0:
  print(t)
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 <cstdlib>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
typedef long long LL;

template<typename T>
istream& operator >> (istream& is, vector<T>& vs){
  for(T& v: vs) is >> v;
  return is;
}
template<typename T>
ostream& operator << (ostream& os, vector<T>& vs){
  for (const T& v : vs) os << v << " ";
  return os;
}

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 (N >= sum)
    cout << N - sum << endl;
  else
    cout << -1 << endl;
}


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

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

#pragma GCC optimize("Ofast")
#define rep(i,a,n) for(int i=a; i<n; i++)
typedef long long ll;
typedef pair<int,int> P;
const ll MOD = (int)1e9+7;
const ll INF = MOD*MOD;
const ll powll = 1LL<<1;

int main(){
	ll n,m; cin >> n >> m;
    ll sum = 0;
    rep(i,0,m){
        int a; cin >> a;
        sum += a;
    }
    cout << max(-1LL, n-sum) << "\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>

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORTASC(c) sort((c).begin(),(c).end())
#define SORTDESC(c,t) sort((c).begin(),(c).end(), std::greater<t>());
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define VMAX(a) *max_element(ALL(a))
#define VMIN(a) *min_element(ALL(a))
#define OUT(a) cout << (a) << endl;
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

const double PI  = acos(-1.0);

template <class T, class S>
using umap = std::unordered_map<T, S>;
using ll = long long;
using namespace std;

int main() {
    ll n, m, t = 0;
    ll a[200010];

    cin >> n >> m;

    REP(i, m){
      ll tmp;
      cin >> tmp;
      t += tmp;
    }

    if (t > n){
      cout << -1 << endl;
    } else {
      cout << n-t << 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;
  vector<long long> a(m);
  for(int i=0; i<m;i++){
    cin >> a.at(i);
  }
  cout << max(n-accumulate(a.begin(),a.end(),0LL),(long long)-1)
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:65: error: expected ';' before '}' token
   11 |   cout << max(n-accumulate(a.begin(),a.end(),0LL),(long long)-1)
      |                                                                 ^
      |                                                                 ;
   12 | }
      | ~
Language: C++

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

int main(){
  int n,m;
  cin >> n >> m;
  vector<long long> a(m);
  for(int i=0; i<m;i++){
    cin >> a.at(i);
  }
  cout << max(n-accumulate(a.begin(),a.end(),0LL),-1)
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: no matching function for call to 'max(long long int, int)'
   11 |   cout << max(n-accumulate(a.begin(),a.end(),0LL),-1)
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:11:14: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   11 |   cout << max(n-accumulate(a.begin(),a.end(),0LL),-1)
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:11:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   11 |   cout << max(n-accumulate(a.begin(),a.end(),0LL),-1)
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C

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

int main(){
  int n,m;
  cin >> n >> m;
  vector<long long> a(m);
  for(int i=0; i<m;i++){
    cin >> a.at(i);
  }
  cout << max(n-accumulate(a.begin(),a.end(),0LL),-1)
}

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>

#define A_LIMIT 10000

int main()
{
  int N,M,c,pos,a_pos;
  char tm[10]={0};
  
  pos = a_pos = 0;
  
  scanf("%d %d\n", &N, &M);
  
  while((c=getchar())!='\n')
  {
    if(c==' ')
    {
      tm[pos]='\0';
      sscanf(tm,"%d", &A[a_pos]);
      ++a_pos;
      pos=0;
    }
    else
    {
      tm[pos]=c;
      ++pos;
    }
  }
  
  tm[pos]='\0';
  sscanf(tm,"%d", &A[a_pos]);
  pos=0;
    
  for(int i=0; i<M; i++)
  	pos+=A[i];
    
  printf("%d\n",N-pos);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:24: error: 'A' undeclared (first use in this function)
   19 |       sscanf(tm,"%d", &A[a_pos]);
      |                        ^
main.c:19:24: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

int main()
{
    int n,m,a[10000],sum=0;
    scanf("%d %d\n",&n,&m);
    for(int i=0;i<m;i++)
    {
        scanf("%d",&a[i]);
        sum+=a[i];
    }
    if(sum>n)
    {
        printf("-1\n");
    }
    else
    {
        printf("%d", n-sum);
    }
    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 <algorithm>
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <cmath>

using namespace std;
using ll = long long;
using ull = unsigned long long;

constexpr ll LLINF {1001002003004005006};//ll = 9*LLINF
constexpr int INTINF {1000000000};//int = 2*INTINF

#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 srep(i,s,t) for(int i = s; i < t;  ++i)

template<typename T>
void maxs(T& x, T&& y) {
  x=std::max(x,y);
}
template<typename T>
void maxs(T& x, T& y) {
  x=std::max(x,y);
}

template<typename T>
void mins(T& x, T&& y) {
  x=std::min(x,y);
}
template<typename T>
void mins(T& x, T& y) {
  x=std::min(x,y);
}

int main() {
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);

  int N, M;
  cin >> N >> M;
  vector<int> A(M);
  rep(i, M) cin >> A[i];
  int sum {};
  rep(i, M) {
    sum += A[i];
  }
  if (sum > N) {
    cout << "-1\n";
  } else {
    cout << N - sum << '\n';
  }
}


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

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

std::vector<int> accept_costs(const std::size_t n_costs)
{
  std::vector<int> result(n_costs);
  for (std::size_t i=0; i<n_costs; ++i) {
    std::cin >> result[i];
  }
  return result;
}

int main()
{
  int n_days;
  int n_hws;
  
  std::cin >> n_days >> n_hws;
  const std::vector<int> costs = accept_costs(n_hws);
  
  int remains = n_days - std::accumulate(costs.begin(), costs.end(), 0);
  std::cout << (remains < 0) ? -1 : remains << std::endl;
}


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

#include <iostream>
#include <vector>
#include <algorithm>

std::vector<int> accept_costs(const std::size_t n_costs)
{
  std::vector<int> result(n_costs);
  for (std::size_t i=0; i<n_costs; ++i) {
    std::cin >> result[i];
  }
  return result;
}

int main()
{
  int n_days;
  int n_hws;
  
  std::cint >> n_days >> n_hws;
  const std::vector<int> costs = accept_costs(n_hws);
  
  int remains = n_days - std::accumulate(costs.begin(), costs.end(), 0);
  std::cout << (remains < 0) ? -1 : remains << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:8: error: 'cint' is not a member of 'std'; did you mean 'cin'?
   19 |   std::cint >> n_days >> n_hws;
      |        ^~~~
      |        cin
a.cc:22:31: error: 'accumulate' is not a member of 'std'
   22 |   int remains = n_days - std::accumulate(costs.begin(), costs.end(), 0);
      |                               ^~~~~~~~~~
a.cc:23:45: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   23 |   std::cout << (remains < 0) ? -1 : remains << std::endl;
      |                                     ~~~~~~~~^~~~~~~~~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'scanf' was not declared in this scope
    4 |   scanf("%d%d",&n,&m);
      |   ^~~~~
a.cc:9:5: error: 'printf' was not declared in this scope
    9 |     printf("-1\n");
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int a[10010];
a.cc:11:5: error: 'printf' was not declared in this scope
   11 |     printf("%d\n",n-s);
      |     ^~~~~~
a.cc:11:5: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:4:2: error: 'scanf' was not declared in this scope
    4 |  scanf("%d%d",&n,&m);
      |  ^~~~~
a.cc:9:3: error: 'printf' was not declared in this scope
    9 |   printf("-1\n");
      |   ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int a[10010];
a.cc:11:3: error: 'printf' was not declared in this scope
   11 |   printf("%d\n",n-s);
      |   ^~~~~~
a.cc:11:3: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C

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

typedef pair<int,int> P;
#define ll long long
#define ld long double
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define PI 3.14159265358979323846
#define sz(x) ((int)(x).size())
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)

const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
int main()
{
    int n,m;
    cin >> n >> m;
    vector<int> a(m);
    int sum = 0;
    rep(i,m)
    {
        cin >> a[i];
        sum += a[i];
    }

    if (n-sum < 0)
    {
        cout << -1 << endl;
        return 0;
    }
    cout << n-sum << endl;
    return 0;
    
}

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

#include <bits/stdc++.h>
#define all(vec) vec.begin(), vec.end()
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
template <class T>
using V = vector<T>;
constexpr ll INF = (1LL << 30) - 1LL;
constexpr ll MOD = 998244353LL;
constexpr int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
template <class T>
void chmin(T &a, T b) { a = min(a, b); }
template <class T>
void chmax(T &a, T b) { a = max(a, b); }
void debug() { cerr << "ok" << endl; }
template <class T>
void printv(const vector<T> &v) {
    for (int i = 0; i < v.size(); i++) cout << v[i] << (i + 1 == v.size() ? '\n' : ' ');
}
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    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 << '\n';
    } else {
        cout << n - sum << '\n';
    }
}

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

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

int main() {
    long long N;
    long long M;
    cin >> N >> M;
    long long A[M];
    long long sum = 0;
    for (long long i = 0; i < M; ++i) {
        cin >> A[i];
        sum += A[i];
    }
    long long difference = (N - sum);
    cout << difference << 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 <limits.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <bitset>
#include <cassert>
#include <random>
#include <functional>
#include <stack>
#include <iomanip>
#include <cassert>
//#include <boost/multiprecision/cpp_int.hpp>
#include <complex>
#include <cstdio>
#include <list>
#include <bitset>

//< in.txt > out.txt
using namespace std;
//std::ios::sync_with_stdio(false);
//std::cin.tie(0);
const long long MOD = 998244353;
const long long INF = 1e18;
typedef long long LL;
typedef long double LD;
typedef pair<LL, LL> PLL;
typedef pair<LD, LL> pdl;
typedef pair<LD, LD> pdd;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned long long ULL;
//typedef boost::multiprecision::cpp_int bigint;

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	LL N, M;
	cin >> N >> M;
	LL sum = 0;
	for (LL m = 0; m < M; m++) {
		LL a;
		cin >> a;
		sum += a;
	}
	if (sum > N)cout << "-1\n";
	else cout << N - sum << "\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 ll long long int
int mod=998244353;
#define mp make_pair
#define pb push_back
int main(){ 
	long long int t,n,b,c=0,d;
	cin>>n>>m;
	for(int i=0;i<m;i++){
		cin>>b;
		c+=b;
		}
		if(n-c<0){
			cout<<-1<<endl;}
			else{
		cout<<n-c<<endl;
	}
    return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int mod=998244353;
#define mp make_pair
#define pb push_back
int main(){ 
	long long int t,n,b,c=0,d;
	cin>>n>>m;
	for(int i=0;i<m;i++){
		cin>>b;
		c+=b;
		}
		if(n-c<0){
			cout<<-1<<endl;}
			else{
		cout<<n-c<<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 day,homework;
  cin>>day;
  cin>>homework;
  int a[homework]
  for(int i=0;i<homework;i++){
    cin>>a[i];
  }
  int ans;
  for(int i=0;i<homework;i++){
    ans=day-a[i];
  }
  if(ans<0){
    ans=-1;
  }
  cout<<ans;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: expected initializer before 'for'
    8 |   for(int i=0;i<homework;i++){
      |   ^~~
a.cc:8:15: error: 'i' was not declared in this scope
    8 |   for(int i=0;i<homework;i++){
      |               ^
a.cc:13:13: error: 'a' was not declared in this scope
   13 |     ans=day-a[i];
      |             ^
Language: C++

/*
	Copyright: razouq (c)
	Author: Anass BENDARSI
	Date: 20-Apr-20 3:53:36 AM
	flamers will **** you
*/
//#include<flamers.h>

#include "bits/stdc++.h"
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#define ll long long
#define ull unsigned long long
#define F first
#define S second
#define PB push_back
#define POB pop_back

using namespace std;

int main(){
//	freopen("input.in", "r", stdin);
//	freopen("output.out", "w", stdout);
	ios::sync_with_stdio(0);
	cin.tie();
	int n, m
	cin>>n>>m;
	int a[n];
	int sum = 0;
	for(int 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:
a.cc: In function 'int main()':
a.cc:27:9: error: expected initializer before 'cin'
   27 |         cin>>n>>m;
      |         ^~~
a.cc:30:28: error: 'm' was not declared in this scope
   30 |         for(int i = 0; i < m; i++) {
      |                            ^
Language: Java

import java.util.*;
class Main
{
  public static void main(String args[])
  {
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    int m=sc.nextInt();
    int sum=0;
    System.out.println();
    int a[]=new int[m]
    for(int i=1;i<=m;i++)
    {
      a[i]=sc.nextInt();
    }
    for(int i=1;i<=m;i++)
    {
      sum=sum+a[i];
    }
    if(sum > n)
    {
      System.out.println("-1");
    }
    else
    {
      System.out.println(a-sum);
    }
  }
}
      
    

Compiler output:
Main.java:11: error: ';' expected
    int a[]=new int[m]
                      ^
1 error
Language: Java

import java.util.*;
class Main
{
  public static void main(String args[])
  {
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    int m=sc.nextInt();
    int sum=0;
    int a[]=new int[m]
    for(int i=1;i<=m;i++)
    {
      a[i]=sc.nextInt();
    }
    for(int i=1;i<=m;i++)
    {
      sum=sum+a[i];
    }
    if(sum > n)
    {
      System.out.println("-1");
    }
    else
    {
      System.out.println(n-sum);
    }
  }
}
      
    

Compiler output:
Main.java:10: error: ';' expected
    int a[]=new int[m]
                      ^
1 error
Language: Java

import java.util.*;
class Main
{
  public static void main(String args[])
  {
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    int m=sc.nextInt();
    int sum=0;
    int a[]=new int[m];
    for(int i=1;i<=m;i++)
    {
      a[i]=sc.nextInt();
    }
    for(int i=1;i<=m;i++)
    {
      sum=sum+a[i];
    }
    if(sum > n)
    {
      System.out.println("-1");
    }
    else
    {
      System.out.println(a-sum);
    }
  }
}
      
    

Compiler output:
Main.java:25: error: bad operand types for binary operator '-'
      System.out.println(a-sum);
                          ^
  first type:  int[]
  second type: int
1 error
Language: Java

import java.util.*;
class Main
{
  public static void main(String args[])
  {
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    int m=sc.nextInt();
    int sum=0;
    int a[]=new int[m]
    for(int i=1;i<=m;i++)
    {
      a[i]=sc.nextInt();
    }
    for(int i=1;i<=m;i++)
    {
      sum=sum+a[i];
    }
    if(sum > n)
    {
      System.out.println("-1");
    }
    else
    {
      System.out.println(a-sum);
    }
  }
}
      
    

Compiler output:
Main.java:10: error: ';' expected
    int a[]=new int[m]
                      ^
1 error
Language: C++

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

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

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

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



Compiler output:
main.c:1:9: error: expected declaration specifiers or '...' before string constant
    1 |   scanf("%d%d",&n,&m);
      |         ^~~~~~
main.c:1:16: error: expected declaration specifiers or '...' before '&' token
    1 |   scanf("%d%d",&n,&m);
      |                ^
main.c:1:19: error: expected declaration specifiers or '...' before '&' token
    1 |   scanf("%d%d",&n,&m);
      |                   ^
main.c:2:3: error: expected identifier or '(' before 'for'
    2 |   for(i=0; i<m; i++)
      |   ^~~
main.c:2:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    2 |   for(i=0; i<m; i++)
      |             ^
main.c:2:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    2 |   for(i=0; i<m; i++)
      |                  ^~
main.c:5:3: error: expected identifier or '(' before 'for'
    5 |   for(i=0; i<m; i++) s+=a[i];
      |   ^~~
main.c:5:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    5 |   for(i=0; i<m; i++) s+=a[i];
      |             ^
main.c:5:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    5 |   for(i=0; i<m; i++) s+=a[i];
      |                  ^~
main.c:6:4: error: expected identifier or '(' before 'if'
    6 |    if(s>n){
      |    ^~
main.c:8:5: error: expected identifier or '(' before 'else'
    8 |    }else{
      |     ^~~~
main.c:11:4: error: expected identifier or '(' before 'return'
   11 |    return 0;
      |    ^~~~~~
main.c:12:4: error: expected identifier or '(' before '}' token
   12 |    }
      |    ^
Language: C++

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



Compiler output:
a.cc:1:8: error: expected constructor, destructor, or type conversion before '(' token
    1 |   scanf("%d%d",&n,&m);
      |        ^
a.cc:2:3: error: expected unqualified-id before 'for'
    2 |   for(i=0; i<m; i++)
      |   ^~~
a.cc:2:12: error: 'i' does not name a type
    2 |   for(i=0; i<m; i++)
      |            ^
a.cc:2:17: error: 'i' does not name a type
    2 |   for(i=0; i<m; i++)
      |                 ^
a.cc:5:3: error: expected unqualified-id before 'for'
    5 |   for(i=0; i<m; i++) s+=a[i];
      |   ^~~
a.cc:5:12: error: 'i' does not name a type
    5 |   for(i=0; i<m; i++) s+=a[i];
      |            ^
a.cc:5:17: error: 'i' does not name a type
    5 |   for(i=0; i<m; i++) s+=a[i];
      |                 ^
a.cc:6:4: error: expected unqualified-id before 'if'
    6 |    if(s>n){
      |    ^~
a.cc:8:5: error: expected unqualified-id before 'else'
    8 |    }else{
      |     ^~~~
a.cc:11:4: error: expected unqualified-id before 'return'
   11 |    return 0;
      |    ^~~~~~
a.cc:12:4: error: expected declaration before '}' token
   12 |    }
      |    ^
Language: C

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

Compiler output:
main.c:1:9: error: expected declaration specifiers or '...' before string constant
    1 |   scanf("%d%d",&n,&m);
      |         ^~~~~~
main.c:1:16: error: expected declaration specifiers or '...' before '&' token
    1 |   scanf("%d%d",&n,&m);
      |                ^
main.c:1:19: error: expected declaration specifiers or '...' before '&' token
    1 |   scanf("%d%d",&n,&m);
      |                   ^
main.c:2:3: error: expected identifier or '(' before 'for'
    2 |   for(i=0; i<m; i++)
      |   ^~~
main.c:2:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    2 |   for(i=0; i<m; i++)
      |             ^
main.c:2:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    2 |   for(i=0; i<m; i++)
      |                  ^~
main.c:5:3: error: expected identifier or '(' before 'for'
    5 |   for(i=0; i<m; i++) s+=a[i];
      |   ^~~
main.c:5:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    5 |   for(i=0; i<m; i++) s+=a[i];
      |             ^
main.c:5:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    5 |   for(i=0; i<m; i++) s+=a[i];
      |                  ^~
main.c:6:4: error: expected identifier or '(' before 'if'
    6 |    if(s>n){
      |    ^~
main.c:8:5: error: expected identifier or '(' before 'else'
    8 |    }else{
      |     ^~~~
main.c:11:4: error: expected identifier or '(' before 'return'
   11 |    return 0;
      |    ^~~~~~
main.c:12:4: error: expected identifier or '(' before '}' token
   12 |    }
      |    ^
Language: C

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



Compiler output:
main.c:1:1: error: unknown type name 'c'
    1 | c  scanf("%d%d",&n,&m);
      | ^
main.c:1:10: error: expected declaration specifiers or '...' before string constant
    1 | c  scanf("%d%d",&n,&m);
      |          ^~~~~~
main.c:1:17: error: expected declaration specifiers or '...' before '&' token
    1 | c  scanf("%d%d",&n,&m);
      |                 ^
main.c:1:20: error: expected declaration specifiers or '...' before '&' token
    1 | c  scanf("%d%d",&n,&m);
      |                    ^
main.c:2:3: error: expected identifier or '(' before 'for'
    2 |   for(i=0; i<m; i++)
      |   ^~~
main.c:2:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    2 |   for(i=0; i<m; i++)
      |             ^
main.c:2:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    2 |   for(i=0; i<m; i++)
      |                  ^~
main.c:5:3: error: expected identifier or '(' before 'for'
    5 |   for(i=0; i<m; i++) s+=a[i];
      |   ^~~
main.c:5:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    5 |   for(i=0; i<m; i++) s+=a[i];
      |             ^
main.c:5:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    5 |   for(i=0; i<m; i++) s+=a[i];
      |                  ^~
main.c:6:4: error: expected identifier or '(' before 'if'
    6 |    if(s>n){
      |    ^~
main.c:8:5: error: expected identifier or '(' before 'else'
    8 |    }else{
      |     ^~~~
main.c:11:4: error: expected identifier or '(' before 'return'
   11 |    return 0;
      |    ^~~~~~
main.c:12:4: error: expected identifier or '(' before '}' token
   12 |    }
      |    ^
Language: C++

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

typedef unsigned long long ULL;
typedef long long LL;

using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:24:22: error: expected primary-expression before '<' token
   24 |         cout << -1 < <endl;
      |                      ^
Language: C++

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

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

import java.util.Scanner;

public class Main{
  	public static void main(String[] args){
  		Scanner sc = new Scanner(System.in);
  		int N = sc.nextInt();
  		int M = sc.nextInt();
  		int sum = 0;
  		for(int i = 0; i < M; i++){
  	    	int A = sc.nextInt();
  	    	sum += A;
    	}
  		int freeDays = N - sum;
  		if(freeDays < 0){
  	    	freeDays = -1;
    	}
  		System.out.println(freeDays);
    }

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