Hint in Japanese.
http://acm-icpc.aitea.net/index.php?plugin=attach&pcmd=open&file=fox_hint.png&refer=2013%2FPractice%2F%B2%C6%B9%E7%BD%C9%2F%A5%AA%A5%F3%A5%E9%A5%A4%A5%F3%A5%B3%A5%F3%A5%C6%A5%B9%A5%C8%B0%C6%C6%E2
Sorry for some misunderstanding in the previous clar.
Still, [NOTE] is pretty ambiguous.
* Ciel uses this algorithm in the Wikipedia?
* What is depth?
* What is heuristic value of node? It is p_i for leaf nodes?
Sorry, problem statement was mofidied. Please reload page.
Please see figure of situation.
http://acm-icpc.aitea.net/index.php?plugin=attach&pcmd=open&file=trodden_cable_description.png&refer=2013%2FPractice%2F%B2%C6%B9%E7%BD%C9%2F%A5%AA%A5%F3%A5%E9%A5%A4%A5%F3%A5%B3%A5%F3%A5%C6%A5%B9%A5%C8%B0%C6%C6%E2
For the sample input 4, if
* on the node 1, evaluation order is 2 -> 3
* on the node 3, evaluation order is 4 -> 5
then after evaluating node 4, alpha = 100 and beta = 100, so by pruning, only 2 leaf nodes are evaluated. I doubt that the output is correct.
Sorry, problem statement was modified. Please reload page.
In the pseudocode,
> (* Initial call *)
> alphabeta(origin, depth, -infinity, +infinity, TRUE)
What is the "depth"? I think this is not described anywhere in the problem statement.
> Evaluation value except leaf node is always 0. This does not mean the evaluation values of non-leaf nodes are 0. You have to calculate them if necessary.
"Evaluation value <written in the input> except leaf node is always 0. This does not mean the <actual> evaluation values of non-leaf nodes are 0. You have to calculate them if necessary."
Right?
> The first line includes an x−y pair (0≤x≤W, 0≤y≤H), which represents the coordinate of a staff's initial cell.
Should this be 0 <= x < W, 0 <= y < H?
You say there are H * W cells. If 0≤x≤W, 0≤y≤H, (H + 1) * (W + 1) cells are possible???
Yes, 0 <= x < W, 0 <= y < H s correct. We are sorry for misunderstanding and mistakes.