結果

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

テストケース

テストケース 結果 得点 実行時間 メモリ使用量
1 AC 100% 2ms 8128KB
2 AC 100% 2ms 8112KB
3 AC 100% 2ms 8416KB
4 AC 100% 1ms 7760KB
5 AC 100% 2ms 7776KB
6 AC 100% 1ms 8304KB
7 AC 100% 2ms 8432KB
8 AC 100% 2ms 7792KB
9 AC 100% 2ms 8144KB
10 AC 100% 2ms 8416KB
11 AC 100% 2ms 7776KB
12 AC 100% 2ms 8160KB
13 AC 100% 1ms 8720KB
14 AC 100% 2ms 7968KB
15 AC 100% 2ms 8432KB
16 AC 100% 2ms 8368KB
17 AC 100% 2ms 8400KB
18 AC 100% 2ms 8416KB
19 AC 100% 2ms 8416KB
20 AC 100% 2ms 8384KB
21 AC 100% 2ms 7248KB
22 AC 100% 1ms 8672KB
23 AC 100% 2ms 8672KB
24 AC 100% 2ms 8432KB
25 AC 100% 2ms 8048KB
26 AC 100% 1ms 8400KB
27 AC 100% 2ms 7520KB
28 AC 100% 2ms 8400KB
29 AC 100% 2ms 8688KB
30 AC 100% 2ms 7248KB

ソースコード

#include <bits/stdc++.h>

using namespace std;

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

int n,h,w;
char f[25][21];

int solve(int l){
  int ans = 0;
  REP(_,1){
    int tmp = 0;
    REP(i,h){
      int cnt = 0;
      REP(j,w){
        if(f[i][j]=='#'){
          cnt = 0;
          continue;
        }
        cnt++;
        if(cnt == l){
          cnt = 0;
          tmp++;
        }
      }
    }
    ans = max(ans, tmp);
    // int sz = max(w,h);
    // REP(i,sz)REP(j,i)swap(f[i][j], f[j][i]);
    // swap(w,h);
  }
  return ans;
}

int main(){
  scanf("%d%d%d",&n,&h,&w);
  REP(i,h)scanf("%s",f[i]);
  FOR(l,1,n+1){
    printf("%d\n",solve(l));
  }
  return 0;
}