結果

提出番号 2037
提出者 kage
言語 C++
提出日時 2018-08-04 15:01:47
問題名 (69)机の配置
結果 WA
点数 0%

テストケース

テストケース 結果 得点 実行時間 メモリ使用量
1 AC 100% 2ms 8416KB
2 WA 0% 1ms 7824KB
3 WA 0% 2ms 8400KB
4 WA 0% 2ms 8416KB
5 WA 0% 2ms 8192KB
6 WA 0% 2ms 8080KB
7 WA 0% 2ms 8112KB
8 WA 0% 2ms 8400KB
9 WA 0% 1ms 8480KB
10 WA 0% 2ms 7824KB
11 WA 0% 2ms 8688KB
12 WA 0% 2ms 8448KB
13 AC 100% 1ms 8304KB
14 WA 0% 1ms 7904KB
15 WA 0% 1ms 8080KB
16 WA 0% 2ms 8368KB
17 WA 0% 2ms 8736KB
18 WA 0% 2ms 7824KB
19 WA 0% 2ms 8176KB
20 WA 0% 1ms 7920KB
21 WA 0% 2ms 7536KB
22 WA 0% 1ms 8704KB
23 WA 0% 1ms 8064KB
24 WA 0% 2ms 8128KB
25 WA 0% 2ms 8144KB
26 WA 0% 1ms 8736KB
27 WA 0% 2ms 8416KB
28 AC 100% 2ms 8624KB
29 WA 0% 1ms 7904KB
30 WA 0% 2ms 7920KB

ソースコード

#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define erep(i,a,b) for(int i=a;i<=(int)(b);++i)
#define per(i,a,b) for(int i=(b);i>(a);--i)
#define eper(i,a,b) for(int i=((int)(a));i>=b;--i)
#define pb push_back
#define mp make_pair
#define INF (1<<28)-1
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a/gcd(a, b)*b;}

int n, h, w;
char g[11][11];
int ans1[100], ans2[100];
int main() {
 ios::sync_with_stdio ( false );
 cin.tie ( 0 );
    cin >> n >> h >> w;
    rep(i, 0, h) rep(j, 0, w) cin >> g[i][j];
    erep(item, 1, n) {
        rep(i, 0, h) {
            rep(j, 0, w-item+1) {
                bool flag = true;
                rep(k, j, j+item) {
                    if (g[i][k] == '#') flag = false;
                }
                if (flag) {
                    ans1[item-1]++;
                    j += item-1;
                }
            }
        }

        rep(i, 0, w) {
            rep(j, 0, h-item+1) {
                bool flag = true;
                rep(k, j, j+item) {
                    if (g[i][k] == '#') flag = false;
                }
                if (flag) {
                    ans2[item-1]++;
                    j += item-1;
                }
            }
        }
    }
    rep(i, 0, n) cout << max(ans1[i], ans2[i]) << endl;
    return 0;
}