1) read input to
Code: Select all
g: array [1 .. n, 1 .. n] of boolean
2) for this problem graph consists of nodes(=g) and two nodes [i1, j1] & [i2, j2] joined if |i1-12|<=1 and |j1-j2|<=1.
3) for this graph I start BFS.
I think that it is right algorithm. But I get WA again and again.
Here my code:
[pascal]program acm572; { Oil Deposits }
____DELETED________
[/pascal]