結果

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

テストケース

テストケース 結果 得点 実行時間 メモリ使用量
1 AC 100% 2ms 8288KB
2 WA 0% 2ms 8064KB
3 WA 0% 9ms 0KB
4 WA 0% 7ms 0KB
5 WA 0% 10ms 0KB
6 WA 0% 15ms 0KB
7 WA 0% 2ms 8048KB
8 AC 100% 2ms 8416KB
9 WA 0% 10ms 0KB
10 WA 0% 8ms 0KB
11 WA 0% 8ms 0KB
12 WA 0% 2ms 8432KB
13 AC 100% 2ms 7792KB
14 WA 0% 10ms 0KB
15 WA 0% 8ms 0KB
16 WA 0% 2ms 8064KB
17 WA 0% 9ms 0KB
18 WA 0% 9ms 0KB
19 AC 100% 2ms 8432KB
20 WA 0% 2ms 8736KB
21 WA 0% 10ms 0KB
22 WA 0% 8ms 0KB
23 AC 100% 1ms 8080KB
24 WA 0% 8ms 0KB
25 WA 0% 9ms 0KB
26 AC 100% 2ms 8128KB
27 WA 0% 2ms 8416KB
28 AC 100% 2ms 8224KB
29 WA 0% 11ms 0KB
30 AC 100% 2ms 8688KB

ソースコード

#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin>>
#define Z class
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1e9+7,MAXL=1LL<<61,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef pair<int,int> P;

vector<string> rotate(vector<string> s) {
  int n=s.size(),m=s[0].size();
  vector<string> t(m);
  rep(i,m)rrep(j,n) t[i]+=s[j][i];
  return t;
}

void Main() {
  int n,m,d;
  cin >> d >> n >> m;
  vector<string> s(n);
  rep(i,n) R s[i];
  REP(l,1,d+1) {
    int ans=0;
    rep(r,2) {
      vector<string> t=s;
      int cnt=0;
      rep(i,n) {
        rep(j,m) {
          bool f=1;
          rep(k,l) {
            if(j+k>=m||t[i][j+k]=='#') {
              f=0;
              break;
            }
          }
          if(f) {
            rep(k,l) t[i][j+k]='#';
            cnt++;
          }
        }
      }
      ans=max(ans,cnt);
      s=rotate(s);
    }
    pr(ans);
  }
}

int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}