#define fast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#include <bits/stdc++.h>
using namespace std;
#define sqr 500
#define mid (l+r)/2
#define pb push_back
#define ppb pop_back
#define fi first
#define se second
#define lb lower_bound
#define ub upper_bound
#define ins insert
#define era erase
#define C continue
#define mem(dp,i) memset(dp,i,sizeof(dp))
#define mset multiset
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pi;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pi> vpi;
typedef vector<pll> vpll;
const ll mod=1000000007;//998244353;
const ll inf=1e18*4;
const ld pai=acos(-1);
#include "garden.h"
//#include "gardenlib.h"
int n,m,to,k,sum,z;
vpi v[10009];
int done[100099],Pa[100009];
void dfs(int node,int num){
if(z)return ;
if(node==-1){
z=1;
return ;
}
if(num>k){
z=1;
return ;
}
if(num==k){
sum+=(node==to);
z=1;
return;
}
for(auto U: v[node]){
int x=U.fi,u=U.se;
if(done[x])C;
done[x]=1;
Pa[u]=node;
dfs(u,num+1);
if(z)return ;
}
if(z)return ;
dfs(Pa[node],num+1);
}
void count_routes(int N, int M, int P, int R[][2], int Q, int G[]){
n=N,m=M,to=P,k=G[0];
for(int i=0;i<m;i++){
int a,b;
a=R[i][0],b=R[i][1];
v[a].pb({i,b});
v[b].pb({i,a});
}
for(int i=0;i<n;i++)sort(v[i].begin(),v[i].end());
for(int i=0;i<n;i++){
mem(done,0);
mem(Pa,-1);
z=0;
dfs(i,0);
}
return answer(sum);
}
Compilation message
garden.cpp: In function 'void count_routes(int, int, int, int (*)[2], int, int*)':
garden.cpp:74:16: error: 'answer' was not declared in this scope
return answer(sum);
^~~~~~
garden.cpp:74:16: note: suggested alternative: 'assert'
return answer(sum);
^~~~~~
assert
garden.cpp:74:26: error: return-statement with a value, in function returning 'void' [-fpermissive]
return answer(sum);
^