| //https://www.acmicpc.net/problem/2799 #include <iostream> | |
| #include <string> | |
| using namespace std; | |
| int cnt[5]; | |
| int main(){ | |
| int m, n; | |
| cin >> m >>n; | |
| char win[501][501]; | |
| for(int i=0; i<5*m+1; i++){ | |
| cin >> win[i]; | |
| } | |
| for(int i=1; i<5*m+1; i+=5){ | |
| for(int j=1; j<5*n+1; j+=5){ | |
| for(int w=i; w<i+4; w++){ | |
| if(win[w][j]=='.'){ | |
| cnt[w-i]++; | |
| break; | |
| } | |
| if(w==i+3) cnt[4]++; | |
| } | |
| } | |
| } | |
| for(int i=0; i<5; i++){ | |
| cout << cnt[i]<<" "; | |
| } | |
| return 0; | |
| } |
'알고리즘 문제 풀이 > 1DP_과제(~180615)' 카테고리의 다른 글
| 180501_2587_대표값2 (0) | 2018.05.01 |
|---|---|
| 180430_2845_파티가 끝나고 난 뒤 (0) | 2018.04.30 |
| 180427_2959_거북이 (0) | 2018.04.27 |
| 180426_1236_성 지키기 (0) | 2018.04.26 |
| 180425_1568_새 (0) | 2018.04.25 |