2 人解决,2 人已尝试。
2 份提交通过,共有 13 份提交。
8.5 EMB 奖励。
单点时限: 1.0 sec
内存限制: 256 MB
Farmer John has
Since he has extra cows to milk this year, FJ would like to expand some of his barns. A barn has room to expand if it does not share a corner or a wall with any other barn. That is, FJ can expand a barn if all four of its walls can be pushed outward by at least some amount without bumping into another barn. If two barns meet at a corner, neither barn can expand.
Please determine how many barns have room to expand.
A single integer that is the number of barns that can be expanded.
5 0 2 2 7 3 5 5 8 4 2 6 4 6 1 8 6 0 0 8 1
2
Explanation of the sample:
There are
Only two barns can be expanded — the first two listed in the input. All other barns are each in contact with at least one other barn.
2 人解决,2 人已尝试。
2 份提交通过,共有 13 份提交。
8.5 EMB 奖励。