結果

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

テストケース

テストケース 結果 得点 実行時間 メモリ使用量
1 AC 100% 2ms 7824KB
2 AC 100% 2ms 8176KB
3 AC 100% 2ms 8016KB
4 AC 100% 2ms 7600KB
5 AC 100% 1ms 7904KB
6 AC 100% 2ms 7248KB
7 AC 100% 2ms 8400KB
8 AC 100% 2ms 7920KB
9 AC 100% 2ms 7920KB
10 AC 100% 2ms 8720KB
11 AC 100% 2ms 7792KB
12 AC 100% 2ms 8064KB
13 AC 100% 2ms 7760KB
14 AC 100% 2ms 8048KB
15 AC 100% 2ms 8016KB
16 AC 100% 2ms 8432KB
17 AC 100% 2ms 7824KB
18 AC 100% 1ms 8720KB
19 AC 100% 2ms 7776KB
20 AC 100% 2ms 7984KB
21 AC 100% 2ms 8720KB
22 AC 100% 2ms 8688KB
23 AC 100% 2ms 8096KB
24 AC 100% 2ms 8128KB
25 AC 100% 2ms 8416KB
26 AC 100% 1ms 8400KB
27 AC 100% 2ms 8304KB
28 AC 100% 2ms 8400KB
29 AC 100% 2ms 7888KB
30 AC 100% 1ms 7520KB

ソースコード

#include<bits/stdc++.h>
using ll  = long long;
#define int ll
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define erep(e,v) for(auto && e :v)
#define all(in) in.begin(), in.end()
#define MP make_pair
#define INF (sizeof(int) == 4 ? 1e9:1e18)
#define EPS 0.0000000001
using namespace std;
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
template<typename Head, typename Value> auto vectors(const Head &head, const Value &v) { return vector<Value>(head, v); }
template<typename Head, typename... Tail> auto vectors(Head x, Tail... tail) { auto inner = vectors(tail...); return vector<decltype(inner)>(x, inner); }
template<class T> void join(T a){for(auto itr :a){if(itr != *a.begin())cout << " "; cout << itr;} }
using ld  = long double;
using pii = pair<int,int>;
using piii = pair<int,pii>;
int W,H;
int dx[]={0,0,1,-1}, dy[]={1,-1,0,0};
bool valid(int x,int y){return (0<=x&&x<W)&&(0<=y&&y<H);}
signed main(){
    int h,w,n; cin >> n >> h >> w;
    vector<string>g(h);
    erep(e,g)cin >> e;
    vector<int>ans;
    rep(k,n){
        int res = 0;
        int l = k+1;
        rep(i,h){
            for(int j = 0; j < g[i].size();j++){
                if(j + l > g[i].size())continue;
                bool flag = true;
                for(int x = j; x < j + l;x++){
                    if(g[i][x] == '#')flag = false;
                }
                if(flag){ res++; j = j + l - 1;}
            }
        }
        ans.push_back(res);
    }
    erep(e, ans)cout << e << endl;
}