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

#include<bits/stdc++.h>
#define llong long long
#define mkpr make_pair
#define riterator reverse_iterator
using namespace std;

inline int read()
{
	int x = 0,f = 1; char ch = getchar();
	for(;!isdigit(ch);ch=getchar()) {if(ch=='-') f = -1;}
	for(; isdigit(ch);ch=getchar()) {x = x*10+ch-48;}
	return x*f;
}

const int N = 185;
int fx[N+3][N+3],fy[N+3][N+3];
int gx[N+3][N+3][N+3],gy[N+3][N+3][N+3];
int hx[N+3][N+3][N+3],hy[N+3][N+3][N+3];
char a[N+3][N+3];
int n,m;

void updmax(int &x,int y) {x = max(x,y);}

void dp()
{
	for(int lx=1; lx<=n; lx++) for(int ly=1; ly<=m; ly++) for(int rx=lx; rx<=n; rx++)
	{
		gx[lx][ly][rx] += gx[lx][ly+gx[lx][ly][rx]][rx];
		if(gx[lx][ly][rx]>0) {updmax(hy[lx][ly][ly+gx[lx][ly][rx]-1],rx-lx+1);}
	}
	for(int lx=1; lx<=n; lx++) for(int ly=1; ly<=m; ly++) for(int ry=ly; ry<=m; ry++)
	{
		gy[lx][ly][ry] += gy[lx+gy[lx][ly][ry]][ly][ry];
		if(gy[lx][ly][ry]>0) {updmax(hx[lx][ly][lx+gy[lx][ly][ry]-1],ry-ly+1);}
	}
	for(int lx=1; lx<=n; lx++) for(int ly=1; ly<=m; ly++) for(int rx=n; rx>=lx; rx--)
	{
		if(rx<n) updmax(hx[lx][ly][rx],hx[lx][ly][rx+1]);
		updmax(gx[lx][ly][rx],hx[lx][ly][rx]);
		assert(gx[lx][ly][rx]<=gx[lx][ly][rx+1]);
	}
	for(int lx=1; lx>=n; lx++) for(int ly=1; ly<=m; ly++) for(int ry=m; ry>=ly; ry--)
	{
		if(ry<m) updmax(hy[lx][ly][ry],hy[lx][ly][ry+1]);
		updmax(gy[lx][ly][ry],hy[lx][ly][ry]);
		assert(gy[lx][ly][ry],gy[lx][ly][ry+1]);
	}
}

int main()
{
	scanf("%d%d",&n,&m);
	for(int i=1; i<=n; i++) scanf("%s",a[i]+1);
	for(int i=1; i<=n; i++) for(int j=m; j>=1; j--)
	{
		fx[i][j] = a[i][j]==a[i][j+1]?fx[i][j+1]+1:1;
	}
	for(int j=1; j<=m; j++) for(int i=n; i>=1; i--)
	{
		fy[i][j] = a[i][j]==a[i+1][j]?fy[i+1][j]+1:1;
	}
	for(int lx=n; lx>=1; lx--) for(int ly=1; ly<=m; ly++)
	{
		int z = gx[lx][ly][lx] = fx[lx][ly];
		if(a[lx][ly]==a[lx+1][ly])
		{
			for(int rx=lx+1; rx<=n; rx++)
			{
				gx[lx][ly][rx] = min(z,gx[lx+1][ly][rx]);
			}
		}
	}
	for(int ly=m; ly>=1; ly--) for(int lx=1; lx<=n; lx++)
	{
		int z = gy[lx][ly][ly] = fy[lx][ly];
		if(a[lx][ly]==a[lx][ly+1])
		{
			for(int ry=ly+1; ry<=m; ry++)
			{
				gy[lx][ly][ry] = min(z,gy[lx][ly+1][ry]);
			}
		}
	}
	int ans = 0;
	while(gx[1][1][n]<m)
	{
		ans++;
		dp();
	}
	printf("%d\n",ans);
	return 0;
}

Compiler output:
a.cc:46:55: error: macro "assert" passed 2 arguments, but takes just 1
   46 |                 assert(gy[lx][ly][ry],gy[lx][ly][ry+1]);
      |                                                       ^
In file included from /usr/include/c++/14/cassert:44,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:106,
                 from a.cc:1:
/usr/include/assert.h:102:11: note: macro "assert" defined here
  102 | #  define assert(expr)                                                  \
      |           ^~~~~~
a.cc: In function 'void dp()':
a.cc:46:17: error: 'assert' was not declared in this scope
   46 |                 assert(gy[lx][ly][ry],gy[lx][ly][ry+1]);
      |                 ^~~~~~
a.cc:2:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    1 | #include<bits/stdc++.h>
  +++ |+#include <cassert>
    2 | #define llong long long
Language: C++

//Skatal

#include <bits/stdc++.h>
#define off  exit( 0 )
#define cn   continue
#define rt   return
#define sc   scanf
#define pr   printf
#define pb   push_back
#define pf   push_front
#define p_f  pop_front
#define p_b  pop_back
#define ff   first
#define ss   second
#define ll   long long
#define ld   long double
#define N    190
#define M    1000000007
#define I    1000000000000000000
#define pdd  pair < ld, ld >
#define pll  pair < ll, ll >
#define pii  pair < int, int >
#define sqr( a )           a * a
#define all( c )           c.begin(), c.end()
#define srt( c )           sort( all( c ) )
#define rev( c )           reverse( all( c ) )
#define srtr( c )          sort( c.rbegin(), c.rend() );
using namespace std;

int n, m, s[N][N], c[N][N];
int f[2][N][N][N], v;
void solve()
{
    scanf("%d%d", &n,&m);
    for( int i = 1; i <= n; i ++ ){
        scanf("\n");
        for( int j = 1; j <= m; j ++ )
            c[i][j] = s[i][j] = ( getchar() == '#' ? 1: 0);
    }
    for( int i = 1; i <= n; i ++ )
        for( int j = 1; j <= m; j ++ )
            s[i][j] += s[i][j - 1];
    for( int i = 1; i <= n; i ++ )
        for( int j = 1; j <= m; j ++ )
            s[i][j] += s[i - 1][j];
    for( int k = m; k > 0; k -- )
        for( int i = 1; i <= n; i ++ )
            for( int j = i; j <= n; j ++ )
            {
                int su = s[j][k] - s[i - 1][k] - s[j][k - 1] + s[i - 1][k - 1];
                if(su && su < j - i + 1)continue;
                if( f[0][k + 1][i][j] && c[i][k] == c[i][k + 1] )f[0][k][i][j]=f[0][k + 1][i][j] + 1;
                else f[0][k][i][j] = 1;
            }
    if( f[0][1][1][n] == m )
    {
        printf( "0" );
        return 0;
    }
    int o = 0;
    for( int le = 1; le < 17; le ++ )
    {
        o ^= 1;
        memset( f[o], 0, sizeof f[o] );
        for( int k = 1; k <= m; k ++ )
        {
            for( int i = 1; i <= n; i ++ )
            {
                int wz = i - 1;
                for( int j = i; j <= n; j ++ )
                {
                    v = f[!o][k][i][j];
                    f[o][k][i][j] = v + f[!o][k + v][i][j];
                    if(i == j)continue;
                    while( wz + 1 < j && f[!o][k][i][wz+1] > f[!o][k][wz+2][j] )wz ++;
                    if( wz + 1 > i )f[o][k][i][j] = max( f[o][k][i][j], f[!o][k][wz + 1][j]);
                    if( wz + 1 < j )f[o][k][i][j] = max( f[o][k][i][j], f[!o][k][i][wz + 1]);
                }
            }
        }
        if( f[o][1][1][n] == m )
        {
            printf("%d",le);
            return 0;
        }
    }
}
int main()
{
    int tt = 1;
    //sc( "%d", &tt );
    for( int i = 1; i <= tt; i ++ )
        solve();
}












Compiler output:
a.cc: In function 'void solve()':
a.cc:58:16: error: return-statement with a value, in function returning 'void' [-fpermissive]
   58 |         return 0;
      |                ^
a.cc:84:20: error: return-statement with a value, in function returning 'void' [-fpermissive]
   84 |             return 0;
      |                    ^
Language: C++

#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int Mx(int a,int b){return a>b?a:b;}
int Mn(int a,int b){return a<b?a:b;}
const int N=190;
int n,m,sm[N][N],dp[2][N][N][N];
char ch[N][N];
bool chk(int x1,int y1,int x2,int y2)
{
  int s=sm[x2][y2]-sm[x2][y1-1]-sm[x1-1][y2]+sm[x1-1][y1-1];
  return (!s)||s==(x2-x1+1)*(y2-y1+1);
}
int main()
{
  scanf("%d%d",&n,&m);
  for(int i=1;i<=n;i++)
    scanf("%s",ch[i]+1);
  for(int i=1;i<=n;i++)
    for(int j=1;j<=m;j++)sm[i][j]=sm[i][j-1]+(ch[i][j]=='.');
  for(int i=1;i<=n;i++)
    for(int j=1;j<=m;j++)sm[i][j]+=sm[i-1][j];
  for(int i=1;i<=n;i++)
    for(int j1=1;j1<=m;j1++)
      for(int j2=j1;j2<=m;j2++)
	{
	  int l=i,r=n,ans=i-1;
	  while(l<=r)
	    {
	      int mid=l+r>>1;
	      if(chk(i,j1,mid,j2))ans=mid,l=mid+1;
	      else r=mid-1;
	    }
	  dp[0][i][j1][j2]=ans;
	}
  if(dp[0][1][1][m]==n){puts("0");return 0;}
  bool u=1,v=0;
  for(int t=1;t<=16;t++,swap(u,v))
    {
      for(int i=1;i<=n;i++)
	for(int j1=1;j1<=m;j1++)
	  for(int j2=j1;j2<=m;j2++)
	    {
	      int d=dp[v][dp[v][i][j1][j2]+1][j1][j2];
	      if(dp[v][i][j1][j2]==n)
		{ dp[u][i][j1][j2]=n;continue;}
	      int l=j1,r=j2-1;
	      while(l<=r)
		{
		  int mid=l+r>>1;
		  int t1=dp[v][i][j1][mid],t2=dp[v][i][mid+1][j2];
		  d=Mx(d,Mn(t1,t2));
		  if(t1>=t2)l=mid+1; else r=mid-1;
		}
	      dp[u][i][j1][j2]=d;
	    }
      if(dp[u][1][1][m]==n)
	{printf("%d\n",t);return 0;}
    }
}
q

Compiler output:
a.cc:62:1: error: 'q' does not name a type
   62 | q
      | ^
Language: C++

#include <cmath>
#include <iostream>
#include <algorithm>
#include <string>
#include <queue>
using namespace std;
typedef long long ll;

int h, w;
bool h_cut[185], w_cut[185];
char A[185][185];

int cal(int n){
    int res = 0;
    while(n > (1 << res)){
        res++;
    }
    return res;
}
int main(){
    cin >> h >> w;
    fill(h_cut, h_cut+185, 0);
    fill(w_cut, w_cut+185, 0);
    for(int i=0;i<h;i++){
        string s;
        cin >> s;
        for(int j=0;j<w;j++){
            A[i][j] = s[j];
        }
    }
    for(int i=0;i<h;i++){
        char prev = A[i][0];
        for(int j=1; j<w; j++){
            if(prev != A[i][j]){
                w_cut[j] = true;
            }
            prev = A[i][j];
        }
    }
    for(int j=0;j<w;j++){
        char prev = A[0][j];
        for(int i=1; i<h; i++){
            if(prev != A[i][j]){
                h_cut[i] = true;
            }
            prev = A[i][j];
        }
    }
    int ans = cal(accumulate(h_cut, h_cut+h, 1)) + cal(accumulate(w_cut, w_cut+w, 1));
    cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:49:19: error: 'accumulate' was not declared in this scope
   49 |     int ans = cal(accumulate(h_cut, h_cut+h, 1)) + cal(accumulate(w_cut, w_cut+w, 1));
      |                   ^~~~~~~~~~
Language: C++

#include <algorithm>
#include <iostream>
#include <string>

using namespace std;

#define MAX_H 185
#define MAX_W 185
#define MAX_K 16

int H, W;
string A[MAX_H];

// sum[h][w] = (0, 0) を左上の点 (h, w) を右下の点とする長方形内の黒ますの個数
int sum[MAX_H + 1][MAX_W + 1];
// dph2[w1][w2][h1][c] = (h1, w1)-(h1, w2) を上辺とする長方形で複雑さが c
// 以下となる最大の h2
int dph2[MAX_W + 1][MAX_W + 1][MAX_H + 1][MAX_K + 1];
// dpw2[h1][h2][w1][c] = (h1, w1)-(h2, w1) を左辺とする長方形で複雑さが c
// 以下となる最大の w2
int dpw2[MAX_H + 1][MAX_H + 1][MAX_W + 1][MAX_K + 1];

/**
 * initialize `sum`
 */
void init_sum()
{
    for ( int h = 0; h < H; h++ )
    {
        for ( int w = 0; w < W; w++ )
        {
            sum[h + 1][w + 1] = sum[h + 1][w] + sum[h][w + 1] - sum[h][w];
            if ( A[h][w] == '#' ) sum[h + 1][w + 1]++;
        }
    }
}

void init_dp()
{
    for ( int h1 = 0; h1 < H; h1++ )
    {
        for ( int w1 = 0; w1 < W; w1++ )
        {
            int w2 = W;
            // dpw2 の複雑さ 0 の初期化
            // h1, h2, w1 を固定した状態で w2 を複雑さが 0 になるまで縮める。
            // h2 <- h2+1 とした時に w2 は明らかに前回以下の大きさになるので
            // W から縮めていくことで尺取り法になる。
            for ( int h2 = h1 + 1; h2 <= H; h2++ )
            {
                int w2 = w1;
                while ( w1 < w2 && !complexity_is_0( h1, w1, h2, w2 ) ) w2--;
                dpw2[h1][h2][w1][0] = w2;
            }

            int h2 = H;
            // dph2 の複雑さ 0 の初期化
            // 上と同様に尺取り法にする。
            for ( int w2 = w1 + 1; w2 <= W; w2++ )
            {
                while ( h1 < h2 && !complexity_is_0( h1, w1, h2, w2 ) ) h2--;
                dph2[w1][w2][h1][0] = h2;
            }
        }
    }
}

/**
 * (h1, w1) を左上、(h2, w2) を右下とする長方形の複雑さが 0
 * であるかを判定します。
 *
 * Judges whether complexity of the rectangle whose left-upper is (h1, w1) and
 * right-down is (h2, w2) is 0 or not.
 */
bool complexity_is_0( int h1, int w1, int h2, int w2 )
{
    int black_num = sum[h2][w2] - sum[h1][w2] - sum[h2][w1] + sum[h1][w1];
    int white_num = H * W - black_num;

    return black_num == 0 || white_num == 0;
}

int solve()
{
    if ( complexity_is_0( 0, 0, H, W ) ) return 0;

    return 1;
}

int main( int argc, char **argv )
{
    cin >> H >> W;
    for ( int h = 0; h < H; h++ ) cin >> A[h];

    init_sum();
    init_dp();

    int ans = solve();

    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc: In function 'void init_dp()':
a.cc:52:37: error: 'complexity_is_0' was not declared in this scope
   52 |                 while ( w1 < w2 && !complexity_is_0( h1, w1, h2, w2 ) ) w2--;
      |                                     ^~~~~~~~~~~~~~~
a.cc:61:37: error: 'complexity_is_0' was not declared in this scope
   61 |                 while ( h1 < h2 && !complexity_is_0( h1, w1, h2, w2 ) ) h2--;
      |                                     ^~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<queue>
#include<stack>
using namespace std;
#define MOD 1000000007
#define INF (1<<29)
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long Int;
typedef pair<Int, Int> P;


Int all(Int n){//no bb
    Int rr = 1, bb = 1, rb = 0, br = 0;
    for(int i = 1;i < n;i++){
        Int nrr = (rr+rb) % MOD;
        Int nbb = br;
        Int nrb = rr;
        Int nbr = (bb + br) % MOD;
        rr = nrr;
        bb = nbb;
        rb = nrb;
        br = nbr;
    }
    return (rr + rb + br) % MOD;
}

Int tmp[216000];
Int rdp[216000];
Int dp[216000];
void calc(Int n, Int limit){
    dp[0] = 0;
    dp[1] = 1;
    rdp[0]= 0;
    rdp[1] = 1;
    for(int i = 1;i <= n+1;i++){
        Int l = max(0LL, i - limit);
        dp[i+1] = (rdp[i] + MOD - rdp[l]) % MOD;
        rdp[i+1] = (rdp[i] + dp[i+1]) % MOD;
    }
    for(int i = 1;i <= n+1;i++){
        dp[i-1] = dp[i];
        if(dp[i-1] < 0)dp[i-1} %= MOD;
    }
}

Int solve(Int n, Int limit){
    if(n % 2 == 1)return 0;
    limit = (limit+1) / 2;
    n /= 2;
    Int res = 0;
    calc(n, limit);
    for(Int i = 1;i <= limit;i++){
        if(n-i >= 0)res = (res + dp[n-i]*2*i) % MOD;
    }
    return res;
}

int main(){
    Int n, m;
    string str;
    vector<Int> vec;
    cin >> n >> m;
    cin >> str;
    for(auto c:str)vec.push_back(c != str[0]);
    vec.push_back(1);
    Int l = 0;
    while(vec[l] == 0)l++;
    if(l+1==vec.size()){
        cout << all(n) << endl;
        return 0;
    }
    if(l % 2 == 0)l++;
    Int limit = l;
    l = 0;
    for(int i = 0;i <= m;i++){
        if(vec[i] == 0)l++;
        else{
            if(l % 2 == 1)limit = min(limit, l);
            l = 0;
        }
    }
    cout << solve(n, limit) << endl;
    return 0;
}

Compiler output:
a.cc: In function 'void calc(Int, Int)':
a.cc:50:30: error: expected ']' before '}' token
   50 |         if(dp[i-1] < 0)dp[i-1} %= MOD;
      |                              ^
      |                              ]
a.cc:50:30: error: expected ';' before '}' token
   50 |         if(dp[i-1] < 0)dp[i-1} %= MOD;
      |                              ^
      |                              ;
a.cc:50:32: error: expected primary-expression before '%=' token
   50 |         if(dp[i-1] < 0)dp[i-1} %= MOD;
      |                                ^~
a.cc: At global scope:
a.cc:52:1: error: expected declaration before '}' token
   52 | }
      | ^
Language: C++

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

using namespace std;

vector<string> transpose(const vector<string> &a)
{
	int h = a.size();
	int w = a[0].size();
	vector<string> b(w, string(h, '*'));
	for (int i = 0; i < h; ++i) {
		for (int j = 0; j < w; ++j) {
			b[j][i] = a[i][j];
		}
	}
	return b;
}

int calc(const vector<int> &v, int l, int r, vector<vector<int>> &memo)
{
	if (l + 1 == r) {
		return v[l];
	}
	if (l + 2 == r) {
		return max(v[l], v[r - 1]) + 1;
	}
	if (memo[l][r] != -1) {
		return memo[l][r];
	}
	int ans = INT_MAX;
	for (int m = l + 1; m < r; ++m) {
		int x = calc(v, l, m, memo);
		int y = calc(v, m, r, memo);
		ans = min(ans, max(x, y) + 1);
	}

	return memo[l][r] = ans;
}
int solve(int H, int W, const vector<string> &A)
{
	vector<int> v(H, 0);

	for (int i = 0; i < H; ++i) {
		string x = A[i];
		x.erase(unique(x.begin(), x.end()), x.end());
		if (x.size() <= 1) {
			v[i] = 0;
		}
		else {
			v[i] = (x.size() + 1) / 2;
		}
	}
	const int L = v.size();
	vector<vector<int>> memo(L + 1, vector<int>(L + 1, -1));

	return calc(v, 0, L, memo);
}

int main()
{
	int H, W;
	cin >> H >> W;
	vector<string> A(H);
	for (auto &x : A) {
		cin >> x;
	}

	A.erase(unique(A.begin(), A.end()), A.end());

	A = transpose(A);
	A.erase(unique(A.begin(), A.end()), A.end());

	for (const auto &x : A) {
		cout << x << endl;
	}

	H = A.size();
	W = A[0].size();

	int ans = solve(H, W, A);

	A = transpose(A);
	swap(H, W);
	ans = min(ans, solve(H, W, A));
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int calc(const std::vector<int>&, int, int, std::vector<std::vector<int> >&)':
a.cc:32:19: error: 'INT_MAX' was not declared in this scope
   32 |         int ans = INT_MAX;
      |                   ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <algorithm>
  +++ |+#include <climits>
    5 |
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 998244353

typedef long long ll;
typedef pair<ll,ll> P;

char area[222][222];
map<ll, ll> mp;
ll trans(int a, int b, int c, int d){
	return a + b * 200 + c * 200 * 200 + d * 200 * 200 * 200;
}

bool check(int a, int b, int c, int d){
	//cout << "check " << a << " " << b << " " << c << " " << d << endl;
	char ch = area[a][b];
	for(int i = a;i <= c;i++){
		for(int j = b;j <= d;j++){
			if(ch != area[i][j])return false;
		}
	}
	//cout << "true" << endl;
	return true;
}

int dfs(int a, int b, int c, int d, int dep){
	if(mp.find(trans(a, b, c, d)) != mp.end())return mp[trans(a, b, c, d)];
	//REP(i, dep)cout << "  ";cout << "dfs " << a << " " << b << " " << c << " " << d << endl;
	if(check(a, b, c, d))return mp[trans(a, b, c, d)] = 0;
	int ret = INF;
	vector<int> v;
	for(int i = a+1;i <= c;i++){
		bool flag = false;
		for(int j = b;j <= d;j++){
			if(area[i-1][j] != area[i][j])flag = true;
		}
		if(flag)v.PB(i);
	}
	//REP(i, dep)cout << "  ";cout << "tate ";REP(i, v.size())cout << v[i] << " ";cout << endl;
	REP(i, v.size()){
a		ret = min(ret, max(dfs(a, b, v[i]-1, d, dep+1), dfs(v[i], b, c, d, dep+1)) + 1);
	}
	v.clear();
	for(int j = b+1;j <= d;j++){
		bool flag = false;
		for(int i = a;i <= c;i++){
			if(area[i][j-1] != area[i][j])flag = true;
		}
		if(flag)v.PB(j);
	}
	//REP(i, dep)cout << "  ";cout << "yoko ";REP(i, v.size())cout << v[i] << " ";cout << endl;
	REP(i, v.size()){
		ret = min(ret, max(dfs(a, b, c, v[i]-1, dep+1), dfs(a, v[i], c, d, dep+1)) + 1);
	}
	//REP(i, dep)cout << "  ";cout << "ret " << ret << endl;
	return mp[trans(a, b, c, d)] = ret;
}

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

	int h, w;cin >> h >> w;
	REP(i, h)REP(j, w)cin >> area[i][j];

	cout << dfs(0, 0, h-1, w-1, 0) << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int dfs(int, int, int, int, int)':
a.cc:56:8: error: expected ';' before 'ret'
   56 | a               ret = min(ret, max(dfs(a, b, v[i]-1, d, dep+1), dfs(v[i], b, c, d, dep+1)) + 1);
      |  ^~~~~~~        ~~~
      |        ;
Language: C++

#include <bits/stdc++.h>
#define mod 1000000007
#define mod998 998244353
#define sp ' '
#define intmax 2147483647
#define llmax 9223372036854775807
#define mkp make_pair
typedef long long ll;
using namespace std;

int H, W, a[186][186], memo[185][185][185][185];
string S[185];

int dfs(int X1, int Y1, int X2, int Y2) {
	if (memo[X1][Y1][X2][Y2]) {
		return memo[X1][Y1][X2][Y2];
	}
	int res = 0xE869120;
	if (a[X2 + 1][Y2 + 1] - a[X1][Y2 + 1] - a[X2 + 1][Y1] + a[X1][Y1] == 0 || a[X2 + 1][Y2 + 1] - a[X1][Y2 + 1] - a[X2 + 1][Y1] + a[X1][Y1] == (X2 - X1 + 1)*(Y2 - Y1 + 1))return 0;
	if (X1 != X2) {
		int l = X1;
		int r = X2;
		while (l + 1 != r) {
			int m = (l + r) / 2;
			if (dfs(X1, Y1, m, Y2) < dfs(m + 1, Y1, X2, Y2)) {
				l = m;
			}
			else {
				r = m;
			}
		}
		res = min(res, max(dfs(X1, Y1, l, Y2), dfs(l + 1, Y1, X2, Y2)) + 1);
		if (l != X2 - 1) {
			res = min(res, max(dfs(X1, Y1, l + 1, Y2), dfs(l + 2, Y1, X2, Y2)) + 1);
		}
	}
	if (Y1 != Y2) {
		int l = Y1;
		int r = Y2;
		while (l + 1 != r) {
			int m = (l + r) / 2;
			if (dfs(X1, Y1, X2, m) < dfs(X1, m + 1, X2, Y2)) {
				l = m;
			}
			else {
				r = m;
			}
		}
		res = min(res, max(dfs(X1, Y1, X2, l), dfs(X1, l + 1, X2, Y2)) + 1);
		if (l != Y2 - 1) {
			res = min(res, max(dfs(X1, Y1, X2, l + 1), dfs(X1, l + 2, X2, Y2)) + 1);
		}
	}
	return memo[X1][Y1][X2][Y2] = res;
}


int main() {
	cin >> H >> W;
	for (int i = 0; i < H; ++i) {
		cin >> S[i];
	}
	for (int i = 0; i < H; ++i) {
		for (int j = 0; j < W; ++j) {
			if (S[i][j] == '#') {
				++a[i + 1][j + 1];
			}
		}
	}
	for (int i = 1; i <= H; ++i) {
		for (int j = 1; j <= W; ++j) {
			a[i][j] += a[i][j - 1];
		}
	}
	for (int i = 1; i <= W; ++i) {
		for (int j = 1; j <= H; ++j) {
			a[j][i] += a[j - 1][i];
		}
	}
	cout << dfs(0, 0, H - 1, W - 1) << endl;
}


Compiler output:
/tmp/ccSG3sCO.o: in function `main':
a.cc:(.text+0x615): relocation truncated to fit: R_X86_64_PC32 against symbol `S[abi:cxx11]' defined in .bss section in /tmp/ccSG3sCO.o
a.cc:(.text+0x664): relocation truncated to fit: R_X86_64_PC32 against symbol `S[abi:cxx11]' defined in .bss section in /tmp/ccSG3sCO.o
/tmp/ccSG3sCO.o: in function `__tcf_0':
a.cc:(.text+0x8ca): relocation truncated to fit: R_X86_64_PC32 against symbol `S[abi:cxx11]' defined in .bss section in /tmp/ccSG3sCO.o
a.cc:(.text+0x8d1): relocation truncated to fit: R_X86_64_PC32 against symbol `S[abi:cxx11]' defined in .bss section in /tmp/ccSG3sCO.o
/tmp/ccSG3sCO.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x8f8): relocation truncated to fit: R_X86_64_PC32 against symbol `S[abi:cxx11]' defined in .bss section in /tmp/ccSG3sCO.o
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>

#ifdef NON_SUBMIT
#define TEST(n) (n)
#define tout cerr
#else
#define TEST(n) ((void)0)
#define tout cin
#endif

using namespace std;

map<tuple<int,int,int,int>,int> D;
int PS[186][186];
 
int solve(int x1, int y1, int x2, int y2)
{
	int temp=PS[x2][y2]-PS[x2][y1-1]-PS[x1-1][y2]+PS[x1-1][y1-1];
	if(temp==0 || temp==(x2-x1+1)*(y2-y1+1)) return 0;
	if(D.count(make_tuple(x1,y1,x2,y2))) return D[make_tuple(x1,y1,x2,y2)];
	int ret=0x7fffffff, idx;
	vector<int> P;
	for(int i=x1;i<x2;i++) {
		for(int j=y1;j<=y2;j++) {
			if(A[i][j]!=A[i+1][j]) {
				P.push_back(i);
				break;
			}
		}
	}
	idx=P.size()/2;
	if(P.size()&1) ret=min(ret,max(solve(x1,y1,P[idx],y2),solve(P[idx]+1,y1,x2,y2)));
	else if(P.size()) ret=min(ret,min(max(solve(x1,y1,P[idx],y2),solve(P[idx]+1,y1,x2,y2)),max(solve(x1,y1,P[idx-1],y2),solve(P[idx-1]+1,y1,x2,y2))));
	P.clear();
	for(int j=y1;j<y2;j++) {
		for(int i=x1;i<=x2;i++) {
			if(A[i][j]!=A[i][j+1]) {
				P.push_back(j);
				break;
			}
		}
	}
	idx=P.size()/2;
	if(P.size()&1) ret=min(ret,max(solve(x1,y1,x2,P[idx]),solve(x1,P[idx]+1,x2,y2)));
	else if(P.size()) ret=min(ret,min(max(solve(x1,y1,x2,P[idx]),solve(x1,P[idx]+1,x2,y2)),max(solve(x1,y1,x2,P[idx-1]),solve(x1,P[idx-1]+1,x2,y2))));
	return D[make_tuple(x1,y1,x2,y2)]=ret+1;
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	TEST(freopen("input.txt", "r", stdin));
	TEST(freopen("output.txt", "w", stdout));
	TEST(freopen("debug.txt", "w", stderr));
	int N, M;
	cin>>N>>M;
	for(int i=0;i<N;i++) {
		string s;
		cin>>s;
		for(int j=0;j<M;j++) {
			A[i+1][j+1]=(s[j]=='#');
			PS[i+1][j+1]=A[i+1][j+1]+PS[i+1][j]+PS[i][j+1]-PS[i][j];
		}
	}
	cout<<solve(1,1,N,M)<<'\n';
	return 0;
}

Compiler output:
a.cc: In function 'int solve(int, int, int, int)':
a.cc:25:28: error: 'A' was not declared in this scope
   25 |                         if(A[i][j]!=A[i+1][j]) {
      |                            ^
a.cc:37:28: error: 'A' was not declared in this scope
   37 |                         if(A[i][j]!=A[i][j+1]) {
      |                            ^
a.cc: In function 'int main()':
a.cc:62:25: error: 'A' was not declared in this scope
   62 |                         A[i+1][j+1]=(s[j]=='#');
      |                         ^
Language: C++

#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <climits>
#include <cmath>
#include <utility>
#include <string>
#include <cstring>
#include <functional>

using namespace std;

const int maxn = 187;

int n, m, f[maxn][maxn][maxn][maxn];

string a[maxn];

int dfs(int x1, int x2, int y1, int y2) {
	if (f[x1][x2][y1][y2] >= 0)
		return f[x1][x2][y1][y2];

	char c = a[x1][y1];
	bool ok = true;

	for (int i = x1; i < x2 && ok; ++i)
		for (int j = y1; j < y2 && ok; ++j)
			if (a[i][j] != c) {
				ok = false;
				break;
			}

	if (ok) {
		f[x1][x2][y1][y2] = 0;
		return 0;
	}

	int ans = INT_MAX;
	for (int i = x1; i < x2-1; ++i)
		ans = min(ans, max(dfs(x1, i, y1, y2), dfs(i+1, x2, y1, y2)));

	for (int i = y1; i < y2-1; ++i)
		ans = min(ans, max(dfs(x1, x2, y1, i), dfs(x1, x2, i+1, y2)));

	f[x1][x2][y1][y2] = ans + 1;
	return ans + 1;
}

int main() {

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	cin >> n >> m;
	memset(f, -1, sizeof(f));

	for (int i = 0; i < n; ++i) {
		cin >> a[i];
		for (int j = 0; j < m; ++j) {
			f[i][i][j][j] = 0;
			if (j > 0 && a[i][j] == a[i][j-1])
				f[i][i][j-1][j] = 0;
		}
	}

	cout << dfs(0, n, 0, m) << endl;

	return 0;
}

Compiler output:
/tmp/ccLdzIa4.o: in function `dfs(int, int, int, int)':
a.cc:(.text+0xba): relocation truncated to fit: R_X86_64_PC32 against symbol `a[abi:cxx11]' defined in .bss section in /tmp/ccLdzIa4.o
a.cc:(.text+0xfa): relocation truncated to fit: R_X86_64_PC32 against symbol `a[abi:cxx11]' defined in .bss section in /tmp/ccLdzIa4.o
/tmp/ccLdzIa4.o: in function `main':
a.cc:(.text+0x374): relocation truncated to fit: R_X86_64_PC32 against symbol `a[abi:cxx11]' defined in .bss section in /tmp/ccLdzIa4.o
a.cc:(.text+0x3ea): relocation truncated to fit: R_X86_64_PC32 against symbol `a[abi:cxx11]' defined in .bss section in /tmp/ccLdzIa4.o
a.cc:(.text+0x413): relocation truncated to fit: R_X86_64_PC32 against symbol `a[abi:cxx11]' defined in .bss section in /tmp/ccLdzIa4.o
/tmp/ccLdzIa4.o: in function `__tcf_0':
a.cc:(.text+0x515): relocation truncated to fit: R_X86_64_PC32 against symbol `a[abi:cxx11]' defined in .bss section in /tmp/ccLdzIa4.o
a.cc:(.text+0x51c): relocation truncated to fit: R_X86_64_PC32 against symbol `a[abi:cxx11]' defined in .bss section in /tmp/ccLdzIa4.o
/tmp/ccLdzIa4.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x543): relocation truncated to fit: R_X86_64_PC32 against symbol `a[abi:cxx11]' defined in .bss section in /tmp/ccLdzIa4.o
collect2: error: ld returned 1 exit status
Language: C++

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

#define forn(i,n) for(int i=0;i<(int)(n);i++)
#define si(c) ((int)(c).size())
#define forsn(i,s,n) for(int i = (int)(s); i<((int)n); i++)
#define dforsn(i,s,n) for(int i = (int)(n)-1; i>=((int)s); i--)
#define all(c) (c).begin(), (c).end()
#define D(a) cerr << #a << "=" << (a) << endl;
#define pb push_back
#define eb emplace_back
#define mp make_pair

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

const int MOD = 1e9 + 7;

vi split(string s) {
    vi ans;
    char last = 'X'; 
    s += 'X';
    int streak = 0;
    for (char c : s) {
        if (c != last) {
            if (streak) ans.pb(streak);
            streak = 0;
            last = c;
        }
        streak++;
    }
    return ans;
}

void add(int &x, int y) {
    x += y;
    if (x >= MOD) x -= MOD;
}

vi go(int n, int lim, int start) {
    vi dp(n+1);
    dp[0] = 1;
    for (int i = 1; i <= n; i++) {
        dp[i] = 0;
        if (i >= start) add(dp[i], dp[i-start]);
        if (i >= lim+1) add(dp[i], MOD-dp[i-lim-1]);
        add(dp[i], dp[i-1]);
    }
    for (int i = n; i >= 1; i--) add(dp[i], MOD-dp[i-1]);
    return dp;
}

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

    int n,l;
    string s;
    auto p = split(s);
    if (si(p) == 1) {
        auto dp = go(n,n,2);
        int ans = 0;
        for (int dif = 1; dif <= n; dif++) {
            if (dif == 1 || dif == n-1) continue;
            add(ans, ll(dif) * dp[n-dif] % MOD);
        }
        cout << (ans+1)%MOD << endl;
    }
    else {
        if (n%2 == 1) {
            cout << 0 << endl;
            continue;
        }
        else {
            int lim = p[0]/2+1;
            forn(i,si(p)) if (i%2 == 0 && p[i]%2 == 1) 
                lim = min(lim, p[i]/2+1);
            n /= 2;
            auto dp = go(n, lim, 1);
            int ans = 0;
            for (int dif = 1; dif <= lim; dif++)
                add(ans, ll(dif) * dp[n-dif] % MOD);
            cout << 2LL*ans%MOD << endl;
        }
    }

    return 0;
}


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

// In the name of Allah. Ya ali!
#include<bits/stdc++.h>
#define double long double
#define debug(x)//  cerr << #x << " = " << x << endl
typedef long long ll;
const ll MAX_N = 2e5+100;
const ll MOD = 1e9+7;
using namespace std;

ll dp[MAX_N];
int n,m;

int main()
{
    cin >> n >> m;
    if (n==2)
        return cout << 2,0;
    string s;
    cin >> s;
    if (s[0]=='B')
    {
        for(int i = 0;i<m;++i)
        {
            if (s[i]=='B')
                s[i] = 'R';
            else
                s[i] = 'B';
        }
    }
    bool ok = false;
    for(int i = 0;i<m;++i)
        ok |= (s[i]=='B');
    if (!ok)
    {
        dp[1] = 1;
        dp[3] = 1;
        sum[1] = 1;
        sum[2] = 1;
        sum[3] = 2;
        for(int i = 4;i<=n+1;++i)
        {
            dp[i] = sum[i-2];
            sum[i] = (sum[i-1]+dp[i])%MOD;
        }
        ll ans = dp[n+1]+1;
        for(ll i = 1;i<n;++i)
        {
            ans += (i*dp[n-i])%MOD;
            ans %= MOD;
        }
        cout << ans;
        return 0;
    }
    for(int i = m-1;i>=0;--i)
    {
        if (s[i]=='B')
        {
            m = i+1;
            break;
        }
    }
    vector<int> vc;
    int cnt = 0;
    for(int i = 0;i<m;++i)
    {
        if (s[i]=='B')
        {
            if (cnt)
                vc.push_back(cnt);
            cnt = 0;
        }
        else
            cnt++;
    }
    int mn = 1e9;
    if (vc[0]%2==0)
        mn = vc[0]+1;
    for(auto x:vc)
    {
        if (x&1)
            mn = min(mn,x);
    }
    int lim = mn;
    dp[1] = 1;
    dp[3] = 1;
    for(int i = 5;i<=n;i+=2)
    {
        dp[i] = (dp[i-2]*2ll)%MOD;
        if (i>=lim+3)
            dp[i] = (dp[i]-dp[i-lim-3]+MOD+MOD)%MOD;
    }
    ll ans = 0;
    for(ll i = 1;i<=min(n-1,lim);i+=2)
    {
        ans += ((i+1ll)*dp[n-i])%MOD;
        ans %= MOD;
    }
    cout << ans;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:9: error: 'sum' was not declared in this scope
   37 |         sum[1] = 1;
      |         ^~~
Language: C++

#pragma GCC optimize "-O3"
#pragma GCC target("avx,avx2,fma,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx") 
#include"bits/stdc++.h"

using namespace std;

#define MAX 2000

int n;
int m;

vector<int> v[MAX];

queue<tuple<int, int, int> > q;

set<pair<int, int> > s;

bitset<MAX> con[MAX];

bitset<MAX>  child[MAX];
bitset<MAX> par[MAX];

bitset<MAX> stk;

inline void dfs(int b, int pr = -1) {
	auto &c = child[b];
	c.set(b, 1);
	for (int go : v[b]) {
		if (go == pr)continue;
		dfs(go, b);
		c |= child[go];
	}
}

int pat[MAX][MAX];
int lca[MAX][MAX];

int dep[MAX];


inline void dfs2(int b, int pr = -1, int star = 0) {
	pat[star][b] = pr;
	lca[star][b] = b;
	if (pr != -1) {
		if (lca[star][pr] != -1) {
			if (dep[lca[star][pr]] < dep[b]) {
				lca[star][b] = lca[star][pr];
			}
		}
	}
	for (int go : v[b]) {
		if (go == pr)continue;
		dfs2(go, b, star);
	}
}
inline void dfs3(int b, int pr = -1, int d = 0) {
	stk.set(b, 1);
	par[b] = stk;
	dep[b] = d;
	for (int go : v[b]) {
		if (go == pr)continue;
		dfs3(go, b, d + 1);
	}
	stk.set(b, 0);
}
bitset<MAX> ff;
int main() {
	cin >> n >> m;
	for (int i = 1; i < n; i++) {
		int a, b;
		scanf("%d%d", &a, &b);
		a--;
		b--;
		v[a].push_back(b);
		v[b].push_back(a);
	}
	dfs3(0);
	dfs(0);
	for (int i = 0; i < n; i++) {
		dfs2(i, -1, i);
	}
	int edd = 0;
	for (int i = 0; i < m; i++) {
		int c, d;
		scanf("%d%d", &c, &d);
		c--;
		d--;
		con[c].set(d, 1);
		con[d].set(c, 1);
		q.push(make_tuple(0, c, d));
		edd++;
	}
	bitset<MAX> full;
	for (int i = 0; i < n; i++) {
		full.set(i);
	}
	while (!q.empty()) {
		int centre, lef, rig;
		tie(centre, lef, rig) = q.front();
		q.pop();
		int A = lef;
		int B = rig;
		ff.reset();
		if (lca[A][B] == B) {
			swap(A, B);
		}
		if (lca[A][B] == A) {
			ff = child[B] ^ full^child[pat[B][A]] ^ par[B] ^ par[A];
		}
		else {
			ff = child[B] ^ child[A] ^ par[A] ^ par[B];
			ff.set(lca[A][B]);
		}
		ff &= con[A] ^ con[B];
		//the node unconnected to node B
		//connected to A
		//the node is available at the pair(A,B)
		for (int i = (int)ff._Find_first(); i < n; i = (int)ff._Find_next(i)) {
			if (i == A || i == B)continue;
			if (con[B].test(i)) {
				swap(A, B);
			}
			q.push(make_tuple(A, i, B));
			con[i].set(B);
			con[B].set(i);
			edd++;
		}
	}
	cout << edd << endl;
	return 0;
}

Compiler output:
cc1plus: error: attribute 'target' argument 'unroll-loops' is unknown
cc1plus: error: attribute 'target' argument 'unroll-loops' is unknown
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <fstream>
#include <vector>
#include <bitset>
#include <algorithm>
#include <queue>

using namespace std;

int n, m, st;
vector<int> g[2000], t[2000];
bitset<2000> path[2000][2000], was, inq[2000];
bool kekos[2000];
queue<pair<int, int>> q;

void dfs(int v) {
	kekos[v] = true;
	was[v] = 1;
	if (st < v) {
		path[st][v] = was;
	}
	for (int to : t[v]) {
		if (!kekos[to]) {
			dfs(to);
		}
	}
	was[v] = 0;
}

bool edge(int a, int b, int c) {
	if (path[a][b][c] || path[b][a][c] || path[a][c][b] || path[c][a][b] || path[b][c][a] || path[c][b][a]) {
		return true;
	}
	return false;
}

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	//ifstream cin("in.txt");
	cin >> n >> m;
	for (int i = 0; i < n - 1; i++) {
		int u, v;
		cin >> u >> v;
		--u; --v;
		t[u].push_back(v);
		t[v].push_back(u);
	}
	for (int i = 0; i < m; i++) {
		int u, v;
		cin >> u >> v;
		--u; --v;
		if (u > v) {
			swap(u, v);
		}
		g[u].push_back(v);
		g[v].push_back(u);
		inq[u][v] = 1;
	}
	for (st = 0; st < n; st++) {
		memset(kekos, false, sizeof(kekos));
		dfs(st);
	}
	for (int u = 0; u < n; u++) {
		for (int i = 0; i < g[u].size(); i++) {
			for (int j = i + 1; j < g[u].size(); j++) {
				int a = g[u][i], b = g[u][j];
				if (a > b) {
					swap(a, b);
				}
				if (!inq[a][b] && edge(a, b, u)) {
					inq[a][b] = 1;
					q.push({ a, b });
				}
			}
		}
	}
	while (!q.empty()) {
		auto head = q.front();
		q.pop();
		int u = head.first, v = head.second;
		for (int a : g[u]) {
			if (a < v) {
				if (!inq[a][v] && edge(a, v, u)) {
					inq[a][v] = 1;
					q.push({ a, v });
				}
			}
			else {
				if (!inq[v][a] && edge(a, v, u)) {
					inq[v][a] = 1;
					q.push({ v, a });
				}
			}
		}
		for (int a : g[v]) {
			if (a < u) {
				if (!inq[a][u] && edge(a, v, u)) {
					inq[a][u] = 1;
					q.push({ a, u });
				}
			}
			else {
				if (!inq[u][a] && edge(a, v, u)) {
					inq[u][a] = 1;
					q.push({ u, a });
				}
			}
		}
		g[u].push_back(v);
		g[v].push_back(u);
	}
	int ans = 0;
	for (int u = 0; u < n; u++) {
		ans += inq[u].count();
	}
	cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:62:17: error: 'memset' was not declared in this scope
   62 |                 memset(kekos, false, sizeof(kekos));
      |                 ^~~~~~
a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    7 | #include <queue>
  +++ |+#include <cstring>
    8 |
Language: C++

#ifdef _WIN32
#define DEBUG	1
#endif

#define _CRT_SECURE_NO_WARNINGS
#define MATH_PI 3.14159265358979323846264338327950288419716939
#include <iostream>
#include <string.h>
using namespace std;

signed main() {

	if(DEBUG) printf("test");

	char wait_dummy[256];
	scanf("%c", &wait_dummy);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: 'DEBUG' was not declared in this scope
   13 |         if(DEBUG) printf("test");
      |            ^~~~~
Language: C++

#include <iostream>
#include <queue>
#include <vector>

using namespace std;

#define SIZE 2000

typedef pair<int, int> P;

vector<int> tree[SIZE];
int parents[SIZE][SIZE];
int id[SIZE][SIZE];
int ans;

void dfs( int v, int parent, int root )
{
    parents[root][v] = parent;

    for ( auto to : tree[v] )
    {
        if ( to == parent ) continue;
        dfs( to, v, root );
    }
}

void dfs2( int v, int parent, int b )
{
    if ( id[b][v] == v )
    {
        ans++;
        b = v;
    }

    for ( auto to : tree[v] )
    {
        if ( to == parent ) continue;
        dfs2( to, v, b );
    }
}

void add( int a, int b )
{
    if ( id[a][b] == b || id[b][a] == a ) return;

    if ( id[a][b] != -1 )
    {
        add( id[a][b], b );
        return;
    }

    if ( id[b][a] != -1 )
    {
        add( id[b][a], a );
        return;
    }

    id[a][b] = b, id[b][a] = a;

    vector<P> nxt;
    queue<int> que;

    que.push( b );
    while ( !que.empty() )
    {
        int v = que.front();
        que.pop();

        for ( auto to : tree[v] )
        {
            if ( to == parents[a][v] ) continue;

            if ( id[a][to] != -1 )
                nxt.push_back( P( to, b ) );
            else
            {
                id[a][to] = b;
                que.push( to );
            }
        }
    }

    que.push( a );
    while ( !que.empty() )
    {
        int v = que.front();
        que.pop();

        for ( auto to : tree[v] )
        {
            if ( to == parents[b][v] ) continue;

            if ( id[b][to] != -1 )
                nxt.push_back( P( to, a ) );
            else
            {
                id[b][to] = a;
                que.push( to );
            }
        }
    }

    for ( auto e : nxt ) add( e.first, e.second );
}

int main( int argc, char **argv )
{
    int N, M;
    cin >> N >> M;

    for ( int n = 0; n < N - 1; n++ )
    {
        int a, b;
        cin >> a >> b;

        tree[a - 1].push_back( b - 1 );
        tree[b - 1].push_back( a - 1 );
    }

    for ( int i = 0; i < N; i++ ) dfs( i, -1, i );

    memset( id, -1, sizeof( id ) );

    for ( int m = 0; m < M; m++ )
    {
        int c, d;
        cin >> c >> d;

        add( c - 1, d - 1 );
    }

    ans = 0;
    for ( int i = 0; i < N; i++ )
        for ( auto to : tree[i] ) dfs2( to, i, i );

    cout << ( ans >> 1 ) << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:122:5: error: 'memset' was not declared in this scope
  122 |     memset( id, -1, sizeof( id ) );
      |     ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <queue>
  +++ |+#include <cstring>
    3 | #include <vector>
Language: C++

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

typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<P,ll> PLL;
typedef pair<P,P> PP;
typedef vector<ll> llVEC;
typedef vector<P> PVEC;
typedef priority_queue<P,PVEC,greater<P> > PPQ;
typedef priority_queue<ll, llVEC, greater<ll> > llPQ;

#define rep(i,a,n) for(ll i = a;i < n;i++)
#define rrep(i,a,n) for(ll i = n-1; i >= a;i--)
#define LINF (ll)1e18
#define INF (int)1e9
#define fs first
#define sc second

template<typename T>
ll sz(vector<T> &vec){ return (ll)vec.size(); }
template<typename T>
ll sz(priority_queue<T, vector<T>> &pq) {return (ll)pq.size(); }
template<typename T>
ll sz(priority_queue<T, vector<T>, greater<T>> &pq) {return (ll)pq.size(); }
ll sz(string &s) {return (ll)s.size(); } 
ll gcd(ll a,ll b){ return ((!b) ?a :gcd(b, a%b)); }
ll lcm(ll a,ll b){ return a / gcd(a,b) * b; }
bool checkindex(ll i,ll n){ return (i < n && i >= 0); }

int main(){
    ll a,b,t;
    cin >> a >> b >> t;
    cout << t/a *b << endl;
    return 0;
}



Compiler output:
a.cc:3:10: fatal error: atcoder/all: No such file or directory
    3 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

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

int main(){
  int a,b,t;
  cin >> a >> b >>t;
  cout << t/a*b << endl;
	}
}

// cout << fixed << setprecision(15) <<  << endl;


Compiler output:
a.cc:12:1: error: expected declaration before '}' token
   12 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
ll GetDigit(ll num){ return log10(num)+1; } //numの桁数を求める

int main()
{
    int a,b,t;
    cin >> a >> b >> c;
    cout << c/a*b << endl;
    return 0;
}

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

#include<iostream>
using namespace std;
int main(){
  int a,b,t,;
  cin >> a >> b >> t;
  cout << t/a*b <<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:13: error: expected unqualified-id before ';' token
    4 |   int a,b,t,;
      |             ^
Language: C++

#include<iostream>
int main(){
  int a,b,t,;
  cin >> a >> b >> t;
  cout << t/a*b <<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:13: error: expected unqualified-id before ';' token
    3 |   int a,b,t,;
      |             ^
a.cc:4:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |   cin >> a >> b >> t;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:5:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    5 |   cout << t/a*b <<endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:5:19: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    5 |   cout << t/a*b <<endl;
      |                   ^~~~
      |                   std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
int main(){
  int a,b,t,n;
  cin >> a >> b >> t;
  cout << t/a*b <<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |   cin >> a >> b >> t;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:5:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    5 |   cout << t/a*b <<endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:5:19: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    5 |   cout << t/a*b <<endl;
      |                   ^~~~
      |                   std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
using namespace std;

int main(){
  int a, b, t;
  cin >> a >> b >> t;
  int ans = 0;
  for(ll i = a; i <= t; i++) ans += b;
  cout << ans << endl;
  return 0;
}


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

#include<iostream>
using namespace std;

int main(){
  int a, b, t;
  cin >> a >> b >> t;
  ll ans = 0;
  for(ll i = a; i <= t; i++) ans += b;
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'll' was not declared in this scope
    7 |   ll ans = 0;
      |   ^~
a.cc:8:9: error: expected ';' before 'i'
    8 |   for(ll i = a; i <= t; i++) ans += b;
      |         ^~
      |         ;
a.cc:8:17: error: 'i' was not declared in this scope
    8 |   for(ll i = a; i <= t; i++) ans += b;
      |                 ^
a.cc:8:30: error: 'ans' was not declared in this scope; did you mean 'abs'?
    8 |   for(ll i = a; i <= t; i++) ans += b;
      |                              ^~~
      |                              abs
a.cc:9:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int a,b,t,ans=0;
  cin>>a>>b>>t;
  for(int i=a;i<=a+n;i+=a)
    ans+=b;
  cout<<b;
}


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

#include<iostream>
using namespace std;
int main()
{
  int a,b,t,ans=0;
  cin>>a>>b>>t;
  for(int i=a;i<=n;i+=a)
    ans+=b;
  cout<<b;
}

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

#include <bitc/stdc++.h>
using namespace std;
int main() {
  int A, B, C;
  cin >> A >> B >> C;
  int T = (C - C % A) / A;
  cout << T * B << endl;
}

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

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

   int n,k,t;
   cin>>n>>k>>t;
   int h,s=0,i=1;
   while(s<=t)
   {
       s=n*i;
       if(s>t)
       {
           break;2
       }
       h=k*i;
       i++;
   }
   cout<<h<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:19: error: expected ';' before '}' token
   15 |            break;2
      |                   ^
      |                   ;
   16 |        }
      |        ~
Language: C++

#include <iostream>
using namespace std;

int main() {
    int a,b,t;
    cin >> a >> b >> t;
    cout << t/a*b << endl;
}　

Compiler output:
a.cc:8:2: error: extended character 　 is not valid in an identifier
    8 | }　
      |  ^
a.cc:8:2: error: '\U00003000' does not name a type
    8 | }　
      |  ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c;cin>>>a>>b>>c;
  cout<<(c/a)*b<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:18: error: expected primary-expression before '>' token
    4 |   int a,b,c;cin>>>a>>b>>c;
      |                  ^