Language: C++

#include <cstdio>
#include <algorithm>

using namespace std;

const int maxn = 100005;

typedef pair<int, int> pii;

int n;

// build tree

namespace Tree1
{
	set<pii> st;
	
	struct Edge
	{
		int to, nxt;
	} e[maxn<<1];
	
	int first[maxn];
	
	inline void add_edge(int from, int to)
	{
		static int cnt = 0;
		st.insert(make_pair(from, to));
		st.insert(make_pair(to, from));
		e[++cnt].nxt = first[from]
		first[from] = cnt;
		e[cnt].to = to;
		e[++cnt].nxt = first[to];
		first[to] = cnt;
		e[cnt].to = from;
	}
}

namespace Tree2
{
	set<pii> st;
	
	pii e[maxn];
	
	inline void add_edge(int from, int to)
	{
		static int cnt = 0;
		st.insert(make_pair(from, to));
		st.insert(make_pair(to, from));
		e[++cnt] = make_pair(from, to);
	}
}

namespace Tree1
{
	int is[maxn];
	
	int dep[maxn];
	int fa[maxn];
	int ffa[maxn];
	int son[maxn];
	int siz[maxn];
	int qz[maxn];
	int aa[maxn];
	int ll[maxn];
	
	inline void dfs1(int now)
	{
		siz[now] = 1;
		for(int i = first[now]; i; i = e[i].nxt)
		{
			int to = e[i].to;
			if(to != fa[now])
			{
				dep[to] = dep[now] + 1;
				fa[to] = now;
				if(!(Tree2::st.count(make_pair(now, to))))
					qz[now] = 1;
				dfs1(to);
				siz[now] += siz[to];
				if(!son[now] || siz[son[now]] < siz[to])
					son[now] = to;
			}
		}
	}
	
	inline void dfs2(int now)
	{
		static cnt = 0;
		ll[now] = ++cnt;
		aa[++cnt] = qz[now];
		if(son[now])
		{
			ffa[son[now]] = ffa[now];
			dfs2(son[now]);
		}
		for(int i = first[now]; i; i = e[i].nxt)
		{
			int to = e[i].to;
			if(to != fa[now] && to != son[now])
			{
				ffa[to] = to;
				dfs2(to);
			}
		}
 }
	
	#define ls(x) (x << 1)
	#define rs(x) (x << 1 | 1)
	
	struct Tree
	{
		int no[maxn];
		int t;
		
		inline void build_tree()
		{
			for(; t <= n; t <<= 1);
			for(int i = t + 1; i <= t + n; ++i)
				no[i] = no[i - t];
			for(int i = t - 1; i; --i)
				no[i] = no[ls(i)] + no[rs(i)];
		}
		
		inline void change(int k)
		{
			no[k += t] = 0;
			for(; k; k >>= 1)
				no[k] = no[ls(k)] + no[rs(k)];
		}
		
		inline int query(int l, int r)
		{
			int ans = 0;
			for(l += t - 1, r += t + 1; l ^ r ^ 1; l >>= 1, r >>= 1)
			{
				if(~l & 1)
					ans += no[l];
				if(r & 1)
					ans += no[r];
			}
			return ans;
		}
	}
}

int main()
{
}

Compiler output:
a.cc:16:9: error: 'set' does not name a type
   16 |         set<pii> st;
      |         ^~~
a.cc: In function 'void Tree1::add_edge(int, int)':
a.cc:28:17: error: 'st' was not declared in this scope; did you mean 'std'?
   28 |                 st.insert(make_pair(from, to));
      |                 ^~
      |                 std
a.cc:30:43: error: expected ';' before 'first'
   30 |                 e[++cnt].nxt = first[from]
      |                                           ^
      |                                           ;
   31 |                 first[from] = cnt;
      |                 ~~~~~                      
a.cc: At global scope:
a.cc:41:9: error: 'set' does not name a type
   41 |         set<pii> st;
      |         ^~~
a.cc: In function 'void Tree2::add_edge(int, int)':
a.cc:48:17: error: 'st' was not declared in this scope; did you mean 'std'?
   48 |                 st.insert(make_pair(from, to));
      |                 ^~
      |                 std
a.cc: In function 'void Tree1::dfs1(int)':
a.cc:77:45: error: 'st' is not a member of 'Tree2'
   77 |                                 if(!(Tree2::st.count(make_pair(now, to))))
      |                                             ^~
a.cc: In function 'void Tree1::dfs2(int)':
a.cc:89:24: error: 'cnt' does not name a type; did you mean 'int'?
   89 |                 static cnt = 0;
      |                        ^~~
      |                        int
a.cc:90:29: error: 'cnt' was not declared in this scope; did you mean 'int'?
   90 |                 ll[now] = ++cnt;
      |                             ^~~
      |                             int
a.cc: At global scope:
a.cc:144:10: error: expected ';' after struct definition
  144 |         }
      |          ^
      |          ;