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

#include <bits/stdc++.h>

using namespace std;

const double PI = 3.141592653589;
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define mp make_pair
#define int long long
#define ll long long
#define ll long long
#define all(c) (c).begin(),(c).end()
#define M 1000000007
#define INF LLONG_MAX
#define pr(...) dbs(#__VA_ARGS__, __VA_ARGS__)
template <class T> void dbs(string str, T t) {cerr << str << " : " << t << "\n";}
template <class T, class... S> void dbs(string str, T t, S... s) {int idx = str.find(','); cerr << str.substr(0, idx) << " : " << t << ", "; dbs(str.substr(idx + 1), s...);}
template <class S, class T>ostream& operator <<(ostream& os, const pair<S, T>& p) {return os << "(" << p.first << ", " << p.second << ")";}
template <class T>ostream& operator <<(ostream& os, const vector<T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class T>ostream& operator <<(ostream& os, const set<T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class S, class T>ostream& operator <<(ostream& os, const map<S, T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class T> void prc(T a, T b) {cerr << "["; for (T i = a; i != b; ++i) {if (i != a) cerr << ", "; cerr << *i;} cerr << "]\n";}
// Use pr(a,b,c,d,e) or cerr<<anything or prc(v.begin(),v.end()) or prc(v,v+n)
//  


int32_t main()
{
    fastio;
    //freopen("file.in", "r", stdin);
    //freopen("file.out", "w", stdout);
    int n, m;
    cin >> m >> n;
    vector<int> v(n);
    int sm = 0;
    for(int i=0;i<n;i++)
    {
    	cin >> v[i];
    	sm += v[i];
    }
    if(sm <= m) cout << m - sm  <<  "\n";
    else cout << "-1\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

//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
typedef long double lb;
#define int long long
#define double long double
#define endn "\n"
typedef pair<int,int> P;
template<class T> inline bool chmin(T& a, T b){if(a>b){a = b;return 1;}return 0;}
template<class T> inline bool chmax(T& a, T b){if(a<b){a = b;return 1;}return 0;}
const int MOD = 1000000007;
//const int MOD = 998244353;
template<class T> inline int add(T& a, T b, T M = MOD){a=(a+M)%M;b=(b+M)%M;a=(a+b)%M;return a;};
template<class T> inline int mul(T& a, T b, T M = MOD){if(a>=M)a%=M;if(b>=M)b%=M;a*=b;if(a>=M)a%=M;return a;};
const ll INF = 1e16;
const double EPS = 1e-10;
const double PI = 3.141592653589793;
const string abc="abcdefghijklmnopqrstuvwxyz";
const string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const pair<int,int> fd[] = {make_pair(1,0),make_pair(-1,0),make_pair(0,1),make_pair(0,-1)}; 

////////////////////////////////////////////////////////////////////
///////////////////////___modpow___////////////////////
ll modpow(ll a,  ll n, const ll &MOD = MOD){
  ll ret = n == 0 ? 1 : modpow(a, n/2, MOD);
  (ret *= ret) %= MOD;
  if(n%2)((ret *= a) %= MOD);
  return ret;
}
///////////////////////___modinv___////////////////////
ll modinv(ll d, const ll &MOD = MOD){
  return modpow(d, MOD-2, MOD);
}
////////////////////////////////////////////////////////////////////

signed main(){
  int n,m;cin>>n>>m;
  int ans = n;
  rep(i,m){
    int a;cin>>a;ans -= a;
  }
  cout << max(-1LL, ans ) << endl;
}


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

#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <string.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define forn(i,a,b) for(int i=a;i<=b;i++)
#define INF 2147483647
#define LLINF 9223372036854775807
using namespace std;
int main(){
	int n,m;
	cin>>n>>m;
	long long cnt=0;
	for(int i=0;i<m;i++){
		long long a;
		cin>>a;
		cnt+=a;
	}
	cnt=n-cnt;
	if(cnt<0)cnt=-1;
	cout<<cnt<<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;
typedef long long int ll;

#define rep( i, n, m ) for(int i = ( n ); i < ( m ); i++)
#define rep_d( i, n, m ) for(int i = ( n ) - 1; i >= ( m ); i--)
#define sort_asc( X ) sort(( X ).begin(), ( X ).end())
#define sort_desc( X ) sort(( X ).begin(), ( X ).end(), greater <>())
#define endl "\n"

template <class T> bool chmax( T& a, T b );
template <class T> bool chmin( T& a, T b );
int* eratosthenes( int N );
bool bit_search( int pattern, int N );
void initialize( void );

const ll INF = 1LL << 60;
const int k_mod = 1e9 + 7;
template <typename T, typename K> struct P {
	T a; K b;
};
typedef struct {
	vector <int> to;
	int cost;
} edge;

int main( void ){
	// initialize();
	int N, M;
	cin >> N >> M;
	int sum = 0;
	rep(i,0,M){
		int a; cin >> a;
		sum+=a;
	}
	if (N< sum)
		cout << "-1\n";
	else
		cout << N-sum << endl;
}

template <class T> bool chmax( T& a, T b ) {
	if (a < b){
		a = b; return true;
	}
	return false;
}
template <class T> bool chmin( T& a, T b ) {
	if (a > b){
		a = b; return true;
	}
	return false;
}
int* eratosthenes( int N ){
	int* prime_array = new int[ N + 1 ];
	int lim = N;
	prime_array[ 0 ] = 0;
	prime_array[ 1 ] = 0;
	rep( i, 2, N + 1 ){
		prime_array[ i ] = 1;
	}
	rep( i, 2, lim ){
		if (prime_array[ i ] == 0)
			continue;
		lim = N / i;
		for(int j = i * 2; j < N + 1; j += i){
			prime_array[ j ] = 0;
		}
	}
	return prime_array;
}
bool bit_search( int pattern, int N ){
	int cnt = 0;
	rep( bit, 0, N ){
		if (pattern & ( 1 << bit )){
			cnt++;
		}
	}
	return true;
}
void initialize( void ){
	cout << fixed << setprecision( 10 );
}


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

#pragma GCC optimize ("O3")
#include <iostream>
#include <iomanip>
#include <istream>
#include <ostream>
#include <sstream>
#include <iterator>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <bitset>
#include <utility>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <ctime>
#include <cctype>
#include <cstdlib>
#define IINF 100000000
#define INF 300000000000000000
#define MOD 1000000007
#define mod 1000000007
#define REP(i, a, n) for (ll i = a; i < (ll)(n); i++)
#define REPE(i, a, n) for (ll i = a; i <= (ll)(n); i++)
#define rep(i,n)for (ll i = 0; i < (ll)(n); i++)
#define Endl endl
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define mmax(x,y)(x>y?x:y)
#define mmin(x,y)(x<y?x:y)
#define chmax(x,y) x=mmax(x,y)
#define chmin(x,y) x=mmin(x,y)
#define all(x) (x).begin(),(x).end()
#define siz(x) (ll)(x).size()
#define PI acos(-1.0)
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef pair<int,int>Pin;
typedef pair<ll,ll>Pll;
template<class T> using V=vector<T>;
long long GCD(long long a, long long b) {return b?GCD(b,a%b):a;}
long long LCM(long long a, long long b) {return a/GCD(a,b)*b;}
int dx[4]={-1,0,1,0};
int dy[4]={0,-1,0,1};
int ddx[8]={-1,0,1,0,1,1,-1,-1};
int ddy[8]={0,-1,0,1,1,-1,1,-1};
ll cmp1(pair<ll,ll>a,pair<ll,ll> b){
        if(a.se!=b.se)
        return a.se<b.se;
        else
        return a.fi<b.fi;
}
//----------------------------------------------------------------------

//----------------------------------------------------------------------
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    //-------------------------------  
    //ll begin_time=clock();
    //-------------------------------
    //int r;cin>>r;
    //cout<<(double)r*2.0*PI<<endl;
    //printf("%.10lf\n",(double)r*2.0*PI);


    int n,m;cin>>n>>m;
    V<int>a(m);
    for(int i=0;i<m;i++)cin>>a[i];
    for(int i=0;i<m;i++){
        n-=a[i];
    }
    if(n<0)cout<<-1<<endl;
    else cout<<n<<endl;
    //-------------------------------  
    //ll end_time=clock();cout<<"time="<<end_time-begin_time<<"ms"<<endl;
    //-------------------------------
    return 0;
}
//----------------------------------------------------------------------

















































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

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

#define rep(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i)
#define per(i, a, b) for (int i = (a), i##end = (b); i >= i##end; --i)

mt19937 Rnd(chrono::high_resolution_clock::now().time_since_epoch().count());

template <typename T>
inline void chkmax(T &x, T y) { if (x < y) x = y; }

template <typename T>
inline void chkmin(T &x, T y) { if (x > y) x = y; }

inline int read() {
  #define nc getchar()
  int x = 0;
  char c = nc;
  while (c < 48) c = nc;
  while (c > 47) x = x * 10 + (c ^ 48), c = nc;
  return x;
  #undef nc
}

typedef long long ll;
int n, m;

int main() {
  cin >> n >> m;
  int now = n;
  rep(i, 1, m) {
    now -= read();
  }
  cout << (now < 0 ? -1 : now) << endl;
  return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0; i<n; i++)
#define eb(t) emplace_back(t)
typedef long long ll;
typedef long long unsigned int llu;
ll MOD = 1000000007;
ll INF = 1000000009;

ll a[1000010];

void solve(){

    ll n,m;
    cin >> n >> m;
    ll sum = 0;
    rep(i,m){
        cin >> a[i];
        sum += a[i];
    }

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

}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  solve();
  return 0;
}


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

#include <bits/stdc++.h>

using namespace std;

#define SZ(x) (int)(x.size())

using ll = long long;
using ld = long double;
const ld eps = 1e-9;
const ll MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;

template <typename T1, typename T2>
void chmax(T1 &a, const T2 &b) {
  if(a < b) a = b;
}

template <typename T1, typename T2>
void chmin(T1 &a, const T2 &b) {
  if(a > b) a = b;
}

template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}

template<typename T1, typename T2>
ostream& operator<<(ostream &os, const pair<T1, T2> p) {
  os << p.first << ":" << p.second;
  return os;
}

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

  int n, m; cin >> n >> m;
  vector<int> a(m);
  ll su = 0;
  for(int i=0;i<m;++i) {
    cin >> a[i];
    su += a[i];
  }
  cout << (n - su >= 0 ? n - su : -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;
using ll = long long;

#define ALL(obj) (obj).begin(),(obj).end()
#define SPEED cin.tie(0);ios::sync_with_stdio(false);

template<class T> using PQ = priority_queue<T>;
template<class T> using PQR = priority_queue<T,vector<T>,greater<T>>;

constexpr long long MOD = (long long)1e9 + 7;
constexpr long long MOD2 = 998244353;
constexpr long long HIGHINF = (long long)1e18;
constexpr long long LOWINF = (long long)1e15;
constexpr long double PI = 3.1415926535897932384626433L;

template <class T> vector<T> multivector(size_t N,T init){return vector<T>(N,init);}
template <class... T> auto multivector(size_t N,T... t){return vector<decltype(multivector(t...))>(N,multivector(t...));}
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template <class T, class U>ostream &operator<<(ostream &o, const map<T, U>&obj) {o << "{"; for (auto &x : obj) o << " {" << x.first << " : " << x.second << "}" << ","; o << " }"; return o;}
template <class T>ostream &operator<<(ostream &o, const set<T>&obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
template <class T>ostream &operator<<(ostream &o, const multiset<T>&obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
template <class T>ostream &operator<<(ostream &o, const vector<T>&obj) {o << "{"; for (int i = 0; i < (int)obj.size(); ++i)o << (i > 0 ? ", " : "") << obj[i]; o << "}"; return o;}
template <class T, class U>ostream &operator<<(ostream &o, const pair<T, U>&obj) {o << "{" << obj.first << ", " << obj.second << "}"; return o;}
template <template <class tmp>  class T, class U> ostream &operator<<(ostream &o, const T<U> &obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr)o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
void print(void) {cout << endl;}
template <class Head> void print(Head&& head) {cout << head;print();}
template <class Head, class... Tail> void print(Head&& head, Tail&&... tail) {cout << head << " ";print(forward<Tail>(tail)...);}
template <class T> void chmax(T& a, const T b){a=max(a,b);}
template <class T> void chmin(T& a, const T b){a=min(a,b);}
void YN(bool flg) {cout << (flg ? "YES" : "NO") << endl;}
void Yn(bool flg) {cout << (flg ? "Yes" : "No") << endl;}
void yn(bool flg) {cout << (flg ? "yes" : "no") << endl;}

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


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

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

//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
typedef long long ll;
#define pb push_back
#define mii map <int, int>
#define mll map <ll, ll>
#define pii pair <int, int>
#define pll pair <ll, ll>
#define vi vector <int>
#define vd vector <double>
#define vll vector <ll>
#define fi first
#define se second
#define si set <int>
#define sll set <ll>
#define spii set <pii>
#define vs vector <string>
#define vpii vector <pair <int,int> >
#define vpll vector <pair <long long,long long> >
#define vvi vector <vector <int> >
#define vvpii vector <vector <pii > >
#define vvll vector <vll>
#define vsi vector <si>
#define forn(i, n) for (int i = 0; i < (n); i++)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define for1(i, n) for (int i = 1; i < (n); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(),(x).rend()


using namespace std;
const ll INFLL = 1e18;
const int MAXN = 1e6+100;
const ll INF = 1e9;
const ll mod1=1e9+7;
const ll mod2=2e9+11;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    #ifdef LOCAL
    freopen("a.in","r",stdin);
    #endif
    ll n,m;
    cin>>n>>m;
    vector <int> a(m);
    ll sum=0;
    rep(i,m)
    cin>>a[i],sum+=a[i];
    if (sum>n)
        cout<<-1;
    else
        cout<<n-sum;





}

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

#include <bits/stdc++.h>
using namespace std;
#define all(v) ((v).begin()),((v).end())
#define ll long long
#define fastIO cout << fixed << setprecision(12), ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
double const EPS = 1e-9, PI = acos(-1);
const int N = 1e6 + 9, OO = 1e9 + 7, MOD = 1e9 + 7;
const ll INF = 1e18;
using namespace std;

int main() {
	fastIO;
#ifdef LOCAL
//	freopen("input.in", "rt", stdin);
#endif
	int n, m;
	cin >> n >> m;
	ll total = 0, a;
	for (int i = 0; i < m; ++i) {
		cin >> a;
		total += a;
	}
	if(total > n) {
		cout << -1;
	} else {
		cout << n - total;
	}
	return 0;
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
         ^
Main.java:3: error: illegal character: '#'
#define all(v) ((v).begin()),((v).end())
^
Main.java:3: error: class, interface, enum, or record expected
#define all(v) ((v).begin()),((v).end())
        ^
Main.java:4: error: illegal character: '#'
#define ll long long
^
Main.java:5: error: illegal character: '#'
#define fastIO cout << fixed << setprecision(12), ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
^
Main.java:7: error: class, interface, enum, or record expected
const int N = 1e6 + 9, OO = 1e9 + 7, MOD = 1e9 + 7;
^
Main.java:8: error: class, interface, enum, or record expected
const ll INF = 1e18;
^
Main.java:9: error: class, interface, enum, or record expected
using namespace std;
^
Main.java:12: error: not a statement
	fastIO;
	^
Main.java:13: error: illegal character: '#'
#ifdef LOCAL
^
Main.java:15: error: illegal character: '#'
#endif
^
Main.java:15: error: not a statement
#endif
 ^
Main.java:17: error: not a statement
	cin >> n >> m;
	         ^
Main.java:20: error: not a statement
		cin >> a;
		    ^
Main.java:24: error: not a statement
		cout << -1;
		     ^
Main.java:26: error: not a statement
		cout << n - total;
		     ^
Main.java:11: error: unnamed classes are a preview feature and are disabled by default.
int main() {
^
  (use --enable-preview to enable unnamed classes)
Main.java:13: error: ';' expected
#ifdef LOCAL
            ^
Main.java:15: error: ';' expected
#endif
      ^
20 errors
Language: C

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

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


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

#include <iostream>
#include <string>
#include <cstring>
#include <fstream>
#include <random>
#include <cmath>
#include <iomanip>
#include <climits>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <map>
#include <deque>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <list>
#include <unordered_map>
#include <bitset>
#include <sstream>
#include <new>
#include <typeinfo>

typedef  long long ll;
#define mop 1000000007
#define mop2 998244353

using namespace std;

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

	
}

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>

#define M_PI       3.14159265358979323846   // pi

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> VI;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> t3;
typedef tuple<ll, ll, ll, ll> t4;

#define rep(a,n) for(ll a = 0;a < n;a++)
#define repi(a,b,n) for(ll a = b;a < n;a++)

static const ll INF = (ll)1e15;

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


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

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

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define MIN(a) *min_element(all(a))
#define MAX(a) *max_element(all(a))
#define SUM(a) accumulate(all(a), 0LL)
#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
#define RREP(i, n) for(int (i)=(n)-1; (i)>=0; (i)--)
#define FOR(i, m, n) for(int (i)=(m); (i)<(n); i++)
#define FORR(i, m, n) for(int (i)=(n)-1; (i)>=(m); i--)
#define debug(x) cerr << #x << " = " << x << endl
//#define int long long

typedef long long ll;
//ll const MOD = 998244353;
ll const MOD = 1e9+7;
int const inf = 1e9;
ll const INF = 1e18;

inline void ios_(){cin.tie(0); ios::sync_with_stdio(false);}
template<typename T> int size(const T& a){return (int)a.size();}
template<typename T> T Div(T a, T b){return (a + b - 1) / b;}
template<typename T> bool chmin(T& a, const T& b){if(a > b){a = b; return true;} return false;}
template<typename T> bool chmax(T& a, const T& b){if(a < b){a = b; return true;} return false;}



signed main(){
    int n, m;
    cin >> n >> m;
    REP(i, m){
        int a;
        cin >> a;
        n -= a;
    }
    cout << max(-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 ll long long
#define loop(n) for(ll i = 0; i<n; i++)
#define sort(a) sort(a.begin(), a.end())
using namespace std;

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

    ll n, m; cin>>n>>m;
    ll x, sum = 0;
    loop(m){
        cin>>x;
        sum += x;
    }
    if(x>n) return cout<<"-1\n", 0;
    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.
Language: C

#include <iostream>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
#include <queue>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <numeric>
#include <iomanip>

// output
#define SPBR(w, n) std::cout<<(w + 1 == n ? '\n' : ' ');
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
// utility
#define ALL(i) (i).begin(), (i).end()
#define FOR(i, a, n) for(int i=(a);i<(n);++i)
#define RFOR(i, a, n) for(int i=(n)-1;i>=(a);--i)
#define REP(i, n) for(int i=0;i<int(n);++i)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define IN(a, x, b) (a<=x && x<b)
#define OUT(a, x, b) (x<a || b<=x)
template<class T> inline T chmax(T & a, const T b) { return a = (a < b) ? b : a; }
template<class T> inline T chmin(T& a, const T b) { return a = (a > b) ? b : a; }

// type/const
#define int ll
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const int MOD = 1000000007;
/* const int MOD = 998244353; */
const int INF = 1e18;
const double PI = acos(-1);

using namespace std;
struct INIT { 
  INIT(){cin.tie(0); ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
}}INIT;


signed main() {
  int K, N; 
  cin >> K >> N;

  int sum = 0;
  vector<int> A(N);
  REP(i, N){
    cin >> A[i];
    sum += A[i];
  }

  cout << max(-1ll, K-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;
using ll = long long;
using P = pair<int, int>;

int main() {
    int n, m;
    cin >> n >> m;
    int a[m];
    ll 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;
}

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

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
#define equals(a, b) (fabs((a) - (b)) < EPS)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const ll mod = 1000000007;
//const ll mod = 998244353;
const int inf = 1e9 + 10;
const ll INF = 1e18;
const ld EPS = 1e-10;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }



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

  ll n, m;
  cin >> n >> m;
  vector<ll> a(m);
  rep(i, m) cin >> a[i];

  ll ans = n;
  rep(i, m) ans -= a[i];
  cout << (ans < 0 ? -1 : ans) << '\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>
#define pi acos(-1)
#define ll long long
#define pii pair<ll,ll>
#define debug(a) cout<<a<<'\n'
#define maxn 100009 /// Still trying to be normal
#define MOD 1000000007
#define F first
#define S second
#define rep(i, a, b) for(ll i = a; i < (b); ++i)
#define per(i, b, a) for(ll i = b-1; i>=a ; i--)
#define trav(a, x) for(auto& a : x)
#define allin(a , x) for(auto a : x)
#define all(x) begin(x), end(x)
#define sz(x) (ll)(x).size()
using namespace std;
const ll INF = 1e17 + 9;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n,m;
    cin>>n>>m;
    ll soma=0;
    rep(i,0,m){
        ll a;
        cin>>a;
        soma+=a;
    }
    if(soma>n)cout<<-1<<'\n';
    else cout<<n-soma<<'\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 <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <unordered_map>

using namespace std;
using ll = long long;

void _cin(){} template <class Head, class... Tail> void _cin(Head&& head, Tail&&... tail){ cin >> head; _cin(forward<Tail>(tail)...); }
void _cout(){ cout << "\n"; } template <class Head, class... Tail> void _cout(Head&& head, Tail&&... tail){ cout << head; _cout(forward<Tail>(tail)...); }
int gcd(int a, int b){ return (b == 0) ? a : gcd(b, a % b); }
template<typename S, typename T> ostream& operator<<(ostream &os, const pair<S, T> &p){ cout << "[" << p.first << ", " << p.second << "]"; return os; }

#define Sq(x) (x)*(x)
#define For(i, n) for(int i = 0; i < (n); i ++)
#define Rep(n) For(_, n)
#define Range(c) c.begin(), c.end()
#define RevRange(c) c.rbegin(), c.rend()
#define Contains(c, x) (find(Range(c), x) != c.end())
#define Search(rb, re, x) distance(rb, find(rb, re, x))
#define Sort(a) sort(Range(a))
#define DeSort(a) sort(RevRange(a))
#define Reverse(c) reverse(Range(c))
#define Unique(a) a.erase(unique(Range(a)), a.end())
#define Cusum(T, xs, sxs) vector<T> sxs(xs.size()+1); For(i, (int)xs.size()) sxs[i+1] = sxs[i] + xs[i]
#define Cin(T, ...) T __VA_ARGS__; _cin(__VA_ARGS__)
#define Cins(T, n, xs) vector<T> xs(n); For(i, n) cin >> xs[i]
#define Cins2(T, n, xs, ys) vector<T> xs(n), ys(n); For(i, n) cin >> xs[i] >> ys[i]
#define Cins3(T, n, xs, ys, zs) vector<T> xs(n), ys(n), zs(n); For(i, n) cin >> xs[i] >> ys[i] >> zs[i]
#define Cinss(T, n, m, xs) Vec2(T, n, m, xs); For(i, n) For(j, m) cin >> xs[i][j]
#define Cinm(T, n, map) unordered_map<T, int> map; Rep(n){ Cin(T, x); map[x] ++; }
#define Cout(...) _cout(__VA_ARGS__)
#define Couts(xs) { for(const auto &e : xs) cout << e << " "; cout << "\n"; }
#define Coutyn(cond) Cout((cond) ? "yes" : "no")
#define CoutYn(cond) Cout((cond) ? "Yes" : "No")
#define CoutYN(cond) Cout((cond) ? "YES" : "NO")
#define vc vector
#define Mini(a, x) a = min(a, x)
#define Maxi(a, x) a = max(a, x)

// constexpr int MOD = 1e9+7;

// B
int main(void){
    Cin(int, n, m);
    Cins(int, m, a);
    
    ll ans = n;
    For(i, m){
        ans -= a[i];
    }
    Cout(ans < 0 ? -1 : ans);
}


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 ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define debug(v) cout<<#v<<":";for(auto x:v){cout<<x<<' ';}cout<<endl;
#define INF 1000000000
#define mod 1000000007
using ll=long long;
const ll LINF=1001002003004005006ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
// ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(b<a){a=b;return true;}return false;}

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    
    ll n,m;cin>>n>>m;
    ll sum=0;
    rep(i,m){
        ll t;cin>>t;
        sum+=t;
    }
    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;
#define int long long 
#define f(i,x,n) for(int i=x;i<n;i++) 
#define all(c) c.begin(),c.end()
const int MOD = 1e9 + 7, N = 5e5 + 10;
const int LINF = LLONG_MAX;


int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,m;
    cin >> n >> m;
    vector<int>q(m);
    int s = 0;
    f(i,0,m){
        cin >> q[i];  
        s+= q[i];
    }
    if(s > n){
        cout << -1;
    }
    else
        cout << n-s;
    
    return 0;
}
 

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

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

using int32 = int_fast32_t;
using int64 = int_fast64_t;

const int32 INF = 1e9;
const int32 MOD = 1e9+7;
const int64 LLINF = 1e18;

#define YES(n) cout << ((n) ? "YES\n" : "NO\n"  )
#define Yes(n) cout << ((n) ? "Yes\n" : "No\n"  )
#define POSSIBLE cout << ((n) ? "POSSIBLE\n" : "IMPOSSIBLE\n"  )
#define ANS(n) cout << (n) << "\n"
#define REP(i,n) for(int64 i=0;i<(n);++i)
#define FOR(i,a,b) for(int64 i=(a);i<(b);i++)
#define FORR(i,a,b) for(int64 i=(a);i>=(b);i--)
#define ALL(obj) (obj).begin(),(obj).end()
#define pii pair<int32,int32>
#define pll pair<int64,int64>
#define pb(a) push_back(a)

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int32 n,m;
  cin >> n >> m;
  REP(i,m){
    int32 a;
    cin >> a;
    n -= a;
  }
  ANS(max<int32>(-1,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 <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <string>
#include <iomanip>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <complex>
#include <ctime>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef int itn;
const ll LINF = 1e18;
const int INF = 1e9;

//マクロ定義
#define vvint(vec,n,m,l) vector<vector<int>> vec(n, vector<int>(m,l));	// lで初期化
#define vvll(vec,n,m,l) vector<vector<ll>> vec(n,vector<ll>(m,l));
#define vint vector<int>
#define pint pair<int,int>
#define rep(i,a) for(int i=0;i<(a);i++)
#define all(x) (x).begin(),(x).end()
#define debug system("pause")				//デバッグ用
#define ret return 0

template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }

using Graph = vector<vector<ll>>;

#define ketasitei setprecision(15) //15桁表示

const ll MOD = 1000000007;

int main(void)

{
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << ketasitei;

	ll n;
	cin >> n;
	ll m;
	cin >> m;
	vector<ll> a(m);
	rep(i, m)
	{
		cin >> a[i];
		n -= a[i];
	}

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



	return 0;
}

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

/*input
314 15
9 26 5 35 8 9 79 3 23 8 46 2 6 43 3
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#pragma GCC optimize("unroll-loops,no-stack-protector")
//order_of_key #of elements less than x
// find_by_order kth element
typedef long long int ll;
#define ld long double
#define pii pair<ll,ll>
typedef tree<pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
#define f first
#define s second
#define pb push_back
#define REP(i,n) for(ll i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define FILL(n,x) memset(n,x,sizeof(n))
#define ALL(_a) _a.begin(),_a.end()
#define sz(x) (int)x.size()
const ll maxn=1500+5;
const ll maxlg=__lg(maxn)+2;
const ll INF64=4e18;
const int INF=0x3f3f3f3f;
const ll MOD=ll(1e9+7);
const ld PI=acos(-1);
const ld eps=1e-9;
#define lowb(x) x&(-x)
#define MNTO(x,y) x=min(x,(__typeof__(x))y)
#define MXTO(x,y) x=max(x,(__typeof__(x))y)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
ll mult(ll a,ll b){
    return (a*b)%MOD;
}
ll mypow(ll a,ll b){
    if(b<=0) return 1;
    ll res=1LL;
    while(b){
        if(b&1) res=mult(res,a);
        a=mult(a,a);
        b>>=1;
    }
    return res;
}
int main(){
    ios::sync_with_stdio(false),cin.tie(0);
    int n,m;
    cin>>n>>m;
    int sum=0;
    REP(i,m){
        int x;
        cin>>x;
        sum+=x;
    }
    if(sum>n){
        cout<<"-1";
    }
    else{
        cout<<n-sum;
    }
}


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

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

int main(){
	int n;
  	cin>>n;
  vector<int> arr(n);
  for(int i = 0; i < n; i++){
   int t;cin>>t;
    arr[t-1]++;
  }
  for(int i : arr) cout<<i<<"\n";

Compiler output:
a.cc: In function 'int main()':
a.cc:12:34: error: expected '}' at end of input
   12 |   for(int i : arr) cout<<i<<"\n";
      |                                  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include<iostream>
#include<array>
using namespace std;
int main(){
  int n,ans,count=0;
  cin>>n;
  int arr[n],count[n+1] ;
  for(int i=0;i<n+1;i++){
    count[i]=0;
  }
  for(int i=0;i<n-1;i++){
    cin>>arr[i];
    count[arr[i]]++;
  }
  for(int i=1;i<=n;i++){
    cout<<count[i]<<"\n";
  }
  return 0;
}
      
  

Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: error: conflicting declaration 'int count [(n + 1)]'
    7 |   int arr[n],count[n+1] ;
      |              ^~~~~
a.cc:5:13: note: previous declaration as 'int count'
    5 |   int n,ans,count=0;
      |             ^~~~~
a.cc:9:10: error: invalid types 'int[int]' for array subscript
    9 |     count[i]=0;
      |          ^
a.cc:13:10: error: invalid types 'int[int]' for array subscript
   13 |     count[arr[i]]++;
      |          ^
a.cc:16:16: error: invalid types 'int[int]' for array subscript
   16 |     cout<<count[i]<<"\n";
      |                ^
Language: C++

#include<iostream>
#include<array>
using namespace std;
int main(){
  int n,ans,count=0;
  cin>>n;
  int *arr;
  arr=new int[n];
  for(int i=0;i<arr.length()-1;i++){
    cin>>arr[i];
  }
  for(int j=1;j<=n;j++){
    for(int i=0;i<n;i++)
    {
      if(j==arr[i])
        count++;
    }
    ans=count;
    cout<<ans<<endl;
    count=0;
  }
  return 0;
}
      
  

Compiler output:
a.cc: In function 'int main()':
a.cc:9:21: error: request for member 'length' in 'arr', which is of non-class type 'int*'
    9 |   for(int i=0;i<arr.length()-1;i++){
      |                     ^~~~~~
Language: C++

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

int main()
{
int n;
  cin>>n;
  int arr[n];
  unordered_map<int,int>m;
  for(int i=1;i<=n-1;i++)
  {
     cin>>arr[i];
    m[arr[i]]++;
  }
//  sort(arr,arr+n);
  for(int i=1;i<=n;i++)
  {
    if(m[i])
    {
      cout<<m[i].second<<endl;
   }
    else
      cout<<0<<endl;
     
    
  }
 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:18: error: request for member 'second' in 'm.std::unordered_map<int, int>::operator[](i)', which is of non-class type 'std::unordered_map<int, int>::mapped_type' {aka 'int'}
   20 |       cout<<m[i].second<<endl;
      |                  ^~~~~~
Language: C++

int main(){
int n,b;
vector<int>a(n);
rep(i,n){
  cin>>b;
  a(i)=0;
  a(b)=1;
}
rep(i,n){
  cout<<a[i]<<endl;

}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:1: error: 'vector' was not declared in this scope
    3 | vector<int>a(n);
      | ^~~~~~
a.cc:3:8: error: expected primary-expression before 'int'
    3 | vector<int>a(n);
      |        ^~~
a.cc:4:5: error: 'i' was not declared in this scope
    4 | rep(i,n){
      |     ^
a.cc:4:1: error: 'rep' was not declared in this scope
    4 | rep(i,n){
      | ^~~
Language: C++

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

int main() {
  int a;
  int K;
  cin >> a;
  vector<int> v(a+1);
  int tmp;
  for (int i = 0; i < a; i++){
    cin >> tmp;
    K=v.at(tmp)+1;
    v.at(3)=K; 
  }
   for (int i = 0; i < a+1; i++){
    cout << v.at(i); << endl;
   }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:22: error: expected primary-expression before '<<' token
   16 |     cout << v.at(i); << endl;
      |                      ^~
Language: C

#include <stdio.h>

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

Compiler output:
main.c: In function 'main':
main.c:6:12: error: variable-sized object may not be initialized except with an empty initializer
    6 |   int a[n]={0};
      |            ^
Language: C

#include <stdio.h>

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

Compiler output:
main.c: In function 'main':
main.c:6:12: error: variable-sized object may not be initialized except with an empty initializer
    6 |   int a[n]={0);
      |            ^
main.c:6:14: error: expected '}' before ')' token
    6 |   int a[n]={0);
      |            ~ ^
main.c:6:14: error: expected ',' or ';' before ')' token
Language: C

#include<stdio.h>
int main(){
  int n,i;
  scanf("%d",&n);
  int a[n+1],ans[n+1]={};
  for(i=2;i<n+1;i++){
    scanf("%d",&a[i]);
    ans[a[i]]++
  }
  for(i=1:i<n+1;i++)printf("%d\n",ans[i]);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:16: error: expected ';' before '}' token
    8 |     ans[a[i]]++
      |                ^
      |                ;
    9 |   }
      |   ~             
main.c:10:10: error: expected ';' before ':' token
   10 |   for(i=1:i<n+1;i++)printf("%d\n",ans[i]);
      |          ^
      |          ;
main.c:10:20: error: expected ';' before ')' token
   10 |   for(i=1:i<n+1;i++)printf("%d\n",ans[i]);
      |                    ^
      |                    ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main()
{
	int n;
	cin>>n;
	vector<int>a[n+1];
	for(int i=2;i<=n;i++)
	{
		cin>>x;
		a[x].push_back(i);
	}
	for(int i=1;i<=n;i++)
		cout<<a[i].size()<<endl;
	return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main()
{
  int n;
  cin >> n;
  int A[n + 1];
  A[0] = 0;
  vi B(200008,0);
  for (int i = 1; i <= n; i++)
  {
    cin >> A[i];
    B[A[i]]++;
  }
  for (int i = 1; i <= n; i++)
  {
    cout << B[i] << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'vi' was not declared in this scope
   10 |   vi B(200008,0);
      |   ^~
a.cc:14:5: error: 'B' was not declared in this scope
   14 |     B[A[i]]++;
      |     ^
a.cc:18:13: error: 'B' was not declared in this scope
   18 |     cout << B[i] << endl;
      |             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main()
{
  int n;
  cin >> n;
  int A[n + 1];
  A[0] = 0;
  vi B(n + 1, 0);
  for (int i = 1; i <= n; i++)
  {
    cin >> A[i];
    B[A[i]]++;
  }
  for (int i = 1; i <= n; i++)
  {
    cout << B[i] << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'vi' was not declared in this scope
   10 |   vi B(n + 1, 0);
      |   ^~
a.cc:14:5: error: 'B' was not declared in this scope
   14 |     B[A[i]]++;
      |     ^
a.cc:18:13: error: 'B' was not declared in this scope
   18 |     cout << B[i] << endl;
      |             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vint;

int a[2e5+1];
int ans[2e5+1];
int main(){
	int n; cin >> n;
	for(int i=2;i<=n;i++) {
		cin >> a[i];
		ans[a[i]]++;
	}
	for(int i=2;i<=2;i++) cout << a[i] << endl;
}

Compiler output:
a.cc:5:10: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    5 | int a[2e5+1];
      |       ~~~^~
a.cc:5:10: error: could not convert '(2.0e+5 + (double)1)' from 'double' to 'long unsigned int'
    5 | int a[2e5+1];
      |       ~~~^~
      |          |
      |          double
a.cc:5:10: error: size of array 'a' has non-integral type 'double'
a.cc:6:12: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    6 | int ans[2e5+1];
      |         ~~~^~
a.cc:6:12: error: could not convert '(2.0e+5 + (double)1)' from 'double' to 'long unsigned int'
    6 | int ans[2e5+1];
      |         ~~~^~
      |            |
      |            double
a.cc:6:12: error: size of array 'ans' has non-integral type 'double'
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vint;

int main(){
	int n; cin >> n;
	vint a(n);
	vin ans(n,0);
	for(int i=2;i<=n;i++) {
		cin >> a[i];
		ans[a[i]]++;
	}
	for(int i=2;i<=2;i++) cout << a[i] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'vin' was not declared in this scope; did you mean 'vint'?
    8 |         vin ans(n,0);
      |         ^~~
      |         vint
a.cc:11:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |                 ans[a[i]]++;
      |                 ^~~
      |                 abs
Language: C

#include<stdio.h>
 
int main(void){
  int n,i;
  int a[200000]={0};
  int j[200000]={0};
  
  do{
    scanf("%d",&n);
  }while(n<2 || n>200000);
  
  for(i=0; i<n-1; i++){
    do{
      scanf("%d",&a[i]);
    }while(a[i]<1 || a[i]>i+1);
  }
  
  for(i=0; i<n-1; i++){
    j[a[i]]++;
  }
  
  for(i=0; i<n; i++){
    printf("%d\n",cnt);
  }
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:23:19: error: 'cnt' undeclared (first use in this function); did you mean 'int'?
   23 |     printf("%d\n",cnt);
      |                   ^~~
      |                   int
main.c:23:19: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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


Compiler output:
main.c: In function 'main':
main.c:5:14: error: variable-sized object may not be initialized except with an empty initializer
    5 |     int a[n]={0};
      |              ^
Language: C

#include<stdio.h>
 
int main(void){
  int N;
  scanf("%d",&N);
  int A[200000]={0};
  int c[200000]={0};
  for(int i=1;i<N;i++){
    scanf("%d",&A[i]);
    c[A[i]]++;
  }
  for(int i=1;j<=N;j++){
    printf("%d",c[i]);
  }
  return 0;
}

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

#include<stdio.h>

int main(void){
  int N;
  scanf("%d",&N);
  int A[N];
  int c[N];
  for(int i=2;i<=N;i++){
    scanf("%d",&A[i]);
    c[A[i]]++;
  }
  for(int j=1;j<=N;j++){
    printf("%d",c[j])
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:22: error: expected ';' before '}' token
   13 |     printf("%d",c[j])
      |                      ^
      |                      ;
   14 |   }
      |   ~
Language: C

#include <stdio.h>
int main(void){
  int n,i,a;
  scanf("%d",&n); //社員の数
  int s[n]={0};
  for(i=0;i<n;i++){
    scanf("%d",&a); //上司の番号
    s[a-1]+=1;
  }
  for(i=0;i<n;i++){
    printf("%d\n",s[n]);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:12: error: variable-sized object may not be initialized except with an empty initializer
    5 |   int s[n]={0};
      |            ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:7:14: error: variable-sized object may not be initialized except with an empty initializer
    7 |   int s[n] = {0};
      |              ^