#include <bits/stdc++.h>
#include "grader.cpp"
#define forn(i, a, b) for(int i = int(a); i <= int(b); ++ i)
#define pb push_back
using namespace std;
typedef vector<int> vi;
const int lim = 15e4;
vi graph[lim + 2];
int res = 0;
int limite, objetivo;
void dfs(int padre, int u, int paso){
if(paso == limite){
if(objetivo == u){
res ++;
}
return;
}
if((int) graph[u].size() == 1){
dfs(u, graph[u][0], paso + 1);
return;
}
for(int &v : graph[u]){
if(v != padre){
dfs(u, v, paso + 1);
return;
}
}
}
void count_routes(int N, int M, int P, int R[][2], int Q, int G[]) {
forn(i, 0, M - 1){
if((int) graph[R[i][0]].size() < 2){
graph[R[i][0]].pb(R[i][1]);
}
if((int) graph[R[i][1]].size() < 2){
graph[R[i][1]].pb(R[i][0]);
}
}
objetivo = P;
limite = G[0];
forn(i, 0, N - 1){
dfs(i, i, 0);
}
answer(res);
}
Compilation message
/usr/bin/ld: /tmp/ccvLGVPW.o: in function `read_input()':
grader.cpp:(.text+0x0): multiple definition of `read_input()'; /tmp/ccN9ZKzX.o:garden.cpp:(.text+0x50): first defined here
/usr/bin/ld: /tmp/ccvLGVPW.o: in function `answer(int)':
grader.cpp:(.text+0x130): multiple definition of `answer(int)'; /tmp/ccN9ZKzX.o:garden.cpp:(.text+0x180): first defined here
/usr/bin/ld: /tmp/ccvLGVPW.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccN9ZKzX.o:garden.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status