Please give me any hint or solution for this problem.
# | User | Rating |
---|---|---|
1 | ecnerwala | 3649 |
2 | Benq | 3581 |
3 | orzdevinwang | 3570 |
4 | Geothermal | 3569 |
4 | cnnfls_csy | 3569 |
6 | tourist | 3565 |
7 | maroonrk | 3531 |
8 | Radewoosh | 3521 |
9 | Um_nik | 3482 |
10 | jiangly | 3468 |
# | User | Contrib. |
---|---|---|
1 | maomao90 | 174 |
2 | awoo | 164 |
3 | adamant | 161 |
4 | TheScrasse | 159 |
5 | nor | 158 |
6 | maroonrk | 156 |
7 | -is-this-fft- | 152 |
8 | SecondThread | 147 |
9 | orz | 146 |
10 | pajenegod | 145 |
Please give me any hint or solution for this problem.
Name |
---|
If vertex p is the parent of v and (h[v]-h[p]) = (s[v]-s[p]), it means that all edges from p to v directed from p to v.
If vertex p is the parent of v and (h[v]-h[p]) = -(s[v]-s[p]), it means that all edges from p to v directed from v to p.
For every query (a,b):
Sorry for my english.