結果

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

テストケース

テストケース 結果 得点 実行時間 メモリ使用量
1 AC 100% 1ms 8720KB
2 AC 100% 2ms 8016KB
3 AC 100% 1ms 8480KB
4 AC 100% 2ms 7776KB
5 AC 100% 2ms 7552KB
6 AC 100% 2ms 8048KB
7 AC 100% 2ms 8400KB
8 AC 100% 1ms 8336KB
9 AC 100% 2ms 8720KB
10 AC 100% 1ms 8704KB
11 AC 100% 2ms 8192KB
12 AC 100% 2ms 8176KB
13 AC 100% 2ms 8016KB
14 AC 100% 2ms 7968KB
15 AC 100% 2ms 8432KB
16 AC 100% 1ms 7920KB
17 AC 100% 2ms 8416KB
18 AC 100% 2ms 8448KB
19 AC 100% 1ms 8112KB
20 AC 100% 2ms 8448KB
21 AC 100% 2ms 7776KB
22 AC 100% 2ms 8448KB
23 AC 100% 2ms 8016KB
24 AC 100% 2ms 8432KB
25 AC 100% 1ms 8304KB
26 AC 100% 1ms 8304KB
27 AC 100% 2ms 8416KB
28 AC 100% 2ms 7488KB
29 AC 100% 1ms 8736KB
30 AC 100% 2ms 7760KB

ソースコード

#include <bits/stdc++.h>
typedef long long ll;
using std::cout;
using std::endl;
using std::cin;

int main(){
	int n, h, w; cin >> n >> h >> w; std::vector<std::string> s(h);
	for(int i = 0; i < h; i++) cin >> s[i];
	
	for(int k = 1; k <= n; k++) {
		int ans = 0;
		for(int i = 0; i < h; i++) {
			for(int j = 0; j < w - k + 1; j++) {
				auto w = s[i].substr(j, k);
				
				bool f = false;
				for(auto c : w) if(c == '#') f = true;
				if(f) continue;
				j += k - 1; ans++;
			}
		}
		
		cout << ans << endl;
	}
	
	
	return 0;
}