예제 #1
0
int main() {
	adj_table adj = prepare_test_case();

	adj_table::TopologicalOrderContainer order;
	adj.topological_sort(order);

	const size_t from = 0, to = 1;
	printf("%u path(s) from %u to %u.\n", count_paths(adj, order, from, to), from, to);
}
예제 #2
0
long long int count_paths(int r, int c){
	if(r  == 0 || c == 0){
		return(0);
	}
	return( 1 + count_paths(r-1,c) + count_paths(r,c-1));
}
예제 #3
0
int main(){
  printf("%lld\n",count_paths(TARGET,TARGET) + 1);
}