結果

提出番号 1589
提出者 hamayanhamayan
言語 C++
提出日時 2018-08-04 13:13:12
問題名 (69)机の配置
結果 WA
点数 0%

テストケース

テストケース 結果 得点 実行時間 メモリ使用量
1 AC 100% 3ms 8336KB
2 WA 0% 1ms 7904KB
3 AC 100% 2ms 7840KB
4 WA 0% 2ms 8016KB
5 WA 0% 2ms 7792KB
6 AC 100% 2ms 7824KB
7 AC 100% 2ms 8736KB
8 AC 100% 2ms 8400KB
9 AC 100% 1ms 8720KB
10 WA 0% 2ms 8720KB
11 WA 0% 2ms 8144KB
12 AC 100% 1ms 8272KB
13 AC 100% 2ms 7904KB
14 AC 100% 2ms 8448KB
15 WA 0% 2ms 8416KB
16 WA 0% 2ms 7968KB
17 WA 0% 2ms 8448KB
18 WA 0% 2ms 7968KB
19 AC 100% 2ms 8416KB
20 WA 0% 2ms 8416KB
21 AC 100% 2ms 7808KB
22 WA 0% 1ms 8304KB
23 WA 0% 1ms 8256KB
24 AC 100% 2ms 8128KB
25 WA 0% 2ms 8448KB
26 WA 0% 2ms 7776KB
27 WA 0% 2ms 8480KB
28 AC 100% 2ms 7984KB
29 WA 0% 1ms 8416KB
30 AC 100% 2ms 8256KB

ソースコード

#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
            ∧_∧  
      ∧_∧  (´<_` )  Welcome to My Coding Space!
     ( ´_ゝ`) /  ⌒i     
    /   \     | |     
    /   / ̄ ̄ ̄ ̄/  |  
  __(__ニつ/     _/ .| .|____  
     \/____/ (u ⊃  
---------------------------------------------------------------------------------------------------*/




int N, H, W;
string F[10], FF[10];
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> N >> H >> W;
    rep(y, 0, H) cin >> F[y];

    rep(i, 1, N + 1) {
        int ans = 0;

        {   // 縦
            rep(y, 0, H) FF[y] = F[y];
            int cnt = 0;
            rep(y, 0, H) rep(x, 0, W - i + 1) {
                int ok = 1;
                rep(xx, x, x + i) if (FF[y][xx] == '#') ok = 0;
                if (ok) {
                    cnt++;
                    rep(xx, x, x + i) FF[y][xx] = '#';
                }
            }
            chmax(ans, cnt);
        }

        {   // 横
            rep(y, 0, H) FF[y] = F[y];
            int cnt = 0;
            rep(x, 0, W) rep(y, 0, H - i + 1) {
                int ok = 1;
                rep(yy, y, y + i) if (FF[yy][x] == '#') ok = 0;
                if (ok) {
                    cnt++;
                    rep(yy, y, y + i) FF[yy][x] = '#';
                }
            }
            chmax(ans, cnt);
        }

        printf("%d\n", ans);
    }
}