| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 1024 MB | 0 | 0 | 0 | 0.000% |
Bessie's newest calf, Calfbert, has become achluophic; Calfbert is afraid of the dark. Bessie has decided light up the entire field so Calfbert will be able to go to sleep. Farmer John has already set up lamps in his field which light it completely, but, being an environmentally friendly cow, Bessie wishes to use as few of these lamps as possible.
Farmer John's field is a rectangular grid that has lamps in some of the squares of the grid. Each lamp, when lit, illuminates a 3x3 region (9 squares total) with the center being the actual location of the lamp. The light from some lamps spills outside the field, with no effect one way or the other. No square contains more than one lamp.
Your job is to find the minimal number of lamps that will still light every square of the entire field.
The output is a single line that contains one integer that is the minimum number of lit lamps required to illuminate each square in the field.
5 8 7 2 2 4 2 2 4 3 4 4 4 2 7 4 7
6