GOT  Gao on a tree
There's a tree, with each vertex assigned a number. For each query (a, b, c), you are asked whether there is a vertex on the path from a to b, which is assigned number c?
Input
Output
Example
Input:5 51 2 3 4 51 21 33 43 52 3 42 4 32 4 54 5 14 5 3Output:NotFindFindNotFindNotFindFind
hide comments
mahilewets:
20170816 19:24:57
C++14 Clang 4.0 is OK with DFSrecursion.


vladimira:
20170214 08:41:45
Last edit: 20170315 10:45:37 

aristofanis:
20140206 19:21:22
Be careful! Got AC with C++ 4.0.08 and for some reason the same code compiled with C++ 4.3.2 gave me SIGSEGV! I think it has to do with the maximum stack size, as I am using recursion... 

Hussain Kara Fallah:
20130524 05:30:32
for who solved this problem


:D:
20130214 11:05:59
I used b) per test case. Hopefully exact judge isn't used and that's not a problem. 

Luke Pebody:
20130214 09:22:56
What does "Output a blank line AFTER every case." mean in this case?


Buda IM (retired):
20121006 13:01:45
0<=c<=n 

[Hakuna Matata]:
20120918 05:03:06
Then n integers follows, representing the number assigned to the ith vertex.!!


lxyxynt:
20120818 07:00:50
I'm sorry for my mistake..The dataset has the testcase number T, and i have deleted it and all submit has rejudged. 

Damian Straszak:
20121005 21:31:07
getting SIGFPE on assertion "first vertex of edge" > n

Added by:  lxyxynt 
Date:  20120817 
Time limit:  0.602s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 