#include "garden.h"
#include "gardenlib.h"
#include <iostream>
using namespace std;
long long int pre,ans,n,m,p,map[1005][1005],tag[10005],ta;
int find(int x,int pe)
{
//cout<<x<<" "<<pe<<endl;
if(pe==ta)
{
if(x==p)ans++;
return 0;
}
int tmp=0,now=-1,h=0;
for(int i=0;i<n;i++)
{
if(map[x][i]!=-1)
{
if(now==-1)
{
if(map[x][i]==pre)h=1;
tmp=map[x][i];
now=i;
}
else
{
if(h==1)
{
if(map[x][i]!=pre)
{
h=0;
tmp=map[x][i];
now=i;
}
else if(map[x][i]<tmp)
{
tmp=map[x][i];
now=i;
}
}
else if(map[x][i]!=pre && map[x][i]<tmp)
{
tmp=map[x][i];
now=i;
}
}
//cout<<h<<" "<<tmp<<" "<<now<<" "<<i<<" "<<map[x][i]<<endl;
}
}
tag[tmp]=1;
pre=tmp;
find(now,pe+1);
}
void count_routes(int N, int M, int P, int R[][2], int Q, int G[])
{
n=N,m=M,p=P,ta=G[0];
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)map[i][j]=-1;
}
for(int i=0;i<m;i++)
{
map[R[i][0]][R[i][1]]=i;
map[R[i][1]][R[i][0]]=i;
}
for(int i=0;i<n;i++)
{
pre=-1;
for(int j=0;j<m;j++)tag[j]=0;
//cout<<i<<endl;
find(i,0);
}
answer(ans);
}
Compilation message
ricehub.cpp:1:10: fatal error: garden.h: No such file or directory
#include "garden.h"
^~~~~~~~~~
compilation terminated.