Rescuing Vanessa yet again!
All submissions for this problem are available.
Well , now that Ajax has escaped alive from the scene, he obviously wants to take a revenge. So Ajax goes to Weasel’s bar and learns about Vanessa, meanwhile Wade goes to the place where Vanessa works but is unable to face her. In response Ajax kidnaps Vanessa and asks Deadpool to come rescue her on a decommissioned helicarrier in scrapyard. If only Deadpool can reach Vanessa in given time T.
Now, Deadpool hires a taxi to reach Vanessa and you know who the driver is, its Darpinder. Deadpool is in a hurry and wants to reach the scrapyard as soon as possible, but New York city is no less than a maze. You can imagine New York to be an acyclic connected graph with N streets and roads connecting them numbered as 1,2,3…N-1. Ajax learns about Deadpool’s moves and wishes to stop him. Ajax can perform the following two type of moves:
Your task is to report the whether Deadpool can rescue Vanessa or not. If the time between street A to street B is greater than T, he cannot rescue her then print “No” else print “Deadpool is a hero”.
of streets and time given by Ajax.
For each testcase print whether Deadpool can rescue Vanessa or not.
- 1 ≤ t ≤ 20
- 1 ≤ N ≤ 10^4
- 1 ≤ T ≤ 123456
- 1 ≤ c ≤ 10^6
- 1 ≤ M ≤ 10^4
Input: 1 3 3 1 2 1 1 3 2 3 QUERY 1 2 CHANGE 1 10 QUERY 1 2 Output: Deadpool is a hero No
Problem Setter : Anish Sinha
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, PYP3, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.