結果

提出番号 1935
提出者 eiya
言語 C++
提出日時 2018-08-04 14:38:50
問題名 (69)机の配置
結果 WA
点数 0%

テストケース

テストケース 結果 得点 実行時間 メモリ使用量
1 AC 100% 2ms 8416KB
2 WA 0% 2ms 7904KB
3 AC 100% 2ms 8704KB
4 WA 0% 2ms 7536KB
5 WA 0% 2ms 8240KB
6 AC 100% 2ms 7504KB
7 AC 100% 2ms 8720KB
8 AC 100% 2ms 7808KB
9 AC 100% 2ms 7792KB
10 WA 0% 2ms 8432KB
11 WA 0% 2ms 8208KB
12 AC 100% 2ms 7840KB
13 AC 100% 2ms 7840KB
14 AC 100% 2ms 8448KB
15 WA 0% 2ms 8064KB
16 WA 0% 2ms 8112KB
17 WA 0% 2ms 8688KB
18 WA 0% 2ms 8464KB
19 AC 100% 2ms 8432KB
20 WA 0% 2ms 7616KB
21 AC 100% 2ms 8672KB
22 WA 0% 2ms 7424KB
23 WA 0% 2ms 8416KB
24 AC 100% 2ms 8736KB
25 WA 0% 2ms 8304KB
26 WA 0% 2ms 7248KB
27 WA 0% 2ms 7920KB
28 AC 100% 1ms 8080KB
29 WA 0% 2ms 8288KB
30 AC 100% 2ms 8496KB

ソースコード


#if 1
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>
#include <assert.h>
#include <bitset>
#include <list>

auto& in = std::cin;
auto& out = std::cout;
#define all_range(C) std::begin(C), std::end(C)
const double PI = 3.141592653589793238462643383279502884197169399375105820974944;

int32_t N,H,W;
char map1[20][20];
char map2[20][20];
char buf[20];

int main()
{
	using std::endl;
	in.sync_with_stdio(false);
	out.sync_with_stdio(false);
	in.tie(nullptr);
	out.tie(nullptr);

	in >> N >> H >> W;
	for (int32_t i = 1; i <= H; i++)
	{
		in >> (buf+1);
		for (int32_t j = 1; j <= W; j++)
		{
			map1[i][j] = map2[j][i] = buf[j];
		}
	}
	for (int32_t i = 0; i <= H+1; i++)
	{
		map1[i][0] = map1[i][W+1] = '#';
		map2[0][i] = map2[W + 1][i] = '#';
	}
	for (int32_t i = 0; i <= W+1; i++)
	{
		map1[0][i] = map1[H + 1][i] = '#';
		map2[i][0] = map2[i][H + 1] = '#';
	}

	for (int32_t LEN = 1; LEN <= N; LEN++)
	{
		int32_t res = 0;

		int32_t res_tmp = 0;
		for (int32_t i = 1; i <= H; i++)
		{
			int32_t now_count = 0;
			for (int32_t j = 1; j <= W; j++)
			{
				if (map1[i][j]=='#') {
					now_count = 0;
				}
				else {
					assert(map1[i][j] == '.');
					++now_count;
					if (now_count >= LEN) {
						now_count = 0;
						++res_tmp;
					}
				}
			}
		}
		res = std::max(res, res_tmp);

		res_tmp = 0;
		for (int32_t i = 1; i <= W; i++)
		{
			int32_t now_count = 0;
			for (int32_t j = 1; j <= H; j++)
			{
				if (map2[i][j] == '#') {
					now_count = 0;
				}
				else {
					assert(map2[i][j] == '.');
					++now_count;
					if (now_count >= LEN) {
						now_count = 0;
						++res_tmp;
					}
				}
			}
		}
		res = std::max(res, res_tmp);


		out << res << endl;
	}




	return 0;
}
#endif