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

#include<iostream>
#include<vector>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<queue>
#include<set>
using namespace std;
typedef long long LL;
const int N=2e5;
int gi() {
	int w=0;bool q=1;char c=getchar();
	while ((c<'0'||c>'9') && c!='-') c=getchar();
	if (c=='-') q=0,c=getchar();
	while (c>='0'&&c <= '9') w=w*10+c-'0',c=getchar();
	return q? w:-w;
}
int head[N],next[N],to[N];
inline bool dfs(int k,int fa) {
	bool match=false;
	for (int i=head[k];i;i=next[i])
		if (to[i]!=fa) {
			if (dfs(to[i],k))
				if (match) { puts("First"); exit(0); }
				else match=true;
		}
	return !match;
}
int main()
{
	int n=gi(),i,a,b,tot=0;
	for (i=1;i<n;i++) {
		a=gi(),b=gi();
		to[++tot]=b,next[tot]=head[a],head[a]=tot;
		to[++tot]=a,next[tot]=head[b],head[b]=tot;
	}
	puts(dfs(1,0)?"First":"Second");
	return 0;
}


Compiler output:
a.cc: In function 'bool dfs(int, int)':
a.cc:24:32: error: reference to 'next' is ambiguous
   24 |         for (int i=head[k];i;i=next[i])
      |                                ^~~~
In file included from /usr/include/c++/14/string:47,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:21:13: note:                 'int next [200000]'
   21 | int head[N],next[N],to[N];
      |             ^~~~
a.cc: In function 'int main()':
a.cc:37:29: error: reference to 'next' is ambiguous
   37 |                 to[++tot]=b,next[tot]=head[a],head[a]=tot;
      |                             ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:21:13: note:                 'int next [200000]'
   21 | int head[N],next[N],to[N];
      |             ^~~~
a.cc:38:29: error: reference to 'next' is ambiguous
   38 |                 to[++tot]=a,next[tot]=head[b],head[b]=tot;
      |                             ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:21:13: note:                 'int next [200000]'
   21 | int head[N],next[N],to[N];
      |             ^~~~
Language: C++

#include<cstdio>
#include<vector>
#include<bitset>
#define N 100000
using namespace std;

vector<int> vecin[N+1];
bitset<N+1> viz;

int dfs(int nod){
    viz.set(nod);
    bool ans=false;
    
    for(int i=0;i<vecin[nod].size();i++){
        int now=vecin[nod][i];
        
        if (viz[now]==false){
            int r=dfs(now);
            
            if (r==-1) return -1;
            if (r==1 &&ans==1) return -1;
            ans|=r;
        }
    }
    
    return (ans^1);
}

int main(){
    int n,i;
    
    scanf ("%d",&n);
    
    for(i=1;i<=n;i++){
        int a,b;
        scanf ("%d%d",&a,&b);
        
        vecin[a].push_back(b);
        vecin[b].push_back(a);
    }
    
    int ans=dfs();
    
    if (ans==0) printf ("Second");
    else printf ("First");
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:16: error: too few arguments to function 'int dfs(int)'
   42 |     int ans=dfs();
      |             ~~~^~
a.cc:10:5: note: declared here
   10 | int dfs(int nod){
      |     ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
vector<int> e[1000500];
int p[1000500]
int n;
void link(int a,int b) 
{
	e[a].push_back(b);
	e[b].push_back(a);
}

void dfs(int u,int fa) 
{
    for (int i=0;i<e[u].size();i++) 
	{
        int v=e[u][i]; 
		if (v==fa) continue;
        dfs(v,u);
    }
    if (!p[u] && !p[f]) p[u] = p[f] = 1; 
}

int main() {
    cin>>n;
    for (int i=1;i<n;i++) 
    {
    	int x,y;
    	cin>>x>>y;
    	link(x,y);
    }
    p[0] = 1;
    dfs(1,0);
    int ans = 1;
    for (int i=1;i<=n;i++) if (!p[i]) ans = 0;
    puts(!ans?"First":"Second");
    return 0;
}

Compiler output:
a.cc:5:1: error: expected initializer before 'int'
    5 | int n;
      | ^~~
a.cc: In function 'void dfs(int, int)':
a.cc:20:10: error: 'p' was not declared in this scope
   20 |     if (!p[u] && !p[f]) p[u] = p[f] = 1;
      |          ^
a.cc:20:21: error: 'f' was not declared in this scope
   20 |     if (!p[u] && !p[f]) p[u] = p[f] = 1;
      |                     ^
a.cc: In function 'int main()':
a.cc:24:10: error: 'n' was not declared in this scope; did you mean 'yn'?
   24 |     cin>>n;
      |          ^
      |          yn
a.cc:31:5: error: 'p' was not declared in this scope
   31 |     p[0] = 1;
      |     ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
using namespace std;
const int M = 1e5 + 10;
vector<int>vc[M];
int ans , V[M];
void dfs(int pos , int pre , int d) {
    int len = vc[pos].size();
    if(d >= 4) {
        V[pos]++;
    }
    if(len > 2) {
        return ;
    }
    else {
        for(int i = 0 ; i < len ; i++) {
            int v = vc[pos][i];
            if(v != pre) {
                dfs(v , pos , d + 1);
            }
        }
    }
}
int main() {
    int n , u , v;
    scanf("%d" , &n);
    for(int i = 1 ; i < n ; i++) {
        scanf("%d%d" , &u , &v);
        vc[u].push_back(v);
        vc[v].push_back(u);
    }
    memset(V , 0 , sizeof(V));
    int flag = 1;
    for(int i = 1 ; i <= n ; i++) {
        int len = vc[i].size();
        int count = 0;
        if(len >= 2) {
            for(int j = 0 ; j < len ; j++) {
                int to = vc[i][j];
                int len = vc[to].size();
                if(len == 1) {
                    count++;
                }
            }
            if(count >= 2) {
                flag = 0;
                break;
            }
        }
    }
    if(!flag) {
        printf("First\n");
    }
    else {
        ans = 0;
        for(int i = 1 ; i <= n ; i++) {
            int len = vc[i].size();
            if(len == 1) {
                dfs(i , -1 , 1);
            }
        }
        for(int i = 1 ; i <= n ; i++) {
            int len = vc[i].size();
            if(len >= 2) {
                for(int j = 0 ; j < len ; j++) {
                    int to = vc[i][j];
                    int len = vc[to].size();
                    if(len == 1) {
                        if(V[i] >= 1) {
                            ans = 1;
                            break;
                        }
                    }
                    else {
                        if(V[i] >= 2) {
                            ans = 1;
                            break;
                        }
                    }
                }
            }
            if(ans) break;
        }
        if(ans) {
            printf("First\n");
        }
        else {
            printf("Second\n");
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:5: error: 'memset' was not declared in this scope
   34 |     memset(V , 0 , sizeof(V));
      |     ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <cstdio>
  +++ |+#include <cstring>
    5 | using namespace std;
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<deque>

using namespace std;

#define sz(x) (int)(x.size())
#define rep(i, a, b) for(int i=a;i<b;++i)
#define per(i, a, b) for(int i=b-1;i>=a;--i)
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;

////////////////

string const F = "First";
string const S = "Second";

int const N = 1e5 + 41;

vector<int> e[N];
int root;
int l[N];
int n;
int cnt[N];
int par[N];
int w[N];

deque<int> q;

void print(string ans){
	cout << ans << endl;
	exit(0);
}

int dfs(int u, int p){
	if(sz(e[u]) == 1) l[u] = 1;
	par[u] = p;
	int cnt = 0;
	rep(i, 0, sz(e[u])){
		int to = e[u][i];
		if(to == p) continue;
		cnt += dfs(to, u);
	}
	if(cnt > 1) print(F);
	return l[u];
}

void solve(){
	cin >> n;
	rep(i, 0, n-1){
		int a, b;
		cin >> a >> b;
		--a;--b;
		e[a].pb(b);
		e[b].pb(a);
	}

	rep(i, 0, n) if(sz(e[i]) > sz(e[root])) root = i;
	++cnt[root];
	dfs(root, -1);
	rep(i, 0, n){
		cnt[i] = sz(e[i]);
		if(l[i]) q.pb(i);
	}
	while(sz(q)){
		int v = q.front();
		q.pop_front();
		if(par[v] == -1){
			continue;
		}
		if(!w[v] && w[par[v]]) print(F);
		--cnt[par[v]];
		if(cnt[par[v]] == 1) q.pb(par[v]);
		if(!w[v]){
			w[par[v]] = 1;
			w[v] = 1;
		}
	}
	rep(i, 0, n) if(!w[v]) print(F);

	print(S);
}

int main(){
#ifdef _DEBUG
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif

	solve();

	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:86:28: error: 'v' was not declared in this scope
   86 |         rep(i, 0, n) if(!w[v]) print(F);
      |                            ^
Language: C++

#include <iostream>
#include <vector>
#include <queue>
using namespace std;
 
int n;
vector<int> et[100000];
int dist[100001];
int cnt[200001];
 
int main() {
	cin >> n;
	for (int i = 0; i < n - 1; i++) {
		int a, b;
		cin >> a >> b;
		a--; b--;
		et[a].push_back(b);
		et[b].push_back(a);
	}
	
	queue<int> que;
	for (int i = 0; i < n; i++) {
		dist[i] = 11451419;
		if (et[i].size() == 1) {
			dist[i] = 0;
			que.push(i);
		}
	}
	while (!que.empty()) {
		int v = que.front(); que.pop();
		for (int i = 0; i < et[v].size(); i++) {
			if (dist[et[v][i]] > dist[v] + 1) {
				dist[et[v][i]] = dist[v] + 1;
				que.push(et[v][i]);
			}
		}
	}
	
	for (int i = 0; i < n; i++) {
		cnt[dist[i]]++;
	}

	int rem = n;
	
	for (int i = 0; ; i += 2) {
		if (rem == 0 || rem == 2) { break; }
		if (cnt[i] > cnt[i + 1]) {	//葉の個数 > 葉の親の個数
			assert(0);
			cout << "First" << endl;
			return 0;
		}
		rem -= cnt[i];
		rem -= cnt[i + 1];
	}

	cout << "Second" << endl;
	return 0;
}

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

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

int main()
{
    ios::sync_with_stdio(false);

    int N; cin >> N;

    auto adjacency_list = vector<vector<int>>(N);
    for (auto i = 0; i < N-1; i++)
    {
        int a, b; cin >> a >> b;
        a--; b--;
        adjacency_list[a].push_back(b);
        adjacency_list[b].push_back(a);
    }

    auto matched = vector<bool>(N);
    const function<void(int, int)> dfs = [&](const int v, const int parent)
    {
        for (const auto child : adjacency_list[v]) if (child != parent)
        {
            dfs(child, v);
            if (!matched[child] && !matched[v])
                matched[child] = matched[v] = true;
        }
    };
    dfs(0, -1);

    cout << (all_of(begin(matched), end(matched)) ? "Second" : "First") << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:20: error: no matching function for call to 'all_of(std::vector<bool>::iterator, std::vector<bool>::iterator)'
   31 |     cout << (all_of(begin(matched), end(matched)) ? "Second" : "First") << endl;
      |              ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:410:5: note: candidate: 'template<class _IIter, class _Predicate> bool std::all_of(_IIter, _IIter, _Predicate)'
  410 |     all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)
      |     ^~~~~~
/usr/include/c++/14/bits/stl_algo.h:410:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:30:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Predicate> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool> std::all_of(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Predicate)'
   30 | all_of(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred);
      | ^~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:30:1: note:   candidate expects 4 arguments, 2 provided
Language: C++

#include <iostream>
#include <vector>
#include <queue>
#include <unordered_map>
#include <map>
#include <string>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <algorithm>
 
#define MaxN 100005
 
using namespace std;
 
int N,X,Y;
bool pos=false;
vector<int>Graph[MaxN];
int DFS(int node,int father)
{
	int cnt=0;
	for(int i=0;i<Graph[node].size();i++)
	{
		if(Graph[node][i]==father)
			continue;
		cnt+=DFS(Graph[node][i],node);
	}
	if(cnt>=2||)
		pos=true;
	return !cnt;
}
int main()
{
	cin>>N;
	for(int i=1;i<N;i++)
	{
		cin>>X>>Y;
		Graph[X].push_back(Y);
		Graph[Y].push_back(X);
	}
	int i=1;
	while(i<N&&Graph[i].size()==1)
		i++;
	DFS(i,0);
	if(pos)
		cout<<"First\n";
	else cout<<"Second\n";
	return 0;
}

Compiler output:
a.cc: In function 'int DFS(int, int)':
a.cc:28:20: error: expected primary-expression before ')' token
   28 |         if(cnt>=2||)
      |                    ^
Language: C++

#include<algorithm>
#include<vector>
#include<list>
#include<iostream>
#include<utility>
#include<string>
#include<set>
#include<queue>
#include<stack>
#include<iterator>
#include<map>
#include<limits>
#include<iomanip>
#include<ctime>
#include<cmath>
 
const int INF=2147483647;
const long long MOD=1e9+7;
 
using namespace std;



int main(){
    
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    
    int n;
    cin>>n;
    vector<vector<int>> graph(n+1);
    for(int i=1; i<=n-1; i++){
        int x,y;
        cin>>x>>y;
        graph[x].push_back(y);
        graph[y].push_back(x);
        
    }
    vector<int> leaves;
    vector<int> preds(n+1);
    set<int> leafPreds;
    
    for(int i=1; i<=n; i++){
        if(graph[i].size()==1){
            leaves.push_back(i);
            preds[i]=graph[i][0];
        }
    }
    
    
    
    for(int i:leaves){
        //cout<<i<<endl;
        if(leafPreds.find(preds[i])!=leafPreds.end()){
            cout<<"First";
            return 0;
        }
        else{
            leafPreds.insert(preds[i]);
        }
    }
    
    for(int i:leaves){
        pathCt=2;
        int j=preds[i];
        if(graph[j].size==2){
            pathCt++;
            int k=graph[j][0]==i?graph[j][1]:graph[j][0];
            if(graph[k].size==2){
                cout<<"First";
                return 0;
            }
        }
        
    }
    
    cout<<"Second";
    
    
    return 0;
    
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:9: error: 'pathCt' was not declared in this scope
   64 |         pathCt=2;
      |         ^~~~~~
a.cc:66:21: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int]' (did you forget the '()' ?)
   66 |         if(graph[j].size==2){
      |                         ()
a.cc:69:25: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int]' (did you forget the '()' ?)
   69 |             if(graph[k].size==2){
      |                             ()
Language: C++

#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<algorithm>
using namespace std;
vector<int> E[100010];
int d[100010], cnt[100010], ans[100000];
int vis[100010], flag[100010], ok;
int n, u, v, t, cot, tot;
void dfs(int x){
	for(int i = 0; i < E[x].size(); i++){
		if(!vis[E[x][i]]){
			vis[E[x][i]] = 1;
			d[E[x][i]] = d[x] + 1;
			dfs(E[x][i]);
		}
	}
}
int main()
{
	scanf("%d", &n);
	for(int i = 1; i <= n - 1; i++){
		scanf("%d%d", &u, &v);
		E[u].push_back(v);
		E[v].push_back(u);
		cnt[v]++;
		cnt[u]++;
	}
	dfs(1);
	for(int i = 1; i <= n; i++)if(cnt[i] == 1)ans[++t] = i;
	if(t >= 3){
		for(int i = 1; i <= t; i++)
			for(int j = 1; j <= t; j++)
				if(sqrt(d[i] - d[j]) >= 4)flag++;
		if(flag >= 2)printf("Second\n");
		else printf("First\n");
	}
	else {
		printf("First\n");
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:59: error: lvalue required as increment operand
   36 |                                 if(sqrt(d[i] - d[j]) >= 4)flag++;
      |                                                           ^~~~
a.cc:37:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   37 |                 if(flag >= 2)printf("Second\n");
      |                    ~~~~~^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define mps 1000000007
vector <int> vec[100005];
bool ok(int x)
{
    for(int i=0;i<vec[x].size();i++)
    {
        if(vec[vec[x][i]].size()==1)
            return 1;
    }
    return 0;
}
int main()
{
    bool flag=0;
    int n,u,v;
    cin>>n;
    for(int i=1;i<n;i++)
    {
        scanf("%d%d",&u,&v);
        vec[u].push_back(v);
        vec[v].push_back(u);
    }
    for(int i=1;i<=n;i++)
    {
        if(vec[i].size()>1)
        {
            int cnt=0;
            for(int j=0;j<vec[i].size();j++)
            {
                if(vec[vec[i][j]].size()==1)
                    cnt++;
            }
            if(vec[i].size()==2 && ok(vec[vec[i][0]]) && ok(vec[vec[i][1]]))
                flag=1
            if(cnt>1)
                flag=1;
        }
    }
    if(flag)
        printf("First\n");
    else
        printf("Second\n");
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:52: error: cannot convert 'std::vector<int>' to 'int'
   35 |             if(vec[i].size()==2 && ok(vec[vec[i][0]]) && ok(vec[vec[i][1]]))
      |                                       ~~~~~~~~~~~~~^
      |                                                    |
      |                                                    std::vector<int>
a.cc:5:13: note:   initializing argument 1 of 'bool ok(int)'
    5 | bool ok(int x)
      |         ~~~~^
a.cc:35:74: error: cannot convert 'std::vector<int>' to 'int'
   35 |             if(vec[i].size()==2 && ok(vec[vec[i][0]]) && ok(vec[vec[i][1]]))
      |                                                             ~~~~~~~~~~~~~^
      |                                                                          |
      |                                                                          std::vector<int>
a.cc:5:13: note:   initializing argument 1 of 'bool ok(int)'
    5 | bool ok(int x)
      |         ~~~~^
a.cc:36:23: error: expected ';' before 'if'
   36 |                 flag=1
      |                       ^
      |                       ;
   37 |             if(cnt>1)
      |             ~~
Language: C++

#include <bits/stdc++.h>

#define MAXN (100010)


int n;
int lfson[MAXN], sz[MAXN], deg[MAXN], f[MAXN], dep[MAXN];
int delta[MAXN];
std::vector<int> vec[MAXN];
struct cmp{
	bool operator() (int a, int b){
		return dep[a] < dep[b];
	}
};
std::priority_queue<int, std::vector<int>, cmp> pq;
bool vis[MAXN];

void dfs(int u, int fa){
	sz[u] = 1;
	for(auto v : vec[u]){
		if(v == fa) continue;
		f[v] = u;
		dep[v] = dep[u] + 1;
		dfs(v, u);
		sz[u] += sz[v];
		if(sz[v] == 1){
			lfson[u] ++;
			pq.push(v);
		}
	}
}

int main(){
	scanf("%d", &n);
	for(int i = 1; i < n; ++ i){
		int u, v;
		scanf("%d%d", &u, &v);
		vec[u].push_back(v);
		vec[v].push_back(u);
		++ deg[u];
		++ deg[v];
	}
	for(int i = 1; i <= n; ++ i){
		if(deg[i] != 1){
			dfs(i, 0);
			break;
		}
	}
	while(!pq.empty()){
		int u = pq.top();
		pq.pop();
		int v = f[u];
		if(lfson[v] != 1){
			return printf("First\n"), 0;
		}
		//v = f[v];
		if(!f[v]) continue;
		delta[f[v]] += delta[u] + delta[v] + 2;
		sz[f[v]] -= delta[u] + delta[v] + 2;
		v = fa[v];
		if(sz[v] == 1){
			pq.push(v);
			if(f[v]){
			    lfson[f[v]] ++;
			}
		}
	}
	printf("Second\n");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:60:21: error: 'fa' was not declared in this scope; did you mean 'fma'?
   60 |                 v = fa[v];
      |                     ^~
      |                     fma
Language: C++

#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <string>
#include <algorithm>
#include <iostream>
#include <string>
#include <map>
#include <set>
#include <functional>
#include <iostream>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int n;
vector<int> G[100001];
int cnt[100001];
int e[100001];
bool used[100001];
bool used2[100001];
bool good[100001];
int rest;

int dfs(int v){
	used[v]=true;
	if(e[i]>=3){
		used[v]=false;
		if(cnt[v]>=1)return 1;
		return -1000000;
	}
	for(int i=0;i<G[v].size();i++){
		if(!used[G[v][i]] && !used2[G[v][i]]){
			return (dfs(G[v][i])+1);
		}
	}
}

void dfs2(int v,int d){
	used2[v]=true;
	if(e[i]>=3){
		used2[v]=false;
		if(d%2==1)good[v]=true;
		return;
	}
	rest--;
	for(int i=0;i<G[v].size();i++){
		if(!used2[G[v][i]]){
			dfs2(G[v][i],d+1);
		}
	}
}

bool solve(){
	if(rest==1)return true;
	memset(cnt,0,sizeof(cnt));
	for(int i=0;i<n;i++){
		if(e[i]==1 && !used2[i]){
			cnt[G[i][0]]++;
		}
	}
	for(int i=0;i<n;i++){
		if(cnt[i]>=2){
			return true;
		}
	}
	int on=0,se=0;
	bool flag=true;
	for(int i=0;i<n;i++){
		if(e[i]==1 && !used2[i]){
			on++;
		}
		if(e[i]==2 && !used2[i]){
			se++;
		}
		if(e[i]>2 && !used2[i]){
			flag=false;
		}
	}
	if(flag && on==2 && se==n-2){
		return (n%2==1);
	}
	for(int i=0;i<n;i++){
		if(!used[i] && !used2[i] && e[i]==1){
			if(dfs(i)==4){
				return true;
			}
		}
	}
	memset(used,false,sizeof(used));
	for(int i=0;i<n;i++){
		if(cnt[i]==1 && !used2[i]){
			for(int j=0;j<G[i].size();j++){
				if(used[G[i][j]] && e[G[i][j]]==2){
					return true;
				}
				used[G[i][j]]=true;
			}
		}
	}
	memset(good,false,sizeof(good));
	for(int i=0;i<n;i++){
		if(!used[i] && e[i]==1){
			dfs2(i,0);
		}
	}
	bool flag2=false;
	for(int i=0;i<n;i++){
		if(e[i]>=3 && !good[i]){
			e[i]=1;
			flag2=true;
		}
		if(e[i]>=3 && good[i]){
			return false;
		}
	}
	if(!flag2)return false;
	return solve();
}

int main(void){
	scanf("%d",&n);
	for(int i=0;i<n-1;i++){
		int a,b;
		scanf("%d%d",&a,&b);
		a--;
		b--;
		G[a].push_back(b);
		G[b].push_back(a);
		e[a]++;
		e[b]++;
	}
	printf("%s\n",solve()?"First":"Second");
	return 0;
}


Compiler output:
a.cc: In function 'int dfs(int)':
a.cc:29:14: error: 'i' was not declared in this scope
   29 |         if(e[i]>=3){
      |              ^
a.cc: In function 'void dfs2(int, int)':
a.cc:43:14: error: 'i' was not declared in this scope
   43 |         if(e[i]>=3){
      |              ^
a.cc: In function 'int dfs(int)':
a.cc:39:1: warning: control reaches end of non-void function [-Wreturn-type]
   39 | }
      | ^
Language: C++

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

using namespace std;

class Tree {
    public:
        vector<int> edges;
        bool isLeaf() { return edges.size() == 1; }
        bool isBrunch() { return edges.size() == 2; }
        int brunchNextNode(int exept) {
            if (!isBrunch()) { return -1;}
            return edges[0] != exept ? edges[0] : edges[1];
        }
        void setEdge(int n) { edges.push_back(n); }
};

int main() {
    int N; cin >> N;
    vector<Tree> nodes(N+1);

    int a, b;
    for (int i=0; i<N-1; i++) {
        cin >> a >> b;
        nodes[a].setEdge(b);
        nodes[b].setEdge(a);
    }

    for (int i=1; i<=N; i++) {
        int tmp = 0;
        for (int j : nodes[i].edges) {
            tmp += nodes[j].isLeaf() ? 1 : 0; {
                tmp += 1;
            } else if (nodes[j].isBrunch()) {
                while (nodes[j].isBrunch()) {
                    int k = nodes[j].brunchNextNode(j);
                    j = nodes[k].brunchNextNode(k);
                }
                if (j == -1) {
                    break;
                }
                if (nodes[j].isLeaf()) {
                    tmp += 1;
                    break;
                }
            }
        }
        if (tmp >= 2) {
            cout << "First" << endl;
            return 0;
        }
    }

    cout << "Second" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:15: error: 'else' without a previous 'if'
   35 |             } else if (nodes[j].isBrunch()) {
      |               ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n, cnt;
vector <int> a[N];
bool vis[N] = {0};


int cou(int u) {
    int res = 0;
    for (int i = 0; i < a[u].size(); i++) {
        int v = a[u][i];
        if (a[v].size() == 1) res++;
    }
    return res;
}

int dfs(int u) {
    vis[u] = true;
    cnt++;
    for (int i = 0; i < a[u].size(); i++) {
        int v = a[u][i];
        if (!vis[v]) dfs(v);
    }
}

int main() {
    scanf("%d", &n);
    for (int i = 1; i < n; i++) {
        int x, y; scanf("%d %d", &x, &y);
        a[x].push_back(y);
        a[y].push_back(x);
    }
    for (int i = 1; i <= n; i++) {
        if (cou(i) >= 2) {
            cout << "First" << endl;
            return 0;
        }
    }
    if (n & 1) {
        cout << "First" << endl;
        return 0;
    }
    vector <int> b;
    for (int i = 1; i <= n; i++) {
        if (a[i].size() >= 4) b.push_back(i);
    }
    int dem = 0;
    for (int t = 0; t < b.size(); t++) {
        int i = b[t];
        dem += n;
        memset(vis, false, sizeof(vis));
        if (deg[i] >= 4) {
            vis[i] = true;
            int res = 0;
            for (int j = 0; j < a[i].size(); j++) {
                cnt = 0;
                dfs(a[i][j]);
                res += cnt % 2;
            }
            if (res >= 2) {
                cout << "First" << endl;
                return 0;
            }
        }
        if (dem >= 200000000) break;
    }
    srand(time(NULL));
    cout << "Second" << endl;
}


Compiler output:
a.cc: In function 'int dfs(int)':
a.cc:25:1: warning: no return statement in function returning non-void [-Wreturn-type]
   25 | }
      | ^
a.cc: In function 'int main()':
a.cc:53:13: error: 'deg' was not declared in this scope; did you mean 'dem'?
   53 |         if (deg[i] >= 4) {
      |             ^~~
      |             dem
Language: C++

#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <string>
#include <algorithm>
#include <iostream>
#include <string>
#include <map>
#include <set>
#include <functional>
#include <iostream>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int n;
vector<int> G[100001];
int cnt[100001];
int e[100001];
bool used[100001];
bool used2[100001];
bool good[100001];
int rest;

int dfs(int v){
	used[v]=true;
	if(G[v].size()>=3){
		used[v]=false;
		if(cnt[v]>=1)return 1;
		return -1000000;
	}
	for(int i=0;i<G[v].size();i++){
		if(!used[G[v][i]] && !used2[G[v][i]]){
			return (dfs(G[v][i])+1);
		}
	}
}

void dfs2(int v,int d){
	used2[v]=true;
	if(G[v].size()>=3){
		used[v]=false;
		if(d%2==1)good[v]=true;
		return;
	}
	rest--;
	for(int i=0;i<G[v].size();i++){
		if(!used2[G[v][i]]){
			dfs2(G[v][i],d+1);
		}
	}
}

bool solve(){
	if(rest==1)return true;
	memset(cnt,0,sizeof(cnt));
	for(int i=0;i<n;i++){
		if(e[i]==1){
			cnt[G[i][0]]++;
		}
	}
	for(int i=0;i<n;i++){
		if(cnt[i]>=2){
			return true;
		}
	}
	int on=0,se=0;
	bool flag=true;
	for(int i=0;i<n;i++){
		if(e[i]==1){
			on++;
		}
		if(e[i]==2){
			se++;
		}
		if(e[i]>2){
			flag=false;
		}
	}
	if(flag && on==2 && se==n-2){
		return (n%2==1);
	}
	for(int i=0;i<n;i++){
		if(!used[i] && e[a]==1){
			if(dfs(i)==4){
				return true;
			}
		}
	}
	memset(used,false,sizeof(used));
	for(int i=0;i<n;i++){
		if(cnt[i]==1){
			for(int j=0;j<G[i].size();j++){
				if(used[G[i][j]] && G[G[i][j]].size()==2){
					printf("First\n");
					return 0;
				}
				used[G[i][j]]=true;
			}
		}
	}
	memset(good,false,sizeof(good));
	for(int i=0;i<n;i++){
		if(!used[i] && e[i]==1){
			dfs2(i,0);
		}
	}
	for(int i=0;i<n;i++){
		if(e[i]>=3 && !good[i]){
			e[i]=1;
		}
		if(e[i]>=3 && good[i]){
			return false;
		}
	}
	return true;
}

int main(void){
	scanf("%d",&n);
	for(int i=0;i<n-1;i++){
		int a,b;
		scanf("%d%d",&a,&b);
		a--;
		b--;
		G[a].push_back(b);
		G[b].push_back(a);
		e[a]++;
		e[b]++;
	}
	printf("%s\n",solve()?"First":"Second");
	return 0;
}


Compiler output:
a.cc: In function 'bool solve()':
a.cc:86:34: error: 'a' was not declared in this scope
   86 |                 if(!used[i] && e[a]==1){
      |                                  ^
a.cc: In function 'int dfs(int)':
a.cc:39:1: warning: control reaches end of non-void function [-Wreturn-type]
   39 | }
      | ^
Language: C++

#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <string>
#include <algorithm>
#include <iostream>
#include <string>
#include <map>
#include <set>
#include <functional>
#include <iostream>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int n;
vector<int> G[100001];
int cnt[100001];
int e[100001];
bool used[100001];
bool used2[100001];
bool good[100001];
int rest;

int dfs(int v){
	used[v]=true;
	if(G[v].size()>=3){
		used[v]=false;
		if(cnt[v]>=1)return 1;
		return -1000000;
	}
	for(int i=0;i<G[v].size();i++){
		if(!used[G[v][i]] && !used2[G[v][i]]){
			return (dfs(G[v][i])+1);
		}
	}
}

void dfs2(int v,int d){
	used2[v]=true;
	if(G[v].size()>=3){
		used[v]=false;
		if(d%2==1)good[v]=true;
		return;
	}
	rest--;
	for(int i=0;i<G[v].size();i++){
		if(!used2[G[v][i]]){
			dfs2(G[v][i],d+1);
		}
	}
}

bool solve(){
	if(rest==1)return true;
	memset(cnt,0,sizeof(cnt));
	for(int i=0;i<n;i++){
		if(e[i]==1){
			cnt[G[i][0]]++;
		}
	}
	for(int i=0;i<n;i++){
		if(cnt[i]>=2){
			return true;
		}
	}
	int on=0,se=0;
	bool flag=true;
	for(int i=0;i<n;i++){
		if(e[i]==1){
			on++;
		}
		if(e[i]==2){
			se++;
		}
		if(e[i]>2){
			flag=false;
		}
	}
	if(flag && on==2 && se==n-2){
		return (n%2==1);
	}
	for(int i=0;i<n;i++){
		if(!used[i] && e[a]==1){
			if(dfs(i)==4){
				return true;
			}
		}
	}
	memset(used,false,sizeof(used));
	for(int i=0;i<n;i++){
		if(cnt[i]==1){
			for(int j=0;j<G[i].size();j++){
				if(used[G[i][j]] && G[G[i][j]].size()==2){
					printf("First\n");
					return 0;
				}
				used[G[i][j]]=true;
			}
		}
	}
	memset(good,false,sizeof(good));
	for(int i=0;i<n;i++){
		if(!used[i] && e[i]==1){
			dfs2(i,0);
		}
	}
	for(int i=0;i<n;i++){
		if(e[i]>=3 && !good[i]){
			e[i]=1;
		}
		if(e[i]>=3 && good[i]){
			return false;
		}
	}
	return solve();
}

int main(void){
	scanf("%d",&n);
	for(int i=0;i<n-1;i++){
		int a,b;
		scanf("%d%d",&a,&b);
		a--;
		b--;
		G[a].push_back(b);
		G[b].push_back(a);
		e[a]++;
		e[b]++;
	}
	printf("%s\n",solve()?"First":"Second");
	return 0;
}


Compiler output:
a.cc: In function 'bool solve()':
a.cc:86:34: error: 'a' was not declared in this scope
   86 |                 if(!used[i] && e[a]==1){
      |                                  ^
a.cc: In function 'int dfs(int)':
a.cc:39:1: warning: control reaches end of non-void function [-Wreturn-type]
   39 | }
      | ^
Language: C++

//In the Name of God
//Let Our Voices Echo
#pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
#define X real()
#define Y imag()
typedef long long ll;
typedef double ld; 
typedef complex<ld> point;
const ld eps=1e-9;
const int MAX=1e5+9,MOD=1e9+7;
int n,d[MAX];
vector<int> g[MAX];
queue<int> q;
int main()
{
	ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
	memset(d,-1,sizeof d);
	cin>>n;
	if (n==2) return cout<<"Second",0;
	for (int i=1,v,u;i<n;i++)
	{	
		cin>>v>>u,v--,u--,g[v].push_back(u),g[u].push_back(v);
	}	
	for (int i=0;i<n;i++) 
		if (g[i].size()==1)
			q.push(i),d[i]=0;
	while (q.size())
	{
		int v=q.front();
		q.pop();
		for (auto u:g[v]) 
			if (d[u]==-1)
				d[u]=d[v]+1,q.push(u);
	}
	int mx=*max_element(d,d+n),cnt=0;
	for (int i=0;i<n;i++) if (d[i]==mx) cnt++;
	if (cnt==1) return cout<<"First",0;
	for (int i=0;i<n;i++)
	{
		int cnt=0;
		for (auto u:g[i])
			if (d[u]==d[i]-1) 
				cnt++;
		if (cnt>1) return cout<<"First",0; 
	}
	if (mx%2==1) return cout<<"Second",0;
	cout<<"First"<<Endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:24: error: 'Endl' was not declared in this scope
   49 |         cout<<"First"<<Endl;
      |                        ^~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <cmath>
#include <list>
#include <chrono>
#include <thread>

using namespace std;


const bool debug = false;

#ifndef M_PI
    const double M_PI = acos(-1.0);
#endif // M_PI

#define y1 roman_kaban
#define rank oryshych_konb
#define ull unsigned long long
//#define ll long long
//const int mod = int(1e9) + 7;
//const int inf = 1e9;
//const long long infLL = 1e11;
//const int MX2 = 10100500; //  e7
//const long long INF = 1e18 + 0.5;
const int MX = 200500; //       e5
//const int SZ = 1100;
//const int delta = 1 << 19;

vector<int> e[MX];
bool is_dead[MX];
int b[MX];
int z[MX];
int n;

bool check_string(){
    for(int i = 1; i <= n; i++){
        if(e[i].size() > 2) return false;
    }
    return true;
}

int main()
{
    ios_base::sync_with_stdio(false);
    //if(debug)
    //freopen("/Users/ozzy/Documents/in.txt","r", stdin);
    cin >> n;
    for(int i = 0; i < n - 1; i++){
        int u, v;
        cin >> u >> v;
        e[u].push_back(v);
        e[v].push_back(u);
    }
    if(check_string()){
        if(n & 1){cout << "First\n"; } else cout << "Second\n";
        //cerr << "cr";
        return 0;
    }

    list<int>leafs;
    for(int i = 1; i <= n; i++){
        if(e[i].size() == 1){
            leafs.push_back(i);
            is_dead[i] = true;
        }
        b[i] = e[i].size();
    }
    while(leafs.begin() != leafs.end()){
        int u = leafs.front();
        leafs.pop_front();
        int cnt = 0;
        while(b[u] == 1 && !is_not_leaf[u]){
            bool fl = false;
            for(int i = 0; i < e[u].size(); i++){
                int v = e[u][i];
                if(!is_dead[v]){
                    u = v;
                    is_dead[u] = true;
                    b[u]--;
                    fl = true;
                    break;
                }
            }
            if(!fl) {cout << "Second\n"; return 0;}
            cnt++;
        }

        if(cnt & 1) z[u]++;
        if(z[u] > 1) {cout << "First\n"; return 0;}
        if(b[u] == 1) {leafs.push_back(u); is_dead[u] = true;}
    }
        cout << "Second\n";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:78:29: error: 'is_not_leaf' was not declared in this scope
   78 |         while(b[u] == 1 && !is_not_leaf[u]){
      |                             ^~~~~~~~~~~
Language: C++

#pragma comment(linker, "/STACK:1000000000")
#define _CRT_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <cstdio>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <queue>
#include <deque>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <bitset>
#include <memory>
#include <cassert>
#include <cstdlib>
#include <cmath>
#include <ctime> 
#include <stack>
#include <iostream>
#include <fstream>

#define mp make_pair
#define pb push_back

using ll = long long;
using ld = long double;

using namespace std;

const int MAXN = 200001;

set <int> e[MAXN];

int q[MAXN], qe = 0;

void eredge(int x, int y) {
	e[x].erase(y);
	if (e[x].empty()) {
		cout << "First" << endl;
		exit(0);
	}
	if (e[x].size() == 1) q[qe++] = x;
}

int main() {
	//freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
	ios_base::sync_with_stdio(0); cout.setf(ios::fixed); cout.precision(20);
	int n;
	cin >> n;
	for (int i = 1; i < n; i++) {
		int a, b;
		cin >> a >> b;
		e[a].insert(b);
		e[b].insert(a);
	}	
	for (int i = 1; i <= n; i++) {
		if (e[i].size() == 1) q[qe++] = i;
	}
	for% (int qb = 0; qb < qe; qb++) {
		int v = q[qb];
		int v2 = *e[v].begin();
		for (int u : e[v2]) {
			if (u != v)
				eredge(u, v2);
		}
	}
	cout << "Second" << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:63:12: error: expected '(' before '%' token
   63 |         for% (int qb = 0; qb < qe; qb++) {
      |            ^
      |            (
a.cc:63:12: error: expected primary-expression before '%' token
a.cc:63:15: error: expected primary-expression before 'int'
   63 |         for% (int qb = 0; qb < qe; qb++) {
      |               ^~~
a.cc:63:15: error: expected ')' before 'int'
   63 |         for% (int qb = 0; qb < qe; qb++) {
      |              ~^~~
      |               )
a.cc:63:27: error: 'qb' was not declared in this scope; did you mean 'qe'?
   63 |         for% (int qb = 0; qb < qe; qb++) {
      |                           ^~
      |                           qe
Language: C++

#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <string>
#include <algorithm>
#include <iostream>
#include <string>
#include <map>
#include <set>
#include <functional>
#include <iostream>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int n;
vector<int> G[100001];
int cnt[100001];
bool used[100001];
bool good[100001];

int dfs(int v){
	used[v]=true;
	if(G[v].size()>=3){
		used[v]=false;
		if(cnt[v]>=1)return 1;
		return -1000000;
	}
	for(int i=0;i<G[v].size();i++){
		if(!used[G[v][i]]){
			return (dfs(G[v][i])+1);
		}
	}
}

void dfs2(int v,int d){
	used[v]=true;
	if(G[v].size()>=3){
		used[v]=false;
		if(d%2==1)good[v]=true;
		return;
	}
	for(int i=0;i<G[v].size();i++){
		if(!used[G[v][i]]){
			dfs2(G[v][i],d+1);
		}
	}
}

int main(void){
	scanf("%d",&n);
	for(int i=0;i<n-1;i++){
		int a,b;
		scanf("%d%d",&a,&b);
		a--;
		b--;
		G[a].push_back(b);
		G[b].push_back(a);
	}
	for(int i=0;i<n;i++){
		if(G[i].size()==1){
			cnt[G[i][0]]++;
		}
	}
	for(int i=0;i<n;i++){
		if(cnt[i]>=2){
			printf("First\n");
			return 0;
		}
	}
	int on=0,se=0;
	bool flag=true;
	for(int i=0;i<n;i++){
		if(G[i].size()==1){
			on++;
		}
		if(G[i].size()==2){
			se++;
		}
		if(G[i].size()>2){
			flag=false;
		}
	}
	if(flag && on==2 && se==n-2){
		printf("%s\n",n%2==1?"First":"Second");
		return 0;
	}
	for(int i=0;i<n;i++){
		if(!used[i] && G[i].size()==1){
			if(dfs(i)==4){
				printf("First\n");
				return 0;
			}
		}
	}
	memset(used,false,sizeof(used));
	for(int i=0;i<n;i++){
		if(cnt[i]==1 || G[i][j].size()>=3){
			for(int j=0;j<G[i].size();j++){
				if(used[G[i][j]] && G[G[i][j]].size()==2){
					printf("First\n");
					return 0;
				}
				used[G[i][j]]=true;
			}
		}
	}
	memset(used,false,sizeof(used));
	memset(good,false,sizeof(good));
	/*
	for(int i=0;i<n;i++){
		if(!used[i] && G[i].size()==1){
			dfs2(i,0);
		}
	}
	for(int i=0;i<n;i++){
		if(G[i].size()>=3 && !good[i]){
			printf("First\n");
			return 0;
		}
	}*/

	printf("Second\n");
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:100:38: error: 'j' was not declared in this scope
  100 |                 if(cnt[i]==1 || G[i][j].size()>=3){
      |                                      ^
a.cc: In function 'int dfs(int)':
a.cc:36:1: warning: control reaches end of non-void function [-Wreturn-type]
   36 | }
      | ^
Language: C++

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

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

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define ALL(c) (c).begin(),(c).end()

int N;
vi g[100010];
int c[100010];
int st[100010];
bool ok;

void dfs(int v, int p)
{
	int s = 0;
	int c = 0;
	int codd = 0;
	int ceven = 0;
	bool only_path = 1;

	for (int to : g[v]) {
		if (to != p) {
			dfs(to, v);

			if (st[to] == 0) {
				++codd;
			} else if (st[to] == 1) {
				++ceven;
			} else {
				only_path = 0;
			}

			if (c) {
				s = -1;
			} else {
				if (st[to] == -1) {
					s = -1;
				} else {
					s = (st[to] ^ 1);
				}
			}

			++c;
		}
	}

	st[v] = s;

	if (codd >= 2 || (onlypath && ceven > 0 && codd == 0)) {
		ok = 1;
	}
	//cout<<v<<" " << st[v] << endl;
}

int main() {
	scanf("%d", &N);

	rep(i, N-1) {
		int a, b;
		scanf("%d%d", &a, &b);
		--a; --b;
		g[a].pb(b); g[b].pb(a);
	}

	int r = -1;

	rep(i, N) if (g[i].size() >= 3) {
		r = i;
		break;
	}

	if (r == -1) {
		ok = N & 1;
	} else {
	//	cout<<r<<endl;
		dfs(r, -1);
	}

	puts(ok ? "First" : "Second");

	return 0;
}

Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:59:27: error: 'onlypath' was not declared in this scope; did you mean 'only_path'?
   59 |         if (codd >= 2 || (onlypath && ceven > 0 && codd == 0)) {
      |                           ^~~~~~~~
      |                           only_path
Language: C++

#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
using namespace std;
const int N=100010;
int e[N*2],next[N*2],head[N],ed=0;
int d[N];
void adde(int x,int y){e[++ed]=y;next[ed]=head[x];head[x]=ed;}
int main(){
    int n,x,y,i,j,sum;
    scanf("%d",&n);
    for(i=1;i<n;i++){
        scanf("%d %d",&x,&y);
        adde(x,y);adde(y,x);
        d[x]++;d[y]++;
    }
    for(i=1;i<=n;i++){
        sum=0;
        for(j=head[i];j;j=next[j])
            if(d[e[j]]==1) sum++;
        if(sum>=2){printf("First\n");return 0;}
    }
    printf("Second\n");
    return 0;
}


Compiler output:
a.cc: In function 'void adde(int, int)':
a.cc:12:34: error: reference to 'next' is ambiguous
   12 | void adde(int x,int y){e[++ed]=y;next[ed]=head[x];head[x]=ed;}
      |                                  ^~~~
In file included from /usr/include/c++/14/string:47,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:10:12: note:                 'int next [200020]'
   10 | int e[N*2],next[N*2],head[N],ed=0;
      |            ^~~~
a.cc: In function 'int main()':
a.cc:23:27: error: reference to 'next' is ambiguous
   23 |         for(j=head[i];j;j=next[j])
      |                           ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:10:12: note:                 'int next [200020]'
   10 | int e[N*2],next[N*2],head[N],ed=0;
      |            ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define For(n) for(int i = 0; i < n; i++)
#define FOR(i, r, k) for(int i = r; i < k; i ++)
#define pb push_back
#define X first
#define Y second
#define mp make_pair
const ll maxn = 1e5 + 244;
const ll mod = 1e9 + 7;
const ll inf = 1e18 + 500;
ll l[maxn];
bool b[maxn];
vector < ll > g[maxn];
int main()
{
    ll n, m;
    cin >> n;
    m = n - 1;
    For(m)
    {
        int u, v;
        cin >> u >> v;
        g[u].pb(v);
        g[v].pb(u);
    }
    if(n & 1)
    {
        cout << "First";
        return 0;
    }
    For(n)
    {
        if(g[i + 1].size() == 1)
        {
            b[i + 1] = 1;
        }
    }
    For(n)
    {
        int x = 0;
        for(int j = 0; j < g[i + 1].size(); j++)
        {
            if(b[g[i + 1][j]])
                x ++;
        }
        if(x >= 2)
        {
            cout << "First";
            return 0;
        }
    }
    // momkene first she:)
    else cout << "Second";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:55:5: error: 'else' without a previous 'if'
   55 |     else cout << "Second";
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define fr first
#define ii pair<int,int>
#define sc second
#define mp make_pair
#define All(v) v.begin(),v.end()
using namespace std;
vector < int > v[300000];
int main()
{
int n;
cin>>n;
for(int i=0;i<n-1;i++)
{
    int x,y;
    scanf("%d%d",&x,&y);
    v[x].push_back(y);
    v[y].push_back(x);
}
int ok = 0;
for(int i=0;i<n;i++)
{
    int ans = 0;
    for(int j=0;j<v[i].size();j++)
    {
       if(v[i][j].size() < 3)
       {
           ans++;
       }
    }
    if(ans > 1)
        ok = 1;
}
if(ok)
    cout<<"First";
else
    cout<<"Secound";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:19: error: request for member 'size' in 'v[i].std::vector<int>::operator[](((std::vector<int>::size_type)j))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   27 |        if(v[i][j].size() < 3)
      |                   ^~~~
Language: C++

#include <bIts/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n;
vector <int> a[N];

int cou(int u) {
    int res = 0;
    for (int i = 0; i < a[u].size(); i++) {
        int v = a[u][i];
        if (a[v].size() == 1) res++;
    }
    return res;
}

int main() {
    scanf("%d", &n);
    for (int i = 1; i < n; i++) {
        int x, y; scanf("%d %d", &x, &y);
        a[x].push_back(y);
        a[y].push_back(x);
    }
    for (int i = 1; i <= n; i++) {
        if (cou(i) >= 2) {
            cout << "First" << endl;
            return 0;
        }
    }
    cout << "Second" << endl;
}


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