Div II, 500 points

The explanation in the editorial is cleaner, more efficient, and better: instead of going through each white stone and seeing if it's alive, go through each empty square and mark all of the white stones connected to it.  Then any white stone that isn't visited by the dfs is "dead."