More Detailed Problem Description
I understand the theory for this problem (fast matrix exponentiation), but I need a problem to test my code on, as I was not able to find one after multiple Internet searches. Could someone please provide a problem that asks for a solution along these lines?
Thanks in advance!
166E - Tetrahedron: This is basically same problem, but here you are given the graph in problem statement.
http://codeforces.me/gym/101081/problem/G
Hey lucaasdamaso, Could you take a look at my code? I've tried to solve it, but It gave me "wrong answer on test 15" https://ideone.com/FvMNbo
its possible a situation where the number of paths is 0 modulo 1e9+7, so u have to print 0 instead of -1. sorry for bad english
That was my mistake. Thanks lucaasdamaso!