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

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

const int INF = 1145141919;
int n;
vector<int> et[100000];			//et[i] = 頂点iから行ける頂点の集合
int num[100000];				//num[i] = 頂点iに書かれている値 (なければINF)
pair<int, int> range[100000];	//range[i] = 頂点i以下で矛盾を無くしたいときに頂点iに書ける値の範囲 (閉区間)

//開始頂点の番号を返す
int input() {
	int i;
	cin >> n;
	for (i = 0; i < n - 1; i++) {
		int u, v;
		cin >> u >> v; u--; v--;
		et[u].push_back(v);
		et[v].push_back(u);
	}
	for (i = 0; i < n; i++) { num[i] = INF; }
	
	int k;
	int ret = -1;
	cin >> k;
	for (i = 0; i < k; i++) {
		int v, p;
		cin >> v >> p; v--;
		num[v] = p;
		ret = v;
	}
	return ret;
}

//偶奇チェック
bool dfs(int parent, int v, int mod) {
	if (num[v] != INF && num[v] % 2 != mod) { return false; }
	for (int i = 0; i < et[v].size(); i++) {
		if (et[v][i] == parent) continue;
		if (!dfs(v, et[v][i], (mod + 1) % 2)) return false;
	}
	return true;
}

//値範囲決め (頂点v以下で矛盾がないようにしたとき, 頂点vに入る値の集合は1つの区間になる)
pair<int, int> dfs2(int parent, int v) {
	pair<int, int> ret = pair<int, int>(-INF, INF);
	
	if (num[v] != INF) ret = pair<int, int>(num[v], num[v]);
	
	for (int i = 0; i < et[v].size(); i++) {
		if (et[v][i] == parent) continue;
		pair<int, int> res = dfs2(v, et[v][i]);
		ret.first = max(ret.first, res.first - 1);
		ret.second = min(ret.second, res.second + 1);
	}
	return (range[v] = ret);
}

//値を根から決めていく
void dfs3(int parent, int v) {
	if (parent == -1) { num[v] = range[v].first; }
	else {
		if (range[v].first <= num[parent] - 1 && num[parent] - 1 <= range[v].second) { num[v] = num[parent] - 1; }
		else { num[v] = num[parent] + 1; }
	}
	for (int i = 0; i < et[v].size(); i++) {
		if (parent == et[v][i]) continue;
		dfs3(v, et[v][i]);
	}
}

signed main() {
	int start = input();
	if (!dfs(-1, start, num[start] % 2)) { cout << "No" << endl; return 0; }
	pair<int, int> res = dfs2(-1, start);
	if (res.first > res.second) { cout << "No" << endl; return 0; }
	
	assert(0);
	
	cout << "Yes" << endl;
	dfs3(-1, start);
	for (int i = 0; i < n; i++) {
		cout << num[i] << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:79:9: error: 'assert' was not declared in this scope
   79 |         assert(0);
      |         ^~~~~~
a.cc:3:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    2 | #include <vector>
  +++ |+#include <cassert>
    3 | using namespace std;
Language: C++

#include <iostream>
#include <list>
#include <queue>
using namespace std;

int N,K;
int num[100001];
int bottom[100001];
int top[100001];
int dis[100001];
list<int> connect[100001];
int s, e;
int a;
queue<int>Q;

int main() {
	cin >> N;
	for (int i = 0; i < N - 1; i++) {
		cin >> s >> e;
		connect[s].push_back(e);
		connect[e].push_back(s);
	}
	for (int i = 1; i <= N; i++) {
		num[i] = -1;
		bottom[i] = -1;
		top[i] = -1;
	}
	cin >> K;
	for (int i = 0; i < K; i++) {
		cin >> a;
		cin >> num[a];
		bottom[a] = num[a];
		top[a] = num[a];
	}
	for (int i = 1; i <= N; i++) {
		if (num[i] != -1) {
			for (int j = 1; j <= N; j++) {
				dis[j] = INT_MAX;
			}
			dis[i] = 0;
			Q.push(i);
			while (!Q.empty()) {
				for (auto j = connect[Q.front()].begin(); j != connect[Q.front()].end(); ++j) {
					if (num[(*j)]==-1) {
						if ((dis[Q.front()] + 1) < dis[(*j)]) {
							dis[(*j)] = dis[Q.front()] + 1;
							if (bottom[(*j)] == -1) {
								bottom[(*j)] = bottom[i] - dis[(*j)];
								if (bottom[(*j) < 0]) {
									bottom[(*j)] *= -1;
									bottom[(*j)] = bottom[(*j)] % 2;
								}
								top[(*j)] = top[i] + dis[(*j)];
							}
							else {
								bottom[(*j)] = max(bottom[i] - dis[(*j)], bottom[(*j)]);
								if (bottom[(*j) < 0]) {
									bottom[(*j)] *= -1;
									bottom[(*j)] = bottom[(*j)] % 2;
								}
								top[(*j)] = min(top[i] + dis[(*j)], top[(*j)]);
								if (top[(*j)] < bottom[(*j)]) {
									cout << "No\n";
									return 0;
								}
								if (top[(*j)] - bottom[(*j)] % 2 == 0) {
									cout << "No\n";
									return 0;
								}
							}
							Q.push((*j));
						}
					}
					else {
						if (abs(num[i] - num[(*j)]) > dis[(*j)]) {
							cout << "No\n";
							return 0;
						}
					}
				}
				Q.pop();
			}
			
		}
	}
	cout << "Yes\n";
	for (int i = 1; i <= N; i++) {
		cout << bottom[i] << "\n";
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:42: error: 'INT_MAX' was not declared in this scope
   38 |                                 dis[j] = INT_MAX;
      |                                          ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <queue>
  +++ |+#include <climits>
    4 | using namespace std;
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
using namespace std;

int INF = 1145141919;
int n;
int parents[100000];						//
vector<int> et[100000];		//et[i]  = 頂点iから行ける頂点の集合
int num[100000];			//num[i] = 頂点iに書かれている数 (なければINF)

//頂点vから書き込みスタート
//val…vからdepだけ登った頂点で書き込まれた値, なければINF
//戻り値…頂点v以下の部分木で矛盾がないかどうか
bool dfs(int parent, int v, int val, int dep) {
	parents[v] = (parent == -1 ? v : parent);
	
	if (val != INF && num[v] != INF) {
		if (dep < abs(val - num[v]) || abs(val - num[v]) % 2 != dep % 2) return false;
		
		//depさかのぼる
		/*int tmp = dep;
		int id = v;
		for (int i = 0; i <= tmp; i++) {
			num[v] = ;
			*/
	}
	
	int i;
	bool ret = true;
	for (i = 0; i < et[v].size(); i++) {
		if (et[v][i] == parent) continue;
		if (num[v] == INF) ret &= dfs(v, et[v][i], val, dep + 1);
		else ret &= dfs(v, et[v][i], num[v], 1);
	}
	return ret;
}

//探索開始頂点の番号を返す
void input() {
	cin >> n;
	for (int i = 0; i < n - 1; i++) {
		int u, v;
		cin >> u >> v;
		u--; v--;
		et[u].push_back(v);
		et[v].push_back(u);
	}
	
	for (int i = 0; i < n; i++) {
		num[i] = INF;
	}
	
	int k;
	cin >> k;
	for (int i = 0; i < k; i++) {
		int v, p;
		cin >> v >> p;
		v--;
		num[v] = p;
	}
}

signed main() {
	bool flag = true;
	for (int i = 0; i < n; i++) {
		flag &= dfs(-1, i, num[i], 0))
	}
	if (flag) cout << "Yes" << endl;
	else cout << "No" << endl;
	
	for (int i = 0; i < n; i++) {
		cout << num[i] << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:78:46: error: expected ';' before ')' token
   78 |                 flag &= dfs(-1, i, num[i], 0))
      |                                              ^
      |                                              ;
Language: C++

#include <bits/stdc++.h>
#define MAX_N 100000
#define INF 10000000000000ll
#define int (long long)
using namespace std;
using pi = pair<int, int>;

vector<int> G[MAX_N];

sined main()
{
	int N, K;
	bool res = true;
	cin >> N;
	vector<pi> val(N, pi(0, INF));
	vector<bool> used((N - 1) * 2, false);
	for (int i = 0, A, B; i < N - 1;i++) {
		cin >> A >> B;
		G[A - 1].push_back(B - 1);
		G[B - 1].push_back(A - 1);
	}
	vector<int> zero;
	cin >> K;
	for (int i = 0, v; i < K;i++) {
		cin >> v;
		cin >> val[v - 1].first;
		val[v - 1].second = 0;
		zero.push_back(v - 1);
	}
	for (auto &v : zero) {
		queue<int> q;
		q.push(v);
		while (!q.empty()) {
			int vv = q.front(); q.pop();
			for (auto &next : G[vv]) {
				if (val[next] == pi(0, INF) || ((val[vv].first - val[next].first + val[vv].second + val[next].second) % 2 == 1
					&& abs(val[vv].first - val[next].first) <= val[vv].second + val[next].second + 1)) {
					if (val[next] != pi(0, INF) && val[vv].first + val[vv].second + 1 >= val[next].first + val[next].second
						&& val[vv].first - val[vv].second - 1 <= val[next].first - val[next].second) {
						;
					}
					else {
						int mx = min(val[vv].first + val[vv].second + 1, val[next].first + val[next].second);
						int mn = max(val[vv].first - val[vv].second - 1, val[next].first - val[next].second);
						val[next] = pi((mx + mn) / 2, (mx - mn) / 2);
						q.push(next);
					}
				}
				else {
					res = false;
					break;
				}
			}
			if (!res) {
				break;
			}
		}
		if (!res) {
			break;
		}
	}


	if (res) {
		cout << "Yes" << endl;
		for (int i = 0; i < N;i++) {
			cout << val[i].first - val[i].second << endl;
		}
	}
	else {
		cout << "No" << endl;
	}
	return 0;
}


Compiler output:
a.cc:4:19: error: wrong number of template arguments (1, should be 2)
    4 | #define int (long long)
      |                   ^~~~
a.cc:6:17: note: in expansion of macro 'int'
    6 | using pi = pair<int, int>;
      |                 ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_pair.h:89:12: note: provided for 'template<class _T1, class _T2> struct std::pair'
   89 |     struct pair;
      |            ^~~~
a.cc:4:19: error: template argument 1 is invalid
    4 | #define int (long long)
      |                   ^~~~
a.cc:8:8: note: in expansion of macro 'int'
    8 | vector<int> G[MAX_N];
      |        ^~~
a.cc:4:19: error: template argument 2 is invalid
    4 | #define int (long long)
      |                   ^~~~
a.cc:8:8: note: in expansion of macro 'int'
    8 | vector<int> G[MAX_N];
      |        ^~~
a.cc:4:23: error: expected unqualified-id before ')' token
    4 | #define int (long long)
      |                       ^
a.cc:8:8: note: in expansion of macro 'int'
    8 | vector<int> G[MAX_N];
      |        ^~~
a.cc:10:1: error: 'sined' does not name a type; did you mean 'signed'?
   10 | sined main()
      | ^~~~~
      | signed
Language: C++

/*
By Snickeen
*/
#include<bits/stdc++.h>
//#pragma comment(linker, "/STACK:102400000,102400000")
#include <stdio.h>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <limits.h>
#include <math.h>
#include <algorithm>
#include <deque>
#include <queue>
#include <stack>
#include <list>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <string>
#include <vector>
#include <bitset>
#include <functional>
using namespace std;
typedef long long  LL;
typedef unsigned long long ULL;
typedef double db;
typedef long double ldb;
#define rep(i,a,b) for(i=a;i<b;i++)
#define repu(i,a,b) for(i=a;i<=b;i++)
#define repd(i,a,b) for(i=a;i>=b;i--)
#define repc(i,a,b,c) for(i=a;i<b;i+=c)
#define repcu(i,a,b,c) for(i=a;i<=b;i+=c)
#define repcd(i,a,b,c) for(i=a;i>=b;i-=c)
#define FIN freopen("input.in","r",stdin)
#define FOUT freopen("output.out","w",stdout)
#define CC(a) memset(a,0,sizeof(a))
#define MST(a,b) memset(a,b,sizeof(a))
#define PII pair<int,int>
#define PLL pair<LL,LL>
#define VI vector<int>
#define VL vector<LL>
#define VII vector<PII >
#define VLL vector<PLL >
#define all(x) x.begin(),x.end()
#define mp make_pair
#define pb push_back
#define pf push_front
#define FF first
#define SS second

template<typename T>inline void gn(T &x){
	x=0;T f=1;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();}
	x*=f;
}
template<typename T>inline void gt(T x){
	if(!x)return;
	gt(x/10);putchar(x%10+'0');
}
 
const LL MAXN=1e5+10;
LL t,n,m,ans,tot;
LL MOD=1e9+7,inf=0x1f1f1f1f;
db eps=1e-5;

LL f[MAXN],dg[MAXN],jo[MAXN];
VL e[MAXN],g[MAXN];
PLL node[MAXN];
queue<PLL> q;
PLL x,y;

LL bfs(){
	LL i,j,k,l,id,u,v;
	while(q.size()){
		x=q.front();q.pop();
		l=e[x.FF].size();
		y=node[x.FF];
		y.FF++;y.SS++;
		id=((x.SS-1)^1)+1;
		for(i=0;i<l;i++){
			k=e[x.FF][i];
			if(jo[k]==jo[x.FF])return 0;
			if(node[k].FF>y.SS|node[k].SS<y.FF)return 0;
			jo[k]=id;
			u=max(node[k].FF,y.FF);
			v=min(node[k].SS,y.SS);
			if(u>node[k].FF||v<node[k].SS)q.push({k,id});
		}
	}
}

int main()
{
	//ios_base::sync_with_stdio(false);cin.tie(0);
	LL i,j,k,l,r,ca=0,u=0,v=0,w;
	cin>>n;
	rep(i,1,n){
		cin>>u>>v;
		e[u].pb(v);
		e[v].pb(u);
		d[u]++;d[v]++;
	}
	cin>>m;
	repu(i,1,m){
		cin>>u>>v;
		node[u]={v,v};
		f[u]=v&1;jo[u]=f[u]+1;
		q.push({u,jo[u]});
	}
	k=bfs();
	if(!k)return cout<<"No\n",0;
	cout<<"Yes\n";
	for(i=1;i<=n;i++)cout<<node[i].FF<<endl;
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:108:17: error: 'd' was not declared in this scope
  108 |                 d[u]++;d[v]++;
      |                 ^
a.cc: In function 'LL bfs()':
a.cc:97:1: warning: control reaches end of non-void function [-Wreturn-type]
   97 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
inline void read(int &x) {
  x = 0;
  bool flag = 0;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') {
      flag = 1;
    }
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - 48;
    ch = getchar();
  }
  if (flag) {
    x = -x;
  }
}
const int N = 300005;
int w, h, n, x[N], y[N], ans;
int px[N], nx, py[N], ny;
struct SegmentTree {
  int l[N << 2], r[N << 2];
  int val[N << 2], lazy[N << 2];
  inline void pushup(int p) {
    val[p] = max(val[p << 1], val[p << 1 | 1]);
  }
  void build(int p, int L, int R) {
    l[p] = L, r[p] = R;
    val[p] = -py[L] + w;
    lazy[p] = 0;
    if (L == R) {
      return;
    }
    int mid = l[p] + r[p] >> 1;
    build(p << 1, L, mid);
    build(p << 1 | 1, mid + 1, R);
  }
  inline void tag(int p, int v) {
    val[p] += v;
    lazy[p] += v;
  }
  inline void pushdown(int p) {
    if (lazy[p]) {
      tag(p << 1, lazy[p]);
      tag(p << 1 | 1, lazy[p]);
      lazy[p] = 0; 
    }
  }
  void modify(int p, int L, int R, int v) {
    if (l[p] >= L && r[p] <= R) {
      tag(p, v);
      return;
    }
    pushdown(p);
    int mid = l[p] + r[p] >> 1;
    if (mid >= L) {
      modify(p << 1, L, R, v);
    }
    if (mid < R) {
      modify(p << 1 | 1, L, R, v);
    }
    pushup(p);
  }
  inline int query() {
    return val[1];
  }/
} smt;
inline void process() {
  static int lef[N], rig[N];
  smt.build(1, 1, ny);
  for (int i = 1; i <= ny; ++i) {
    lef[i] = 0;
    rig[i] = w;
  }
  for (int i = 1; i <= n; ++i) {
    int X = px[x[i]];
    if (X <= w / 2) {
      lef[y[i]] = max(lef[y[i]], X);
    } else {
      rig[y[i]] = min(rig[y[i]], X);
    }
  }
  static int sl[N], sr[N];
  int tl = 0, tr = 0;
  for (int i = 1; i <= ny; ++i) {
    ans = max(ans, 2 * (py[i] + smt.query()));
    if (i > 1) {
      smt.modify(1, sl[tl], i - 1, -lef[i]);
    }
    while (tl && lef[sl[tl]] < lef[i]) {
      smt.modify(1, sl[tl - 1], sl[tl] - 1, lef[sl[tl]] - lef[i]);
      --tl;
    }
    sl[++tl] = i;
    if (i > 1) {
      smt.modify(1, sr[tr], i - 1, rig[i] - w);
    }
    while (tr && rig[sr[tr]] > rig[i]) {
      smt.modify(1, sr[tr - 1], sr[tr] - 1, rig[i] - rig[sr[tr]]);
      --tr;
    }
    sr[++tr] = i;
  }
}
int main() {
  scanf("%d%d%d", &w, &h, &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d", &x[i], &y[i]);
    px[++nx] = x[i];
    py[++ny] = y[i];
  }
  px[++nx] = 0;
  px[++nx] = w;
  py[++ny] = 0;
  py[++ny] = h;
  sort(px + 1, px + nx + 1);
  sort(py + 1, py + ny + 1);
  nx = unique(px + 1, px + nx + 1) - px - 1;
  ny = unique(py + 1, py + ny + 1) - py - 1;
  for (int i = 1; i <= n; ++i) {
    x[i] = lower_bound(px + 1, px + nx + 1, x[i]) - px;
    y[i] = lower_bound(py + 1, py + ny + 1, y[i]) - py;
  }
  process();
  swap(w, h);
  swap(px, py);
  swap(nx, ny);
  swap(x, y);
  process();
  printf("%d\n", ans);
  return 0;
}

Compiler output:
a.cc:69:4: error: expected unqualified-id before '/' token
   69 |   }/
      |    ^
Language: C++

#include<bits/stdc++.h>
#define mo 1000000007
#define pi 3.1415926535898
#define eps 1e-9 
using namespace std;
long long read(){
    long long xx=0,flagg=1;
    char ch=getchar();
    while((ch<'0'||ch>'9')&&ch!='-')
        ch=getchar();
    if(ch=='-'){
        flagg=-1;
        ch=getchar();
    }
    while(ch>='0'&&ch<='9'){
        xx=xx*10+ch-'0';
        ch=getchar();
    }
    return xx*flagg;
}
void pus(long long xx,long long flagg){
    if(xx<0){
        putchar('-');
        xx=-xx;
    }
    if(xx>=10)
        pus(xx/10,0);
    putchar(xx%10+'0');
    if(flagg==1)
        putchar(' ');
    if(flagg==2)
        putchar('\n');
    return;
}
int w,h,n,i,j,k,yy,ans,a[300005],b[300005],xia,shang,head,tail,zhan[300005];
struct nyh{
	int x,y;
}o[300005];
bool cmp(nyh u,nyh v){
	return u.x<v.x||u.x==v.x&&u.y<v.y;
}
int maxx(int u,int v){
	return u>v?u:v;
}
int minn(int u,int v){
	return u<v?u:v;
}
void solve(int u,int v){
	int mid=((u+v)>>1);
	if(u==v)
		return;
	solve(u,mid);
	solve(mid+1,v);
	for(i=mid,xia=0,shang=h;i>=u;i--){
		a[i]=xia;
		b[i]=shang;
		if(o[i].y>=yy) shang=minn(shang,o[i].y);
		if(o[i].y<=yy) xia=maxx(xia,o[i].y);
	}
	for(i=mid+1,xia=0,shang=h;i<=v;i++){
		a[i]=xia;
		b[i]=shang;
		if(o[i].y>=yy) shang=minn(shang,o[i].y);
		if(o[i].y<=yy) xia=maxx(xia,o[i].y);
	}
	head=1;tail=0;
	for(i=mid,j=mid+1;i>=u;i--){
        while(j<=v&&a[j]<=a[i]){
            while(head<=tail&&b[zhan[tail]]+o[zhan[tail]].x<=b[j]+o[j].x)
            	tail--;
            tail++;
            zhan[tail]=j;
            j++;
        }
        while(head<tail&&b[i]+o[zhan[head]].x<=b[zhan[head+1]]+o[zhan[head+1]].x)
        	head++;
        for(k=0;k<=5&&head+k<=tail)
    	    ans=maxx(ans,(o[zhan[head+k]].x-o[i].x+min(b[i],b[zhan[head+k]])-a[i])<<1);
    }
}
void work(){
	sort(o+1,o+n+1,cmp);
	yy=(h>>1);
	o[0].x=0;
	o[0].y=yy;
	o[n+1].x=w;
	o[n+1].y=yy;
	solve(0,n+1);
}
int main(){
	//freopen("a.in","r",stdin);
	//freopen("a.out","w",stdout);
	w=read();h=read();n=read();
	for(i=1;i<=n;i++){
		o[i].x=read();
		o[i].y=read();
	}
	ans=max(w,h)*2+2;
	work();
	swap(w,h);
	for(i=1;i<=n;i++)
		swap(o[i].x,o[i].y);
	work();
	pus(ans,2);
	return 0;
}

Compiler output:
a.cc: In function 'void solve(int, int)':
a.cc:77:35: error: expected ';' before ')' token
   77 |         for(k=0;k<=5&&head+k<=tail)
      |                                   ^
      |                                   ;
Language: C++

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cassert>
#include <complex>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <sstream>
#include <ctime>
#include <cctype>
#include <set>
#include <map>
#include <queue>
#include <bitset>
#include <deque>
#include <stack>
#include <memory.h>
using namespace std;
typedef long long ll;
#define mp make_pair
vector<int> a[100100];
priority_queue<pair<int, int>,vector<pair<int, int> >,greater<pair<int, int> > > pq;
int tag[100100];
bool dfs(int now, int par){
	for(int i=0;i<a[i].size();i++){
		if(a[now][i] == par) continue;
		if(abs(tag[-tag[a[now][i]])!=1){
			return false;
		}
		if(!dfs(a[now][i], now)){
			return false;
		}
	}
	return true;
}
int main(){
	int n;
	cin >> n;
	for(int i=0;i<n-1;i++){
		int v, g;
		cin>>v>>g;
		v--, g--;
		a[v].push_back(g);
		a[g].push_back(v);
	}
	int m;
	cin>>m;
	memset(tag,-1,sizeof(tag));
	for(int i=0;i<m;i++){
		int v,g;
		cin>>v>>g;
		v--;
		tag[v]=g;
		pq.push(mp(g,v));
	}
	while(!pq.empty()){
		pair<int, int> p = pq.top();
		pq.pop();
		int v=p.second;
		for(int i=0;i<a[i].size();i++){ 
			if(tag[a[v][i]] == -1){
				tag[a[v][i]] = tag[v]+1;
				pq.push(mp(tag[a[v][i]],a[v][i]));
			}
		}
	}
	if(!dfs(0, -1)){
		cout<<"No";
	}
	else{
		cout<<"Yes"<<endl;
		for(int i=0;i<n;i++){
			cout<<tag[i]<<endl;
		}
	}
	return 0;
}


Compiler output:
a.cc: In function 'bool dfs(int, int)':
a.cc:33:43: error: expected ']' before ')' token
   33 |                 if(abs(tag[-tag[a[now][i]])!=1){
      |                                           ^
      |                                           ]
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define maxn 1500000
#define int long long
#define INF 199999999
int W, H, n, top, top2, S[maxn], S2[maxn];
int ans, mark[maxn], mx[maxn];

int read()
{
	int x = 0, k = 1;
	char c; c = getchar();
	while(c < '0' || c > '9') { if(c == '-') k = -1; c = getchar(); }
	while(c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
	return x * k;
}

struct node
{
	int x, y;
	friend bool operator <(const node& a, const node& b)
	{ return a.y < b.y; }
}P[maxn];

void Push_Down(int p)
{
	if(!mark[p]) return;
	mark[p << 1] += mark[p], mark[p << 1 | 1] += mark[p];
	mx[p << 1] += mark[p], mx[p << 1 | 1] += mark[p];
	mark[p] = 0;
}

void Update(int p, int l, int r, int L, int R, int x)
{
	if(L > R) return;
	if(L <= l && R >= r)
	{
		mark[p] += x, mx[p] += x;
		return;
	}
	if(L > r || R < l) return;
	Push_Down(p);
	int mid = (l + r) >> 1;
	Update(p << 1, l, mid, L, R, x); Update(p << 1 | 1, mid + 1, r, L, R, x);
	mx[p] = max(mx[p << 1], mx[p << 1 | 1]);
}

int Query(int p, int l, int r, int L, int R)
{
	if(L <= l && R >= r) return mx[p];
	if(L > r || R < l) return 0;
	int mid = (l + r) >> 1; Push_Down(p);
	return max(Query(p << 1, l, mid, L, R), Query(p << 1 | 1, mid + 1, r, L, R));
}

void Work()
{
	memset(mx, 0, sizeof(mx)); memset(mark, 0, sizeof(mark));
	top = top2 = 0; int mid = W >> 1; 
	for(int i = 1; i <= n; i ++)
	{
		if(i > 1) ans = max(ans, (P[i].y + Query(1, 1, n, 1, i - 1)) * 2);
		Update(1, 1, n, i, i, W - P[i].y);
		if(P[i].x <= mid)
		{
			int last = 0, rec = i;
			while(top && P[S[top]].x <= P[i].x)
			{
				Update(1, 1, n, S[top], rec - 1, -(P[i].x - last));
				last = P[S[top]].x, rec = S[top]; top --;	
			}
			Update(1, 1, n, S[top], rec - 1, -(P[i].x - last));
			S[++ top] = i;
		}
		else
		{
			int last = W, rec = i;
			while(top2 && P[S2[top2]].x >= P[i].x)
			{
				Update(1, 1, n, S2[top2], rec - 1, -(P[i].x - last));
				last = P[S2[top2]].x, rec = S2[top2], top2 --;	
			}
			Update(1, 1, n, S2[top2], rec - 1, -(P[i].x - last));
			S2[++ top2] = i;
		}
	}
}

int main()
{
	W = read(), H = read(), n = read();
	int X1 = 0, Y1 = 0, X2 = INF, Y2 = INF;
	for(int i = 1; i <= n; i ++) P[i].x = read(), P[i].y = read();
	for(int i = 1; i <= n; i ++)
	{
		X1 = max(X1, P[i].x), Y1 = max(Y1, P[i].y);
		X2 = min(X2, P[i].x), Y2 = min(Y2, P[i].y);
	}
	ans = max(ans, (H + max(X2, (W - X1))) * 2);
	ans = max(ans, (W + max(Y2, (H - Y1))) * 2);
	sort(P + 1, P + 1 + n); Work();
	for(int i = 1; i <= n; i ++) swap(P[i].x, P[i].y);
	swap(W, H); sort(P + 1, P + 1 + n); Work();
	printf("%d\n", ans);
	return 0;
}

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

#include<bits/stdc++.h>
#define N 111111
#define M 222222
using namespace std;
int A,B,n,x,y,t,i,j,now,an,maxT;
struct P{int x,y;}p[N];
multiset<int>S,T;
multiset<int>::iterator it,il,ir;
bool cmp(P a,P b){return a.x<b.x;}
void add(int x){
	//printf("ADD %d\n",x);
	ir=S.upper_bound(x);
	il=--S.upper_bound(x);
	//printf("%d %d\n",*ir,*il);
	T.erase(T.find((*ir)-(*il)));
	S.insert(x);
	T.insert(x-(*il));
	T.insert((*ir)-x);
	it=T.end();it--;
	maxT=*it;
}
void del(int x){
	//printf("DEL %d\n",x);
	S.erase(S.find(x));
	ir=S.upper_bound(x);
	il=--S.upper_bound(x);
	T.insert((*ir)-(*il));
	T.erase(T.find(x-(*il)));
	T.erase(T.find((*ir)-x));
	it=T.end();it--;
	maxT=*it;
}
int main(){
	scanf("%d%d%d",&A,&B,&n);
	
	an=max(A,B);
	S.insert(0);S.insert(B);T.insert(B);maxT=B;
	for(i=1;i<=n;i++){
		scanf("%d%d",&x,&y);
		if(x>0&&x<A&&y>0&&y<B)p[++t]=P{x,y};
	}n=t;
	sort(p+1,p+n+1,cmp);
	p[0]=P{0,0};
	p[n+1]=P{A,0};
	for(i=j=1;i<=n+1;i++){
		if(j<i)j=i;
		now=p[j].x-p[i-1].x+maxT;
		printf("%d %d      %d %d %d\n",i,j,now,p[j+1].x-p[i-1].x+maxT,maxT);
		for(;j<=n;){
			now=p[j].x-p[i-1].x+maxT;
			add(p[j].y);
			
			printf("%d %d      %d %d %d\n",i,j,now,p[j+1].x-p[i-1].x+maxT,maxT);
			if(p[j+1].x-p[i-1].x+maxT>now)now=p[j+1].x-p[i-1].x+maxT,j++,puts("??");
			else {del(p[j].y);puts("!!");break;}
		}
		//printf("%d %d %d\n",i,j,now);
		an=max(an,now);
		if(j!=i)del(p[i].y);
	}
	printf("%d",an*2);fdsafdasf
}

Compiler output:
a.cc: In function 'int main()':
a.cc:61:27: error: 'fdsafdasf' was not declared in this scope
   61 |         printf("%d",an*2);fdsafdasf
      |                           ^~~~~~~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> PII;

const int MM = 1e9 + 7;
const double eps = 1e-8;
const int MAXN = 2e6 + 10;

int n, m;
int W, H;


struct Pt{
	ll x, y;
} a[MAXN];

ll ans;

void read(){
	scanf("%d%d%d", &W, &H, &n);
	for(int i = 1; i <= n; i++){
		scanf("%lld%lld", &a[i].x, &a[i].y);
	}
	/*
	a[++n] = (Pt){0,0};
	a[++n] = (Pt){W,H};
	a[++n] = (Pt){0,H};
	a[++n] = (Pt){W,0};*/
}

ll work(){
	sort(a+1, a+n+1, [](const Pt&a, const Pt&b){
		return a.x==b.x?a.y<b.y:a.x<b.x;
	});
	for(int i = 1; i < n; i++)
		ans = max(ans, (a[i+1].x-a[i].x)*2+H*2)
	for(int i = 1; i <= n; i++){
		ll l = 0, r = H;
		for(int j = i + 1; j <= n; j++){
			ans = max(ans, (r-l)*2+2*(a[j].x-a[i].x));
			if (a[j].y >= a[i].y)
				r = min(r, a[j].y);
			if (a[j].y <= a[i].y)
				l = max(l, a[j].y);
			if ((r-l+W-a[i].x)*2 <= ans) break;
		} 
	}
}

void solve(){
	ans = 0;
	work();
/*	for(int i = 1; i <= n; i++)
		swap(a[i].x, a[i].y);
	swap(W, H);
	work();*/
	printf("%lld\n", ans);
}

void printans(){

}
	

int main(){
	int T = 1;
//	cin>>T;
	while(T--){
		read();
		solve();
		printans();
	}
	return 0;
} 


Compiler output:
a.cc: In function 'll work()':
a.cc:39:56: error: expected ';' before 'for'
   39 |                 ans = max(ans, (a[i+1].x-a[i].x)*2+H*2)
      |                                                        ^
      |                                                        ;
   40 |         for(int i = 1; i <= n; i++){
      |         ~~~                                             
a.cc:40:24: error: 'i' was not declared in this scope
   40 |         for(int i = 1; i <= n; i++){
      |                        ^
a.cc:51:1: warning: no return statement in function returning non-void [-Wreturn-type]
   51 | }
      | ^
Language: C++

#include <iostream>
#include<vector>
using namespace std;
int main(void){
   int n;
   cin >> n;
   string s,t;
   cin >> s;
   cin >> t;
   int res = 0;
   for(int i = 0;i <= n;i++){
         if(s.substr(i,n - i) == t.substr(0,i))res =i;
   }
   cout << 2 * n - i << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:20: error: 'i' was not declared in this scope
   14 |    cout << 2 * n - i << endl;
      |                    ^
Language: C++

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

int main(){
  int n;cin>>n;
  string s,t;
  cin>>s>>t;
  for(int i=0;i<n;i++){
    if(s.subsrt(i,n-i)==t.subsrt(0,n-i)){
      cout<<i+n<<endl;
      return 0;
    }
  }
  cout<<2*n<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'subsrt'; did you mean 'substr'?
   10 |     if(s.subsrt(i,n-i)==t.subsrt(0,n-i)){
      |          ^~~~~~
      |          substr
a.cc:10:27: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'subsrt'; did you mean 'substr'?
   10 |     if(s.subsrt(i,n-i)==t.subsrt(0,n-i)){
      |                           ^~~~~~
      |                           substr
Language: C

#include<bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define pb push_back
using namespace std;
using ll = long long;
using vi = vector<ll>;
using pi = pair<ll, ll>;
const int maxn = 5050, mlg = 17, mod = 1e9 + 7;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
string s, t;
int main() {
	cin.tie(0)->sync_with_stdio(0);
	int n;
	cin >> n >> s >> t;
	int ans = 2*n;
	for(int i = 0; i <= s.size(); i++) {
		int ok = 1;
		for(int x = i, y = 0; y < t.size() && x < s.size(); x++, y++) {
			ok &= s[x] == t[y];
		}
		if(ok) ans = min(ans, i+n);
	}
	cout << ans;
}


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

#include <bits/stdc++.h>
using namespace std;
int main(){
int counter1,counter2;
int N;
cin>>N;
counter1=0;
counter2=0;
int answer=0;
int counter=0;
  int i=0;
string S,T; cin>>S>>T;
while(counter1<N){
if(S.at(i)==T.at(counter2)){
answer++;
counter2++;
i++;}
else {
counter=max(answer,counter);
answer=0;
counter2=0;
i=0;
counter1++;
continue;}}
cout<<2*N-counter<<endl;}}


Compiler output:
a.cc:25:26: error: expected declaration before '}' token
   25 | cout<<2*N-counter<<endl;}}
      |                          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
int counter1,counter2;
int N;
cin>>N;
counter1=0;
counter2=0;
int answer=0;
int counter=0;
string S,T; cin>>S>>T;
while(counter1<N){
if(S.at(i)==T.at(counter2)){
answer++;
counter2++;}
else {
counter=max(answer,counter);
answer=0;
counter2=0;counter1++;
continue;}}
cout<<2*N-counter<<endl;}}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'i' was not declared in this scope
   13 | if(S.at(i)==T.at(counter2)){
      |         ^
a.cc: At global scope:
a.cc:21:26: error: expected declaration before '}' token
   21 | cout<<2*N-counter<<endl;}}
      |                          ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  string S,T;
  cin>>N>>S>>T;
  int kasanari=0;
  for(int i=0;i<N;i++){
    bool flag=true;
    for(int j=i;j<N;j++){
      if(S.at(j)!=T.at(j-i)){
        flag=false;
      }
    }
    if(flag){
      count=i;
      break;
    }
    if(i==N-1){
      count=N;
    }
  }
  cout<<N+count<<endl;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: overloaded function with no contextual type information
   16 |       count=i;
      |             ^
a.cc:20:13: error: overloaded function with no contextual type information
   20 |       count=N;
      |             ^
a.cc:23:10: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator+'
   23 |   cout<<N+count<<endl;
      |         ~^~~~~~
Language: C++

#include <iostream>

using namespace std;

int main(){

  string s, t;
  
  cin >> s;
  cin >> t;
  
  bool exist  = false;
  string a = " ";
  for(int i=0;i<s.size();i++){

    
    if(s[i] == t[0]){
      
      for(int j = i+1 ;j<s.size();j++){

        if(s[j] != t[j-i]){
          break;
        }
        exist = true;
      }
      
    }
    
    if(exist) {
      
      for(int j=0;j<=i;j++){
        a += s[i];
      }

  }
    
  }
  
  if(exist){
    a += t;
    cout << a << endl;
  }
  else{
    s += t;
    cout << s << endl;
  }
  
  
    
    
    
  

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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  string s,t;
  cin >> s >> t;
  for(int i=0;i<=n;i++){
    if(s.substr(i,s.size())==t.substr(0,t.size()-i){
      cout << n+i;
      return 0;
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:52: error: expected ')' before '{' token
    9 |     if(s.substr(i,s.size())==t.substr(0,t.size()-i){
      |       ~                                            ^
      |                                                    )
a.cc:13:3: error: expected primary-expression before '}' token
   13 |   }
      |   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  string s,t;
  cin >> s >> t;
  for(int i=0;i<=n;i++){
    if(s.substr(i,s.size())==t.substr(0,t.stze()-i){
      cout << n+i;
      return 0;
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:43: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'stze'; did you mean 'size'?
    9 |     if(s.substr(i,s.size())==t.substr(0,t.stze()-i){
      |                                           ^~~~
      |                                           size
a.cc:9:52: error: expected ')' before '{' token
    9 |     if(s.substr(i,s.size())==t.substr(0,t.stze()-i){
      |       ~                                            ^
      |                                                    )
a.cc:13:3: error: expected primary-expression before '}' token
   13 |   }
      |   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  string s,t;
  cin >> s >> t;
  for(int i=0;i<=n;i++){
    if(s.substr(i,s.size())==t.substr(0,t.stze-i){
      cout << n+i;
      return 0;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:43: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'stze'; did you mean 'size'?
    9 |     if(s.substr(i,s.size())==t.substr(0,t.stze-i){
      |                                           ^~~~
      |                                           size
a.cc:9:50: error: expected ')' before '{' token
    9 |     if(s.substr(i,s.size())==t.substr(0,t.stze-i){
      |       ~                                          ^
      |                                                  )
a.cc:13:3: error: expected primary-expression before '}' token
   13 |   }
      |   ^
Language: C++

//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <algorithm>
#define rep(i,n) for(int i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
using namespace std;
using Graph = vector<vector<int>>;
typedef long long ll;
const int mod= 1e+9+7;

int main(){
    int n; cin>>n;
    string s,t; cin>>s>>t;
    int ans=n*2;
    int cnt;
    rep(i,n){
        if(s.sunstr(i,n-i)==t.substr(0,n-i)){
            cnt=n;
        }
    }
    cout<<ans-cnt<<endl;
}








Compiler output:
a.cc: In function 'int main()':
a.cc:17:14: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'sunstr'; did you mean 'substr'?
   17 |         if(s.sunstr(i,n-i)==t.substr(0,n-i)){
      |              ^~~~~~
      |              substr
Language: C++

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define ALL(v) (v.begin(),v.end())
#define COUT(x) cout<<(x)<<'\n'

int main(){
    int n;
    cin >> n;
    string s,t;
    cin >> s >> t;
    int count = 0;
    if(s==t)COUT(n);
    else{
        REP(i,n){
            if(t[i]==s[n-i-1])count++;
        }
        COUT(2*n-count);
    }
    return 0;
}

Compiler output:
a.cc:3:7: error: 'll' does not name a type
    3 | const ll LINF = 1e18;
      |       ^~
a.cc: In function 'int main()':
a.cc:13:5: error: 'cin' was not declared in this scope
   13 |     cin >> n;
      |     ^~~
a.cc:14:5: error: 'string' was not declared in this scope
   14 |     string s,t;
      |     ^~~~~~
a.cc:15:12: error: 's' was not declared in this scope
   15 |     cin >> s >> t;
      |            ^
a.cc:15:17: error: 't' was not declared in this scope
   15 |     cin >> s >> t;
      |                 ^
a.cc:9:17: error: 'cout' was not declared in this scope; did you mean 'count'?
    9 | #define COUT(x) cout<<(x)<<'\n'
      |                 ^~~~
a.cc:17:13: note: in expansion of macro 'COUT'
   17 |     if(s==t)COUT(n);
      |             ^~~~
a.cc:9:17: error: 'cout' was not declared in this scope; did you mean 'count'?
    9 | #define COUT(x) cout<<(x)<<'\n'
      |                 ^~~~
a.cc:22:9: note: in expansion of macro 'COUT'
   22 |         COUT(2*n-count);
      |         ^~~~
Language: C++

N = int(input())
s = input()
t = input()

if s == t:
    print(N)
    exit(0)

tr = t[::-1]
match = 0
for i in reversed(range(0, N)):
    if s[i] == tr[i]:
        match += 1
    else:
        break
print(N*2-match)


Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N = int(input())
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <queue>
#include <stack>
#include <bitset>
#include <set>
#include <chrono>
#include <string>

using namespace std;

#define endl '\n'

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

    int n;
    cin >> n;

    string a, b;
    cin >> a >> b;

    for (int i = n; i >= 0; --i)
    {
        bool ok = true;
        for (int j = 0; j < i && ok; ++j)
        {
            if (b[j] != a[n - i + j])
                ok = false;
        }

        if (ok)
        {
            cout << 2 * n - i << endl;
            return 0;
        }
    }

    assert(false);

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:5: error: 'assert' was not declared in this scope
   44 |     assert(false);
      |     ^~~~~~
a.cc:11:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
   10 | #include <chrono>
  +++ |+#include <cassert>
   11 | #include <string>
Language: C++

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

int main(){
    int n;
    cin >> n;
    string s,t;
    cin >> s >> t;
    int count=0;
    for(int i=1;i<=n;i++){
        if(s.substr(n-i,i)==t.substr(0.i)) count=i;
    }
    cout << n+n-count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:38: error: cannot convert 'std::complex<double>' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
   11 |         if(s.substr(n-i,i)==t.substr(0.i)) count=i;
      |                                      ^~~
      |                                      |
      |                                      std::complex<double>
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:3208:24: note:   initializing argument 1 of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::substr(size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
 3208 |       substr(size_type __pos = 0, size_type __n = npos) const
      |              ~~~~~~~~~~^~~~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <math.h>
#include <iomanip>
#include <bitset>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <utility>
#include <set>
using namespace std;
typedef long long int ll;
typedef long double ld;
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; }
const long long INF = 1LL << 60;
 
typedef pair<ll,ll> pairs;
vector<pairs> p;
bool pairCompare(const pair<double,ll>& firstElof, const pair<double,ll>& secondElof){
    return firstElof.first < secondElof.first;
}
#define MAX_N 1000100
bool x[MAX_N];
ll num[MAX_N];
ll fibl[MAX_N]={0};
 
ll fib(ll a){
    if (fibl[a]!=0)return fibl[a];
    if (a==0){
        return 0;
    }else if (a==1){
        return 1;
    }
    return fibl[a]=fib(a-1)+fib(a-2);
}
 
ll eratosthenes(ll n) {
    int p = 0;
    for (ll i=0; i<=n; ++i) x[i] = true;
    x[0] = x[1] = false;
    for(int i=2; i<=n; ++i) {
        if(x[i]) {
            p++;
            for(int j=2*i; j<=n; j+=i) x[j] = false;
        }
        
        num[i] = p;
    }
    return p;
}
 
ll gcd(ll a,ll b){
    if (a%b==0)return(b);
    else return(gcd(b,a%b));
}
 
ll keta(ll N){
    int tmp{};
    while( N > 0 ){
        tmp += ( N % 10 );
        N /= 10;
    }
    N = tmp;
    return N;
}

int main(){
    ll n;
    cin >> n;
    string s,t;
    cin >> s >> t;
    ll ans=2*n;
    for (ll i=0;i<n;i++){
        ans=2*n;
        for (ll j=i;j<n;j++){
            if (s[j]==t[j-i]){
                ans--;
            }else{
                break;
            }
            if(j==n-1){
                cout << ans << endl
                return 0;
            }
        }
    }
    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:85:36: error: expected ';' before 'return'
   85 |                 cout << ans << endl
      |                                    ^
      |                                    ;
   86 |                 return 0;
      |                 ~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <math.h>
#include <iomanip>
#include <bitset>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <utility>
#include <set>
using namespace std;
typedef long long int ll;
typedef long double ld;
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; }
const long long INF = 1LL << 60;
 
typedef pair<ll,ll> pairs;
vector<pairs> p;
bool pairCompare(const pair<double,ll>& firstElof, const pair<double,ll>& secondElof){
    return firstElof.first < secondElof.first;
}
#define MAX_N 1000100
bool x[MAX_N];
ll num[MAX_N];
ll fibl[MAX_N]={0};
 
ll fib(ll a){
    if (fibl[a]!=0)return fibl[a];
    if (a==0){
        return 0;
    }else if (a==1){
        return 1;
    }
    return fibl[a]=fib(a-1)+fib(a-2);
}
 
ll eratosthenes(ll n) {
    int p = 0;
    for (ll i=0; i<=n; ++i) x[i] = true;
    x[0] = x[1] = false;
    for(int i=2; i<=n; ++i) {
        if(x[i]) {
            p++;
            for(int j=2*i; j<=n; j+=i) x[j] = false;
        }
        
        num[i] = p;
    }
    return p;
}
 
ll gcd(ll a,ll b){
    if (a%b==0)return(b);
    else return(gcd(b,a%b));
}
 
ll keta(ll N){
    int tmp{};
    while( N > 0 ){
        tmp += ( N % 10 );
        N /= 10;
    }
    N = tmp;
    return N;
}

int main(){
    ll n;
    cin >> n;
    string s,t;
    cin >> s >> t;
    ll ans=2*n;
    for (ll i=0;i<n;i++){
        ans=2*n;
        for (ll j=i;j<n;j++){
            if (s[j]==t[j-i]){
                ans--;
            }else{
                break;
            }
            if(j==n-1)cout << ans << endl{
                return 0;
            }
        }
    }
    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:84:42: error: expected ';' before '{' token
   84 |             if(j==n-1)cout << ans << endl{
      |                                          ^
      |                                          ;
Language: C++

// 006 AGC A - Prefix and Suffix 2016/10/29

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



int main(int argc , char* argv[]){
        int n; cin >> n;
        string s , t;
        cin >> s >> t;
        rep(i ,n){
            string s1=s.substr(i,n-i);
            string t1=t.substr(0,n-i);
            if (s1==t1 && s!==t) { cout << 2*n - i << endl; return 0;}
        }
        if(s == t) cout << n << endl;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:18:30: error: expected primary-expression before '=' token
   18 |             if (s1==t1 && s!==t) { cout << 2*n - i << endl; return 0;}
      |                              ^
Language: C++

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

int main() {
  int n, s;
  string s, t;
  cin >> n >> s >> t;
  rep(i, n){
    bool b = 1;
    rep(j, n-i){
      if(s[j] != t[i+j]){
        b = 0;
        break;
      }
    }
    if(b){
      s = n + i;
      break;
    }
  }
  cout << s << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: conflicting declaration 'std::string s'
    8 |   string s, t;
      |          ^
a.cc:7:10: note: previous declaration as 'int s'
    7 |   int n, s;
      |          ^
a.cc:13:11: error: invalid types 'int[int]' for array subscript
   13 |       if(s[j] != t[i+j]){
      |           ^
Language: C++

# coding:utf-8
N = int(input())
S = input()
T = input()
ans = 0
for n in range(1,N+1):
    #print (S[-n:],T[:n])
    if (S[-n:]==T[:n]):
        ans = n
print (2*N-ans)

Compiler output:
a.cc:1:3: error: invalid preprocessing directive #coding
    1 | # coding:utf-8
      |   ^~~~~~
a.cc:7:6: error: invalid preprocessing directive #print
    7 |     #print (S[-n:],T[:n])
      |      ^~~~~
a.cc:2:1: error: 'N' does not name a type
    2 | N = int(input())
      | ^
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF (1ll << 60)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
using vl = vector<ll>;
using vvl = vector<vl>;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
using ll = long long;
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

void print(const std::vector<int> &v) {
    std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
    std::cout << std::endl;
}

int main() {
    int N;
    cin >> N;
    string s;
    string t;
    cin >> s;
    reverse(s.begin().s.end());
    cin >> t;
    int cnt = 0;
    REP(i, N) {
        if(s[i] == t[i]) {
            cnt++;
        }
    }
    cout << 2 * N - cnt << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:23: error: 'std::__cxx11::basic_string<char>::iterator' has no member named 's'
   42 |     reverse(s.begin().s.end());
      |                       ^
Language: C++

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

int main(){
	int N;
	string s,t;
	cin >> N >> s >> t;
	FOR(i,N,2*N+1){
		int j = i-N;
		string ans = s.substr(0,j) + t;
		if(ans.substr(0,N)==s){
			cout << i << endl;
			return 0;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'i' was not declared in this scope
    8 |         FOR(i,N,2*N+1){
      |             ^
a.cc:8:9: error: 'FOR' was not declared in this scope
    8 |         FOR(i,N,2*N+1){
      |         ^~~
Language: C++

#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
int main() {
  int a;
 string b,c;
      
  cin >> a;
    cin >>b;
    cin >>c;
  
   for(int i=0;i<a;i++){
     for(int j=i+1;i<a;i++){
       if(a.substr(i) ==a.substr(0,a-1)){
         
         cout << i+a << endl;
       
     return 0;
       }
     }
   }
   
  
  cout << 2*a << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: request for member 'substr' in 'a', which is of non-class type 'int'
   14 |        if(a.substr(i) ==a.substr(0,a-1)){
      |             ^~~~~~
a.cc:14:27: error: request for member 'substr' in 'a', which is of non-class type 'int'
   14 |        if(a.substr(i) ==a.substr(0,a-1)){
      |                           ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int N;
string s, t;
int solve() {
  for (int i = 0; i < N; i++) {
    if (s.substr(i) == t.substr(0, N-i)) return N+i;
  return N*2;
  }

int main() {
  cin >> N >> s >> t;
  cout << solve() << endl;
}

Compiler output:
a.cc: In function 'int solve()':
a.cc:11:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   11 | int main() {
      |         ^~
a.cc:11:9: note: remove parentheses to default-initialize a variable
   11 | int main() {
      |         ^~
      |         --
a.cc:11:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:11:12: error: a function-definition is not allowed here before '{' token
   11 | int main() {
      |            ^
a.cc:14:2: error: expected '}' at end of input
   14 | }
      |  ^
a.cc:5:13: note: to match this '{'
    5 | int solve() {
      |             ^
a.cc:14:2: warning: control reaches end of non-void function [-Wreturn-type]
   14 | }
      |  ^