結果

提出番号 1975
提出者 _ei1333
言語 C++
提出日時 2018-08-04 14:47:06
問題名 (69)机の配置
結果 AC
点数 100%

テストケース

テストケース 結果 得点 実行時間 メモリ使用量
1 AC 100% 2ms 7904KB
2 AC 100% 2ms 8448KB
3 AC 100% 2ms 8432KB
4 AC 100% 1ms 8352KB
5 AC 100% 2ms 7632KB
6 AC 100% 2ms 7536KB
7 AC 100% 1ms 7520KB
8 AC 100% 2ms 8304KB
9 AC 100% 2ms 7536KB
10 AC 100% 2ms 7888KB
11 AC 100% 1ms 8688KB
12 AC 100% 2ms 7648KB
13 AC 100% 2ms 8448KB
14 AC 100% 1ms 7920KB
15 AC 100% 2ms 8080KB
16 AC 100% 2ms 8416KB
17 AC 100% 1ms 8720KB
18 AC 100% 2ms 7808KB
19 AC 100% 2ms 8688KB
20 AC 100% 1ms 7520KB
21 AC 100% 1ms 7520KB
22 AC 100% 2ms 7824KB
23 AC 100% 2ms 7904KB
24 AC 100% 1ms 8272KB
25 AC 100% 2ms 7520KB
26 AC 100% 2ms 7616KB
27 AC 100% 2ms 8448KB
28 AC 100% 2ms 7824KB
29 AC 100% 2ms 8384KB
30 AC 100% 2ms 8720KB

ソースコード

#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define int long long
using namespace std;
typedef pair<int, int> P;
const int INF = 1e15;

int n, h, w;
string s[11];

signed main(){
    cin >> n >> h >> w;
    rep(i, 0, h){
        cin >> s[i];
    }
    for(int l = 1; l <= n; l++){
        int ans = 0;
        rep(i, 0, h){
            rep(j, 0, w - l + 1){
                if(s[i][j] == '#') continue;
                bool f = true;
                rep(k, 0, l){
                    if(s[i][j + k] == '#') f = false;
                }
                if(f){
                    ans++;
                    j += l - 1;
                }
            }
        }
        cout << ans << endl;
    }
}