Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Biggest path diversity with N crossroads and M one-way roads

I have N crossroads (1 to N) and M one-way roads. Each road connects a pair of crossroads. Path which, would start at some crossing and which could get to the starting crossroad only by following those one-way streets (I mean a loop by that), doesn't exist.

I can rotate direction of one one-way road and I need to get biggest number of different ways from crossing 1 to crossing N.

I get N, M and M descriptions of every one-way road (where it starts and ends) in the assignment and I can get to any other crossing from 1 and from any crossing to N in every assignment.

Comments