Hi
i don't understand :
- SIGABRT meaning.
- where is the problem exactly in my code.
spoj.pl/problems/KFSTB
#include <iostream>
using namespace std;
class point
{
private :
int R[10000],r;
public:
point()
{
r=-1;
}
void add(int i)
{
++r;
R[r]=i;
}
void go(point* B,int* NUm,int t)
{
for(int k=0;k<=r;++k)
{
if(R[k]==t) ++*NUm;
else B[R[k]].go(B,NUm,t);
}
}
};
int main()
{
int d,c,b,s,t,x,y,N;
scanf("%d",&d);
for(int i=0;i<d;++i)
{
N=0;
cin>>c>>b>>s>>t;
point* A=new point [c];
for(int j=0;j<b;++j)
{
cin>>x>>y;
A[x-1].add(y-1);
}
A[s-1].go(A,&N,t-1);
cout<<N%1000000007<<"\n";
delete[] A;
}
return 0;
}
simple explain:
class point is denoting for "camping spots" .
R :every point has R array for record numbers of points that can reach from this point by "the one way bridges".
r :a counter for R.
add : for record points in R
go : for start check from the first point in main (s) and move to other pionts according to R for each point until arrive to t and ++NUm or until k=r (wrong way)
thanks alot
)