結果

提出番号 158
提出者 Luzhiled
言語 C++
提出日時 2017-06-30 23:08:45
問題名 (6)休憩スペース (Refreshment Area)
結果 AC
点数 100%

テストケース

テストケース 結果 得点 実行時間 メモリ使用量
1 AC 100% 1ms 8208KB
2 AC 100% 1ms 7680KB
3 AC 100% 62ms 8112KB
4 AC 100% 1ms 7552KB
5 AC 100% 2ms 8336KB
6 AC 100% 2ms 8160KB
7 AC 100% 2ms 8192KB

ソースコード

#include <bits/stdc++.h>
using namespace std;

#define fs first
#define sc second
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define pb emplace_back

using pii = pair<int, int>;
using vi = vector<int>;
using lint = long long;

const int inf = 1001001001;
const lint linf = 1001001001001001001ll;
const int mod = 1e9 + 7;
const int dx[]{0, 1, 0, -1, -1, -1, 1, 1}, dy[]{1, 0, -1, 0, -1, 1, -1, 1};

template<typename T> inline bool chmin(T &a, T b) { if (a > b) { a = b; } return a > b; }
template<typename T> inline bool chmax(T &a, T b) { if (a < b) { a = b; } return a < b; }
template<typename T> inline void print(const T &x, string s = "\n") { cout << x << s; }
template<typename T> inline void print(const vector<T> &v, string s = " ") 
{ rep(i, v.size()) cout << v[i] << (i + 1 == v.size() ? "\n" : s); }
inline bool inside(int y, int x, int H, int W) { return 0 <= y && y < H && 0 <= x && x < W; }
inline lint in() { lint x; std::cin>>x; return x; }

int main() {
	int n = in(), m = in(), d = in();
	char c[110][110];

	rep(i, n) rep(j, m) cin >> c[i][j];

	int ans = 0;
	rep (i, n - d + 1) rep(j, m) {
		bool f = true;
		rep(k, d) if (c[i + k][j] == '#') f = false;
		ans += f;
	}
	rep (j, m - d + 1) rep(i, n) {
		bool f = true;
		rep(k, d) if (c[i][j + k] == '#') f = false;
		ans += f;
	}

	print(ans);
}