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

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

int main(){
  int n,m;
  std::cin>>n,m;
  std::vector<std::vector<int>> data(m,std::vector<int>(2));
  for(int i = 0; i < m; i++){
    std::cin>>data[i][0]>>data[i][1];
  }

  std::vector<std::vector<bool>> gra(n+1,std::vector<bool>(n+1));

  std::vector<long long> ans(m);
  ans[m-1] = n(n-1)/2;
  for(int j = m-1; j > 0; j--){
    ans[j-1] = ans[j];
    temp1 = data[j][0];
    temp2 = data[j][1];
    if(gra[temp1][temp2] != 1){
      ans[j-1] --;
      gra[temp1][temp2] = 1;
      for(int i = 1; i < temp1; i++){
        if(gra[i][temp1] == 1){
          if(gra[i][temp2] != 1){
            ans[j-1] --;
            gra[i][temp2] = 1;
          }
        }
      }
      for(int i = temp1+1; i <= n; i++){
        if(gra[temp1][i] == 1){
          if(gra[std::min(i,temp2)][std::max(i,temp2)] != 1){
            ans[j-1] --;
            gra[std::min(i,temp2)][std::max(i,temp2)] = 1;
          }
        }
      }
      for(int i = 1; i < temp2; i++){
        if(gra[i][temp2] == 1){
          if(gra[std::min(i,temp1)][std::max(i,temp1)] != 1){
            ans[j-1] --;
            gra[std::min(i,temp1)][std::max(i,temp1)] = 1;
          }
        }
      }
      for(int i = temp2+1; i <= n; i++){
        if(gra[temp2][i] == 1){
          if(gra[temp1][i] != 1){
            ans[j-1] --;
            gra[temp1][i] = 1;
          }
        }
      }
    }
  }

  for(int i = 0; i < m; i++){
    std::cout<<ans[i]<<std::endl;
    
  }
  return 0;
  




  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:15: error: 'n' cannot be used as a function
   16 |   ans[m-1] = n(n-1)/2;
      |              ~^~~~~
a.cc:19:5: error: 'temp1' was not declared in this scope
   19 |     temp1 = data[j][0];
      |     ^~~~~
a.cc:20:5: error: 'temp2' was not declared in this scope
   20 |     temp2 = data[j][1];
      |     ^~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <queue>
#include <random>
#include <cstdint>
#include <bitset>
#include <iomanip>
#include <utility>
#include<map>
#include<functional>
#include<climits>
using namespace std;
typedef long long ll;
const int mod = 1000000007;

ll n, m, a[100000], b[100000], siz[100000];

ll par[100000], ran[100000];
void init(int p);
ll find(int x);
void unit(int x, int y);
bool same(int x, int y);
ll fsize(int x);


int main() {
	ll ans[100000];
	cin >> n >> m;
	fill(siz, siz + n, 1);
	for (int i = 0; i < m; i++) {
		cin >> a[i] >> b[i];
		a[i]--;
		b[i]--;
	}
	ans[m - 1] = n * (n - 1) / 2;
	init(n);
	for (int i = m - 2; i >= 0; i--) {
		if (same(a[i+1], b[i+1])) {
			ans[i] = ans[i + 1];
		}
		else {
			ans[i] = ans[i + 1] - (fsize(a[i+1])*fsize(b[i+1]));
		}
		unit(a[i+1], b[i+1]);
	}
	for (int i = 0; i < m; i++) cout << ans[i] << endl;
}

void init(ll p) {
	for (int i = 0; i < p; i++) {
		par[i] = i;
		ran[i] = 0;
	}
}
ll find(ll x) {
	if (par[x] == x) return x;
	else {
		par[x] = find(par[x]);
		return par[x];
	}
}

void unit(ll x, ll y) {
	x = find(x);
	y = find(y);
	if (x == y)return;
	if (ran[x] < ran[y]) {
		siz[find(y)] += siz[find(x)];
		par[x] = y;
	}
	else {
		siz[find(x)] += siz[find(y)];
		par[y] = x;
	}
	if (ran[x] == ran[y])ran[x]++;
}
bool same(ll x, ll y) { return find(x) == find(y);}

ll fsize(ll x) {
	if (par[x] == x) return siz[x];
	else {
		siz[x] = fsize(par[x]);
		return siz[x];
	}
}

Compiler output:
/usr/bin/ld: /tmp/ccvEU27E.o: in function `main':
a.cc:(.text+0x192): undefined reference to `init(int)'
/usr/bin/ld: a.cc:(.text+0x1e5): undefined reference to `same(int, int)'
/usr/bin/ld: a.cc:(.text+0x23a): undefined reference to `fsize(int)'
/usr/bin/ld: a.cc:(.text+0x25f): undefined reference to `fsize(int)'
/usr/bin/ld: a.cc:(.text+0x2b7): undefined reference to `unit(int, int)'
collect2: error: ld returned 1 exit status
Language: C++

#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <functional>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <cassert>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repd(i, n) for (int i = n; i >= 0; i--)
#define mod 1000000007
#define MOD 998244353
#define inf 1e20
typedef long long int ll;
typedef pair<ll, ll> p;

int main() {
	int n, m;
	cin >> n >> m;
	vector<p> bri(m);
	rep(i, m) {
		cin >> bri[i].first >> bri[i].second;
	}
	vector<ll> ans(m);
	ans[m - 1] = n * (n - 1) / 2;
	vector<ll> isl(n+1);
	fill(isl.begin(), isl.end(), 1);
	repd(i, m-2) {
		if (ans[i + 1] == 0) {
			ans[i] = 0;
		}
		else {
			ans[i] = ans[i + 1] - isl[bri[i + 1].first] * isl[bri[i + 1].second];
			vector<bool> cnt(n+1);
			cnt[bri[i + 1].first] = true;
			cnt[bri[i + 1].second] = true;
			rep(j, m-i-1) {
				int k = j + i+1;
				if (bri[k].first == bri[i + 1].first || bri[k].first == bri[i + 1].second || bri[k].second == bri[i + 1].first || bri[k].second == bri[i + 1].second) {
					cnt[bri[k].first] = true;
					cnt[bri[k].second] = true;
				}
			}
			int sum = isl[bri[i + 1].first] + isl[bri[i + 1].second];
			cout << sum;
			rep(j, n+1) {
				if (cnt[j]) {
					isl[j] = sum;
				}
			}
		}
	}
	rep(i, m){
		cout << ans[i] << endl;
	}
	return 0;
}

//Ctrl+Aを使わない

Compiler output:
a.cc: In function 'int main()':
a.cc:22:9: error: 'cin' was not declared in this scope
   22 |         cin >> n >> m;
      |         ^~~
a.cc:11:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
   10 | #include <cassert>
  +++ |+#include <iostream>
   11 | using namespace std;
a.cc:48:25: error: 'cout' was not declared in this scope
   48 |                         cout << sum;
      |                         ^~~~
a.cc:48:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:57:17: error: 'cout' was not declared in this scope
   57 |                 cout << ans[i] << endl;
      |                 ^~~~
a.cc:57:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:57:35: error: 'endl' was not declared in this scope
   57 |                 cout << ans[i] << endl;
      |                                   ^~~~
a.cc:11:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
   10 | #include <cassert>
  +++ |+#include <ostream>
   11 | using namespace std;
Language: C++

#include <iostream>
#include <string>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <bitset>
#define ll long long int
using namespace std;

ll N,M; 
 int flag[1000090]; // 頂点に到達したかどうか
int edge[100009][100009] ; // 辺の情報
int a[100009];
int b[100009];
set <int> ga;
set <int> gb;



// 深さ優先探索
void dfs(int vertex,int ab){
    int i;
    
    // 既に到達済みの場合
    if(flag[vertex]) return;
    
    // 到達済みとして保存
    flag[vertex] = 1;
    if(ab==0) ga.insert(vertex);
    else gb.insert(vertex);
    
    // 頂点 vertex と辺がある頂点へ訪問
    for(i = 0; i <= N; ++i){
        if(edge[vertex][i]){ // 頂点 vertex から i へ辺がある
            dfs(i,ab); // 頂点 i へ移動
        }
    }
}



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

for(int i=0;i<N;i++){
  for(int j=0;j<N;j++){
    edge[i][j] = 0;
  }
}
 

for(int i=0;i<M;i++){
  cin>>a[i]>>b[i];
  edge[a[i]][b[i]] = 1;
  edge[b[i]][a[i]] = 1;
}

ll ans =0;

for(int i=0;i<M;i++){

   // 初期化
    for(int j = 0; j <= N; ++j){
        flag[j] = 0;
    }

    
ga.clear();
    gb.clear();


    dfs(a[i],0);
    dfs(b[i],1);

    if(ga != gb){
     // cout<<1<<endl;
      ans += ga.size() * gb.size();
    }

    
    
    cout<<ans<<endl;


}

return 0;

}
 

Compiler output:
/tmp/ccaUTbAp.o: in function `dfs(int, int)':
a.cc:(.text+0x58): relocation truncated to fit: R_X86_64_PC32 against symbol `ga' defined in .bss section in /tmp/ccaUTbAp.o
a.cc:(.text+0x70): relocation truncated to fit: R_X86_64_PC32 against symbol `gb' defined in .bss section in /tmp/ccaUTbAp.o
/tmp/ccaUTbAp.o: in function `main':
a.cc:(.text+0x196): relocation truncated to fit: R_X86_64_PC32 against symbol `a' defined in .bss section in /tmp/ccaUTbAp.o
a.cc:(.text+0x1c2): relocation truncated to fit: R_X86_64_PC32 against symbol `b' defined in .bss section in /tmp/ccaUTbAp.o
a.cc:(.text+0x1e4): relocation truncated to fit: R_X86_64_PC32 against symbol `a' defined in .bss section in /tmp/ccaUTbAp.o
a.cc:(.text+0x1fb): relocation truncated to fit: R_X86_64_PC32 against symbol `b' defined in .bss section in /tmp/ccaUTbAp.o
a.cc:(.text+0x237): relocation truncated to fit: R_X86_64_PC32 against symbol `b' defined in .bss section in /tmp/ccaUTbAp.o
a.cc:(.text+0x24e): relocation truncated to fit: R_X86_64_PC32 against symbol `a' defined in .bss section in /tmp/ccaUTbAp.o
a.cc:(.text+0x2e5): relocation truncated to fit: R_X86_64_PC32 against symbol `ga' defined in .bss section in /tmp/ccaUTbAp.o
a.cc:(.text+0x2f4): relocation truncated to fit: R_X86_64_PC32 against symbol `gb' defined in .bss section in /tmp/ccaUTbAp.o
a.cc:(.text+0x310): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

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

struct UnionFindTree {
    vector<int> par;
    vector<int> rank;
    vector<int> siz;

    void init(int n) {
        par.resize(n);
        rank.resize(n);
        siz.resize(n);
        for (int i = 0; i < n; i++) {
            par[i] = i;
            rank[i] = 0;
            siz[i] = 1;
        }
    }
    int find(int x) {
        if (par[x] == x) {
            return x;
        } else {
            return par[x] = find(par[x]);
        }
    }
    void unite(int x, int y) {
        x = find(x);
        y = find(y);
        if (x == y) return;
        if (rank[x] < rank[y]) swap(x, y);
        if (rank[x] == rank[y]) rank[x]++;
        par[y] = x;
        siz[x] += siz[y];
    }
    bool is_same(int x, int y) {
        return find(x) == find(y);
    }
    int size(int x) {
        x = find(x);
        return siz[x];
    }
};

int main() {
    ll n, m;
    cin >> n >> m;
    vector<P> es;
    for(int i=0; i<m; i++){
        int a, b;
        cin >> a >> b;
        a--; b--;
        es.push_back({a,b});
    }
    UnionFindTree g;
    g.init(n);
    vector<ll> ans(m);
    ll cnt = n*(n-1)/2;
    for(int i=m-1; i>=0; i--){
        ans[i] = cnt;
        int a = es[i].first, b = es[i].second;
        if(g.is_same(a,b)) continue;
        cnt -= ll(g.size(a)) * ll(g.size(b));
        g.unite(a,b);
    }
    REP(i,m){
        cout << ans[i] << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:67:9: error: 'i' was not declared in this scope
   67 |     REP(i,m){
      |         ^
a.cc:67:5: error: 'REP' was not declared in this scope
   67 |     REP(i,m){
      |     ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll par[100001];
ll ranka[100001];
void init(ll n)
{
    for(ll i = 0; i < n; i++)
    {
        par[i] = i;
        ranka[i] = 0;
    }
}

ll find(ll x)
{
    if(par[x] == x)
    {
        return x;
    }
    else {
        return par[x] = find(par[x]);
    }
}
void unite(ll x, ll y)
{
    x = find(x);
    y = find(y);
    if (x == y) return;
    if (ranka[x] < ranka[y])
    {
        par[x] = y;
    } else{
        par[y] = x;
        if(ranka[x] == ranka[y]) ranka[x]++;
    }
}
bool same(ll x, ll y)
{
    return find(x) == find(y);
}
ll main()
{
    ll n, m;
    cin >> n >> m;
    struct edge { ll from; ll to;};
    vector<edge> d(m);
    for(ll i = 0; i < m; i++)
    {
        ll a, b;
        cin >> d[i].from >> d[i].to;
    }


    vector<ll> ans;
    ll count = n * (n-1) / 2;
    ans.push_back(count);

    init(n);
    vector<ll> cd(n+1);
    for(ll i = 0; i < n+1; i++)
    {
        cd[i] = 1;
    }
    for(ll i = m -1; i >= 0; i--)
    {
        edge e = d[i];
        ll x = e.from;
        ll y = e.to;
        if(!same(x, y))
        {
            ll px = cd[par[x]];
            ll py = cd[par[y]];
            unite(x, y);
            cd[par[x]] = px + py;

            count = count - (px+py)*(px+py-1) / 2 + px * (px-1) / 2 + py * (py-1) / 2;
        }

        ans.push_back(count);
    }
    for(ll i = m-1; i >=0; i--)
    {
        cout << ans[i] << endl;
    }
}



Compiler output:
a.cc:42:1: error: '::main' must return 'int'
   42 | ll main()
      | ^~
Language: C++

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

int main(){
  int N,M,ans;
  cin >> N >> M;
  long int A[100000000],B[];
  long int C[M+1];
  C[M]=M*(M-1)/2;
  for(int i=1; i<=M; ++i){
    cin>>A[i]>>B[i];
  }
  for(int i=M; i>1; --i){
    C[i-1]=max(0,C[M]-i);
  }
  for(int i=1; i<=M; ++i) cout<<C[i]<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:25: error: storage size of 'B' isn't known
   10 |   long int A[100000000],B[];
      |                         ^
a.cc:17:15: error: no matching function for call to 'max(int, long int)'
   17 |     C[i-1]=max(0,C[M]-i);
      |            ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 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:17:15: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long int')
   17 |     C[i-1]=max(0,C[M]-i);
      |            ~~~^~~~~~~~~~
/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,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:3:
/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:17:15: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   17 |     C[i-1]=max(0,C[M]-i);
      |            ~~~^~~~~~~~~~
Language: C++

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

typedef long long int LL;
#define REP(n) for(LL i = 0; i < (n); i++)
#define COUT(val) cout << (val) << endl
#define CIN(val) cin >> (val)
#define SORT(vec) sort(vec.begin(), vec.end())
#define SORT_GRE(vec) sort(vec.begin(), vec.end(), greater<LL>())

LL C(int n){
    int a = 1, b = 2;
    for(int i = 0; i < 2;) a *= n - i;
    return a / b;
}

int main(){
    int n, m;
    cin >> n >> m;
    LL ans;
    vector<pair<int, int>> v(m);
    for(int i = 0; i < m; i++){
        cin >> v[i].first >> v[i].second;
    }
    for(int i = 0; i < m; i++){
        //unionfindで木に分けて (木の本数)C(2)で組み合わせを出せばそれが不便さになる．    
        //unionfindわからん...
        cout << C(木の本数) << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:19: error: '\U00006728\U0000306e\U0000672c\U00006570' was not declared in this scope
   28 |         cout << C(木の本数) << endl;
      |                   ^~~~~~~~
Language: C++

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

const int MAX_V=101010;

int par[MAX_V]; //　親
int rnk[MAX_V]; // rank, 木の深さ
int num[MAX_V];

// V要素で初期化
void init(){
  for(int i=0;i<MAX_V;i++){
    par[i]=i;
    rnk[i]=0;
    num[i]=1;
  }
}

// 木の根を求める
int find(int x){
  if (par[x] == x){
    return x;
  }else{
    return par[x] = find(par[x]);
  }
}

// ｘとｙの属する集合を併合
void unite(int x, int y){
  x = find(x);
  y = find(y);
  if (x == y) return;

  if (rnk[x] < rnk[y]){
    par[x] = y;
    num[y]+=num[x];
  }else{
    par[y] = x;
    num[x]+=num[y];
    if (rnk[x] == rnk[y]) rnk[x]++;
  }
}

// ｘとｙが同じ集合に属するかどうか
bool same(int x, int y){
  return find(x) == find(y);
}

ll ans[101010];

int main(){
  init();
  int N,M; cin>>N>>M;
  vector<pair<int,int>> E(M);
  rep(i,M) cin>>E[i].first>>E[i].second;
  
  ll sum=N*(N-1)/2;
  for(int i=M-1;i>=0;i--){
    ans[i]=max(sum,0LL);
    if(!same(E[i].first,E[i].second){
      sum-=1LL*num[find(E[i].first)]*num[find(E[i].second)];
      unite(E[i].first,E[i].second);
    }
  }
  rep(i,M) cout<<ans[i]<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:63:37: error: expected ')' before '{' token
   63 |     if(!same(E[i].first,E[i].second){
      |       ~                             ^
      |                                     )
a.cc:67:3: error: expected primary-expression before '}' token
   67 |   }
      |   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vl;
#define rep(i, n) for(ll i = 0;i < n;i++)
#define all(i) i.begin(), i.end()
template<class T, class U> void cmax(T& a, U b) { if (a<b) a = b; }
template<class T, class U> void cmin(T& a, U b) { if (a>b) a = b; }

class UnionFind {
  private:
    vector<int> parent;
    vector<int> rank;

  public:
    UnionFind(int size) : parent(size), rank(size, 0) {
      for (int i = 0; i < size; i++) {
        parent[i] = i;
      }
    }

    int find(int x) {
      if (parent[x] == x) {
        return x;
      } else {
        return parent[x] = find(parent[x]);
      }
    }

    void unite(int x, int y) {
      x = find(x);
      y = find(y);
      if (x == y) return;

      if (rank[x] < rank[y]) {
        parent[x] = y;
      } else {
        parent[y] = x;
        if (rank[x] == rank[y]) rank[x]++;
      }
    }

    bool same(int x, int y) {
      return find(x) == find(y);
    }
};

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

  int n, m;
  cin >> n >> m;
  vector<pii> l(m);
  rep(i, m) {
    cin >> l[i].first >> l[i].second;
  }

  vector<ll> ans(m);
  ll cnt = n * (n-1) / 2;
  ans[0] = cnt;

  UnionFind uf(n);
  vector<ll> size(n, 1);
  rep(i, m-1) {
    ll ll = l[m-i-1].first-1;
    ll rr = l[m-i-1].second-1;

    ll lls = size[uf.find(ll)];
    ll rrs = size[uf.find(rr)];

    bool flag = uf.same(ll, rr);

    if (!flag) {
      uf.unite(ll, rr);
      size[uf.find(ll)] = lls + rrs; 
      ans[i+1] = max(0, cnt - lls*rrs);
      cnt = max(0, cnt - lls*rrs);
    } else {
      ans[i+1] = cnt;
    }
  }

  rep(i, m) {
    cout << ans[m-i-1] << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:68:7: error: expected ';' before 'rr'
   68 |     ll rr = l[m-i-1].second-1;
      |       ^~~
      |       ;
a.cc:70:7: error: expected ';' before 'lls'
   70 |     ll lls = size[uf.find(ll)];
      |       ^~~~
      |       ;
a.cc:71:7: error: expected ';' before 'rrs'
   71 |     ll rrs = size[uf.find(rr)];
      |       ^~~~
      |       ;
a.cc:73:29: error: 'rr' was not declared in this scope
   73 |     bool flag = uf.same(ll, rr);
      |                             ^~
a.cc:77:27: error: 'lls' was not declared in this scope; did you mean 'll'?
   77 |       size[uf.find(ll)] = lls + rrs;
      |                           ^~~
      |                           ll
a.cc:77:33: error: 'rrs' was not declared in this scope
   77 |       size[uf.find(ll)] = lls + rrs;
      |                                 ^~~
Language: C++


  }

  vector<ll> out;
  ll ans = n*(n-1)/2;
  for (int i = sz(v)-1; i >= 0; i--) {
    out.pb(ans);
    ans -= unite(v[i].fi, v[i].se);
    //print();
  }

  for(int i = sz(out)-1; i>=0; i--) cout << out[i] << endl;
  return 0;
}


Compiler output:
a.cc:2:3: error: expected declaration before '}' token
    2 |   }
      |   ^
a.cc:4:3: error: 'vector' does not name a type
    4 |   vector<ll> out;
      |   ^~~~~~
a.cc:5:3: error: 'll' does not name a type
    5 |   ll ans = n*(n-1)/2;
      |   ^~
a.cc:6:3: error: expected unqualified-id before 'for'
    6 |   for (int i = sz(v)-1; i >= 0; i--) {
      |   ^~~
a.cc:6:25: error: 'i' does not name a type
    6 |   for (int i = sz(v)-1; i >= 0; i--) {
      |                         ^
a.cc:6:33: error: 'i' does not name a type
    6 |   for (int i = sz(v)-1; i >= 0; i--) {
      |                                 ^
a.cc:12:3: error: expected unqualified-id before 'for'
   12 |   for(int i = sz(out)-1; i>=0; i--) cout << out[i] << endl;
      |   ^~~
a.cc:12:26: error: 'i' does not name a type
   12 |   for(int i = sz(out)-1; i>=0; i--) cout << out[i] << endl;
      |                          ^
a.cc:12:32: error: 'i' does not name a type
   12 |   for(int i = sz(out)-1; i>=0; i--) cout << out[i] << endl;
      |                                ^
a.cc:13:3: error: expected unqualified-id before 'return'
   13 |   return 0;
      |   ^~~~~~
a.cc:14:1: error: expected declaration before '}' token
   14 | }
      | ^
Language: C++

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

#ifdef LOCAL
    #define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
        #define eprintf(...) 42
#endif

#define int long long

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define all(x) (x).begin(),(x).end()
#define foreach(u,v) for(auto (u) : (v))
#define pb push_back
#define mp make_pair
#define mt make_tuple

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<ll, ll> pll;
typedef vector<ll> vl;

const int inf = 1e9;
const ll linf = 1LL<<60;
const ll mod = 1e9 + 7;
const double eps = 1e-9;

/*
*/

int par[100000], rnk[100000], siz[100000];

void init(int n)
{
  for(int i = 0; i < n; i++){
    par[i] = i;
    rnk[i] = 0;
    siz[i] = 1;
  }
}

int find(int x)
{
  if(par[x] == x) return x;
  return par[x] = find(par[x]);
}

void unite(int x, int y)
{
  x = find(x);
  y = find(y);
  if(x == y) return;

  if(rnk[x] < rnk[y]){
    par[x] = y;
    siz[y] += siz[x];
  }else{
    par[y] = x; 
    siz[x] += siz[y];
    if(rnk[x] == rnk[y]) rnk[x]++;
  }
}

bool same(int x, int y)
{
  return find(x) == find(y);
}

int ufsize(int x)
{
  return siz[find(x)];
}

int main()
{
  int n, m;
  cin >> n >> m;

  vi a(m), b(m);
  rep(i, m){
    cin >> a[i] >> b[i];
  }

  reverse(all(a));
  reverse(all(b));

  init(n);
  vl ans;
  ll cnt = n*(n-1)/2;
  ans.pb(cnt);
  rep(i, m-1){
    if(!same(a[i], b[i])){
      cnt -= ufsize(a[i])*ufsize(b[i]);
      unite(a[i], b[i]);
    }
    ans.pb(cnt);
  }

  reverse(all(ans));

  rep(i, m){
    cout << ans[i] << endl;
  }

  return 0;
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

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


#define int ll

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout<<setprecision(std::numeric_limits<float>::max_digits10);
  cout<<fixed;
  ll n,m;
  cin>>n>>m;
  vector<vector<int>> st(n);
  vector<int> as(m);
  vector<int> bs(m);
  rep(i,m)cin>>as[i]>>bs[i];
  rep(i,m) {
    as[i]--;
    bs[i]--;
  }
  vector<int> par(n);
  rep(i,n) {
    st[i].push_back(i);
    par[i]=i;
  }
  vector<ll> a_ans(m+1);
  a_ans[m]=0;
  revrep(i,m) {
    int a,b;
    a=as[i];
    b=bs[i];
    if(par[a]==par[b]) {
      a_ans[i]=a_ans[i+1];
    } else {
      if(st[par[a]].size()>st[par[b]].size()) {
        swap(a,b);
      }
      // st[par[a]].size()<=st[par[b]].size()
      ll sa=st[par[a]].size();
      ll sb=st[par[b]].size();
      a_ans[i]=a_ans[i+1]-sa*(sa-1)/2-sb*(sb-1)/2+(sa+sb)*(sa+sb-1)/2;
      int pa=par[a];
      for(auto& e : st[pa]) {
        par[e]=b;
        st[par[b]].push_back(e);
      }
      st[pa].clear();
    }
  }
  rep(i,m) {
    //cout << "a_ans="<<a_ans[i+1] <<endl;
    cout << n*(n-1)/2-a_ans[i+1]<<endl;
  }
  return 0;
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include<iostream>
#include<vector>
using namespace std;
using lli = long long int;
using pii = pair<lli, lli>;

lli getPar(vector<vector<lli> > &G, vector<lli> &parent, lli v){
  if(parent[v] == v)return v;
  else return getPar(G, parent, parent[v]);
}

int main(){
  lli n, m, x, y;
  std::cin >> n >> m;
  vector<vector<lli> > G(n);
  vector<pii> edge;
  for (int i = 0; i < m; i++) {
    std::cin >> x >> y;
    edge.push_back(pii(--x, --y));
    // std::cout << "x:" << x << " y:"<< y << std::endl;
  }
  vector<lli> ans, size(n, 1), parent(n);
  lli val = n*(n - 1)/2;
  for (int i = 0; i < n; i++) parent[i] = i;
  for (int i = edge.size() - 1; i >= 0; i--) {
    ans.push_back(max(val, 0));
    val -= size[getPar(G, parent, edge[i].first)]*
      size[getPar(G, parent, edge[i].second)];
    size[edge[i].first] += size[edge[i].second];
    size[edge[i].second] = size[edge[i].first];
    parent[edge[i].second] = parent[edge[i].first];
    // for (int j = 0; j < n; j++) {
    //   std::cout << size[j] << " ";
    // }
    // std::cout << std::endl;
    // std::cout << std::endl;
  }
  for (int i = ans.size() - 1; i >= 0; i--) {
    std::cout << ans[i] << std::endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:22: error: no matching function for call to 'max(lli&, int)'
   26 |     ans.push_back(max(val, 0));
      |                   ~~~^~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 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:26:22: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   26 |     ans.push_back(max(val, 0));
      |                   ~~~^~~~~~~~
/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
Language: C++

#include<iostream>
using namespace std;
int main void
{
  string s;
  cin>>s;
  if(s[5]==0&&s[6]<='4'){cout<<"Heisei"<<endl;}
  else{cout<<"TBD"<<endl;}

}

Compiler output:
a.cc:3:10: error: expected initializer before 'void'
    3 | int main void
      |          ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long 
int main() { 
  string s;
  cin>>s;
  cout<<(s<="2019/04/30"? "Heisei":"TBD")
  
  return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:7:42: error: expected ';' before 'return'
    7 |   cout<<(s<="2019/04/30"? "Heisei":"TBD")
      |                                          ^
      |                                          ;
    8 | 
    9 |   return 0;
      |   ~~~~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
  int a,b,c;
  char d,e;
  
  cin>>a>>d>>b>>e>>c;
  
  cout<<(b<=4? "Heisei" : "TBD);
  
         return 0;
         }
         


Compiler output:
a.cc:9:27: warning: missing terminating " character
    9 |   cout<<(b<=4? "Heisei" : "TBD);
      |                           ^
a.cc:9:27: error: missing terminating " character
    9 |   cout<<(b<=4? "Heisei" : "TBD);
      |                           ^~~~~~
a.cc: In function 'int main()':
a.cc:11:10: error: expected primary-expression before 'return'
   11 |          return 0;
      |          ^~~~~~
a.cc:9:26: error: expected ')' before 'return'
    9 |   cout<<(b<=4? "Heisei" : "TBD);
      |         ~                ^
      |                          )
   10 | 
   11 |          return 0;
      |          ~~~~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
  int a,b,c;
  char d,e;
  
  cin>>a>>d>>b>>e>>c;
  
  cout<<(d<=4? "Heisei" : "TBD);
  
         return 0;
         }
         

Compiler output:
a.cc:9:27: warning: missing terminating " character
    9 |   cout<<(d<=4? "Heisei" : "TBD);
      |                           ^
a.cc:9:27: error: missing terminating " character
    9 |   cout<<(d<=4? "Heisei" : "TBD);
      |                           ^~~~~~
a.cc: In function 'int main()':
a.cc:11:10: error: expected primary-expression before 'return'
   11 |          return 0;
      |          ^~~~~~
a.cc:9:26: error: expected ')' before 'return'
    9 |   cout<<(d<=4? "Heisei" : "TBD);
      |         ~                ^
      |                          )
   10 | 
   11 |          return 0;
      |          ~~~~~~
Language: C++

#include<iostream>
using namespace std;
 
int main(){
  int y, m, d;
  char 1, 2;
  cin >> y >> char1 >> m >> char2 >> d;
if(m <= 4){
cout << "Heisei";
}
  else{
cout << "TBD";
  }
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:6:8: error: expected unqualified-id before numeric constant
    6 |   char 1, 2;
      |        ^
a.cc:7:15: error: 'char1' was not declared in this scope; did you mean 'char'?
    7 |   cin >> y >> char1 >> m >> char2 >> d;
      |               ^~~~~
      |               char
a.cc:7:29: error: 'char2' was not declared in this scope; did you mean 'char'?
    7 |   cin >> y >> char1 >> m >> char2 >> d;
      |                             ^~~~~
      |                             char
Language: C++

#include<iostream>
using namespace std;

int main(){
  int y, m, d;
  cin >> y >> >> m >> >> d;
  if(y = 2019){
if(m <= 4){
if(d <= 30){
cout << "Heisei";
}
}
    else{
      cout << "TBD";
      break;
    }
  }
  else if(y < 2019){
    cout << "Heisei";
  }
  else{
cout << "TBD";
  }
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:6:15: error: expected primary-expression before '>>' token
    6 |   cin >> y >> >> m >> >> d;
      |               ^~
a.cc:6:23: error: expected primary-expression before '>>' token
    6 |   cin >> y >> >> m >> >> d;
      |                       ^~
a.cc:15:7: error: break statement not within loop or switch
   15 |       break;
      |       ^~~~~
Language: C++



int main(){
int y, m, d;
char c1, c2;
cin >> y >> c1 >> m >> c2 >> d;
cout << (m <= 4 ? "Heisei" : "TBD") << endl;

}



Compiler output:
a.cc: In function 'int main()':
a.cc:6:1: error: 'cin' was not declared in this scope
    6 | cin >> y >> c1 >> m >> c2 >> d;
      | ^~~
a.cc:7:1: error: 'cout' was not declared in this scope
    7 | cout << (m <= 4 ? "Heisei" : "TBD") << endl;
      | ^~~~
a.cc:7:40: error: 'endl' was not declared in this scope
    7 | cout << (m <= 4 ? "Heisei" : "TBD") << endl;
      |                                        ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,m,l;
  char a,b;
  cin >> n >> a >> m >> b >> l;
  if (m<=4){
    cout << Heisei << endl;
  }
  else {
    cout << TBD << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'Heisei' was not declared in this scope
    8 |     cout << Heisei << endl;
      |             ^~~~~~
a.cc:11:13: error: 'TBD' was not declared in this scope
   11 |     cout << TBD << endl;
      |             ^~~
Language: C++

#include <iostream>
using namespace std;

int main()
{
  string day;
  cin >> day;
  if(atoi(day[6]) < 5)
  {
    cout << "Heisei" << endl;
  }
  else
  {
    cout << "TBD" << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
    8 |   if(atoi(day[6]) < 5)
      |      ~~~~^~~~~~~~
      |          |
      |          __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C++

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

int main() {
  char S , T ;
  int y , m  , d ; 
  cin >> y >> S >> m >> T >> d ; 
   
  
  if(  m > 4){
    cout << "TBD" << endl ; 
    return 0  ; 
  }

  else {
    cout << "Heisei" << endl ; 
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:17:4: error: expected '}' at end of input
   17 |   }
      |    ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

int main() {
  int A,B,C;
  cin >> A >> B >> C;
  if(A > 2019){
  cout << "TBD" << endl;
  }
  else if(A == 2019 && B > 4){
    cout << "TBD" << endl;
    
    else{
      cout << "Heisei" << endl;
    }
 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: expected '}' before 'else'
   13 |     else{
      |     ^~~~
a.cc:10:30: note: to match this '{'
   10 |   else if(A == 2019 && B > 4){
      |                              ^
Language: C++

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

int main(){
  
  int a, b, c, NUM;
  scanf("%d/%d/%d", &a, &b, &c);
  NUM = a * 10000 + b * 100 + c;
  
  if(NUM <= 20190430){
    cout << "Heisei" << endl;
    return 0;
  }
  cout << "TDB" << endl;
  return 0;
}

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

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

int main(){
  
  string a;
  cin >> a;
  
  if( s.at(7) <= 4 ){
    
    cout << "Heisei" << endl;
    
  }
  
  else{
    
    cout << "TBD" << endl;
    
  }
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: 's' was not declared in this scope
    9 |   if( s.at(7) <= 4 ){
      |       ^
Language: C

#include<stdio.h>
int main(){
  char ymd[10];
  scanf("c",&ymd[]);
  if((ymd[0]*1000+ymd[1]*100+ymd[2]*10+ymd[3]) < 2019){
    printf("Hesei");
  }else{
    if(ymd[5] < 4){
      printf("Hesei");
    }else if(ymd[8]*10+ymd[9] <= 30){
      printf("Hesei");
    }else{
      printf("TBD");
    }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:18: error: expected expression before ']' token
    4 |   scanf("c",&ymd[]);
      |                  ^
Language: C

#inlcude<stdio.h>
int main(){
  char ymd[10];
  scanf("c",&ymd[]);
  if((ymd[0]*1000+ymd[1]*100+ymd[2]*10+ymd[3]) < 2019){
    printf("Hesei");
  }else{
    if(ymd[5] < 4){
      printf("Hesei");
    }else if(ymd[8]*10+ymd[9] <= 30){
      printf("Hesei");
    }else{
      printf("TBD");
    }
  }
  return 0;
}

Compiler output:
main.c:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    1 | #inlcude<stdio.h>
      |  ^~~~~~~
      |  include
main.c: In function 'main':
main.c:4:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |   scanf("c",&ymd[]);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #inlcude<stdio.h>
main.c:4:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |   scanf("c",&ymd[]);
      |   ^~~~~
main.c:4:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:4:18: error: expected expression before ']' token
    4 |   scanf("c",&ymd[]);
      |                  ^
main.c:6:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    6 |     printf("Hesei");
      |     ^~~~~~
main.c:6:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:6:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:6:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:9:7: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
    9 |       printf("Hesei");
      |       ^~~~~~
main.c:9:7: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:11:7: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   11 |       printf("Hesei");
      |       ^~~~~~
main.c:11:7: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:13:7: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   13 |       printf("TBD");
      |       ^~~~~~
main.c:13:7: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string s; cin>>s;
  string y = s[0] + s[1] + s[2] + s[3];
  string m = s[5] + s[6];
  string d = s[8] + s[9];
  if (2019 < (int)y) cout << "Heisei" << endl;
  else if (4 <= (int)m) cout << "Heisei" << endl;
  else cout << "TBD" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:33: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
    6 |   string y = s[0] + s[1] + s[2] + s[3];
a.cc:7:19: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
    7 |   string m = s[5] + s[6];
a.cc:8:19: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
    8 |   string d = s[8] + s[9];
a.cc:9:14: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'int'
    9 |   if (2019 < (int)y) cout << "Heisei" << endl;
      |              ^~~~~~
a.cc:10:17: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'int'
   10 |   else if (4 <= (int)m) cout << "Heisei" << endl;
      |                 ^~~~~~
Language: C++

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

int main() {
   int y, m, d;
   char s1, d2;
   cin >> y >> s1 >> m >> s2 >> d;

   if (m >= 4) {
       cout << "Heisei" << endl;
   } else {
       cout << "TBD" << endl;
   }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:27: error: 's2' was not declared in this scope; did you mean 'd2'?
   10 |    cin >> y >> s1 >> m >> s2 >> d;
      |                           ^~
      |                           d2
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
 
int main() {
    strin S;
    cin >> S;
    char tuki=S.at(5);
    if(tuki=='1'||tuki=='2'||tuki=='3'||tuki=='4') cout << "Heisei" << endl;
    else cout << "TBD" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'strin' was not declared in this scope; did you mean 'stdin'?
    6 |     strin S;
      |     ^~~~~
      |     stdin
a.cc:7:12: error: 'S' was not declared in this scope
    7 |     cin >> S;
      |            ^
Language: C++

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

int main() {
  string S;
  cin >> S;
    
  if ( S.at(4) == 0 $$ S.at(5) <= 4 ) {
    cout << "Heisei" << endl;
  }
  else {
    cout << "TBD" << endl;
  }

}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:20: error: expected ')' before '$$'
    8 |   if ( S.at(4) == 0 $$ S.at(5) <= 4 ) {
      |      ~             ^~~
      |                    )
Language: Java

import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
	String a = sc.next();
    String b = a.substring(5,7);
    int n = Interger.parseInt(a);
    if (n>4) {
      System.out.println("TBD");
    } else {
      System.out.println("Heisei");
    }
  }
}

Compiler output:
Main.java:11: error: cannot find symbol
    int n = Interger.parseInt(a);
            ^
  symbol:   variable Interger
  location: class Main
1 error
Language: C++

/*                        ______
 _______   /\     |``\   |        |  /
    |     /  \    |__/   |____    |/
    |    / _ _\   |  \   |        |\
    |   /      \  |   \  |______  |  \

            Dept. of CSE
        Comilla  University

*/
#include<bits/stdc++.h>
#define pi 2*acos(0.0)
#define ll long long
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define Node struct node
#define spc " "
#define  E  2.71828182845904523536
#define pb push_back
#define pp pop_back
#define valid(nx,ny) nx>=0 && nx<n && ny>=0 && ny<m
#define ee endl
#define pii pair<int,int>
#define infinity 10000000000000000
#define mod 1000000007
int fx[]={0,0,+1,-1};
int fy[]={+1,-1,0,0};

using namespace std;
///check n=1;
///check corner case;
const int maX=1e5+1;
vector<ll>Graph[maX],cost[maX];
ll visit[maX];
ll x[10];
ll y[10];

int main()
{
    char a,b;
    ll i,j,x,y,z;
    cin>>x>>a>>y>>b>>z;
    if(x<=2019 && y<=4 && z>=1 && z<=30 )cout<<"Heisei"<<endl;
    else cout<<"TBD"<<endl;a
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:29: error: expected ';' before 'return'
   43 |     else cout<<"TBD"<<endl;a
      |                             ^
      |                             ;
   44 | return 0;
      | ~~~~~~
Language: C++

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

void Main() {
  string S;
  cin >> S;
  string year;
  year = S[0];
  year += S[1];
  year += S[2];
  year += S[3];
  
  string month:
  month = S[5];
  month += S[6];
  
  string date;
  date = S[8];
  date += S[9];
  
  if (year < "2019") {
    cout << "Heisei" << endl;
  } else {
    if (month <= "04") {
      cout << "Heisei" << endl;
    } else {
      cout << "TBD" << endl;
    }
  }
}

int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(15);
  Main();
  return 0;
}

Compiler output:
a.cc: In function 'void Main()':
a.cc:13:15: error: found ':' in nested-name-specifier, expected '::'
   13 |   string month:
      |               ^
      |               ::
a.cc:13:10: error: 'month' has not been declared
   13 |   string month:
      |          ^~~~~
a.cc:14:9: error: qualified-id in declaration before '=' token
   14 |   month = S[5];
      |         ^
a.cc:15:3: error: 'month' was not declared in this scope
   15 |   month += S[6];
      |   ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=0;i<=n;i++)
#define repr(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define uni(e) e.erase(unique(e.begin(),e.end()),e.end())
#define double long double
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
int INF=1e10;
int MOD=1e9+7;
signed main(){
  string a;
  cin>>a;
  string b=a.substr(0,4);
  string c=a.substr(5,2);
  if(stoi(b)<=2019&&stoi(c)<=4){
  cout<<"Heisei";
    else
      cout<<"TBD";
  }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:5: error: expected '}' before 'else'
   23 |     else
      |     ^~~~
a.cc:21:32: note: to match this '{'
   21 |   if(stoi(b)<=2019&&stoi(c)<=4){
      |                                ^
a.cc: At global scope:
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^
Language: Java

import java.util.*;
class Main{
  public static void main(String[] args){
  Scanner sc = new Scanner(System.in);
  String n = sc.nextString();
  System.out.println(n.substring(3,5));
  }
}


Compiler output:
Main.java:5: error: cannot find symbol
  String n = sc.nextString();
               ^
  symbol:   method nextString()
  location: variable sc of type Scanner
1 error
Language: Java

import java.util.*;
class Main{
  public static void main(String[] args){
  Scanner sc = new Scanner(System.in);
  String n = sc.nextInt();
  System.out.println(n.substring(3,5));
  }
}


Compiler output:
Main.java:5: error: incompatible types: int cannot be converted to String
  String n = sc.nextInt();
                       ^
1 error
Language: C

#include<stdio.h>
#include<stlib.h>
int main ()
{
char a[10];
  scanf("%10s",a);

  int num=atoi(a[6]);
  
if(num<5)  printf("Heisei");
else printf("TBD");

return 0;
}


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

#include<stdio.h>
int main ()
{
char a[10];
  scanf("%10s",a);

if(int(a[6])<5)  printf("Heisei");
else printf("TBD");

return 0;
}


Compiler output:
main.c: In function 'main':
main.c:7:4: error: expected expression before 'int'
    7 | if(int(a[6])<5)  printf("Heisei");
      |    ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
    string S;
    cin >> S;
    string yea = S.substr(0,4);
    int year = stoi(yea);
    string mont = S.substr(5,2);
    int month = stoi(mont);

    if(year <=2019){
        cout << heisei << endl;
    }
    else if(month <=4){
        cout << heisei << endl;
    }
    else{
        cout << TBD << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'heisei' was not declared in this scope
   13 |         cout << heisei << endl;
      |                 ^~~~~~
a.cc:16:17: error: 'heisei' was not declared in this scope
   16 |         cout << heisei << endl;
      |                 ^~~~~~
a.cc:19:17: error: 'TBD' was not declared in this scope
   19 |         cout << TBD << endl;
      |                 ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define PI 3.14159265358979323846
constexpr int INF = numeric_limits<int>::max() / 2;
constexpr long long INFL = numeric_limits<long long>::max() / 2;
constexpr int MOD = 1000000007;
using Graph = vector<vector<int>>;



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

    string S;
    cin >> S;
    string a=S.substr(5,2);
    int num=atoi(a);
    if(num<=4) cout << "Heisei" << endl;
    else cout << "TBD" << endl;



}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:18: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   19 |     int num=atoi(a);
      |                  ^
      |                  |
      |                  std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~