ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1741. Communication Fiend

Using Short path algo seems feasible
Posted by Blackops 10 Sep 2016 10:49
You can take the Lisenced order for 1~n,and make the Pirate for n+1~n+n;
then it can be obviously refered that :
Regard the Lisened path that only u to v,then Pirate is that u+n to v+n and u to v+n,then Cracked is that u to v and u+n to v+n.
then take spfa(1) check the d[n] and d[n<<1] if they are inf or available
sorry for that my English is poor to some extent
Re: Using Short path algo seems feasible
Posted by Combatcook 10 Sep 2016 21:43
Thanks! Very useful tip.