結果

問題 No.179 塗り分け
ユーザー 41Toame41Toame
提出日時 2018-08-17 13:41:16
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,167 bytes
コンパイル時間 1,542 ms
コンパイル使用メモリ 159,108 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-17 04:42:21
合計ジャッジ時間 2,797 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 WA -
testcase_08 AC 5 ms
5,376 KB
testcase_09 WA -
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 5 ms
5,376 KB
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 1 ms
5,376 KB
testcase_18 AC 2 ms
5,376 KB
testcase_19 AC 1 ms
5,376 KB
testcase_20 AC 4 ms
5,376 KB
testcase_21 AC 5 ms
5,376 KB
testcase_22 AC 6 ms
5,376 KB
testcase_23 AC 1 ms
5,376 KB
testcase_24 AC 5 ms
5,376 KB
testcase_25 AC 2 ms
5,376 KB
testcase_26 WA -
testcase_27 AC 3 ms
5,376 KB
testcase_28 WA -
testcase_29 AC 3 ms
5,376 KB
testcase_30 WA -
testcase_31 AC 3 ms
5,376 KB
testcase_32 AC 2 ms
5,376 KB
testcase_33 AC 2 ms
5,376 KB
testcase_34 WA -
testcase_35 AC 2 ms
5,376 KB
testcase_36 AC 1 ms
5,376 KB
testcase_37 AC 2 ms
5,376 KB
testcase_38 AC 2 ms
5,376 KB
testcase_39 AC 2 ms
5,376 KB
testcase_40 AC 1 ms
5,376 KB
testcase_41 AC 1 ms
5,376 KB
testcase_42 AC 2 ms
5,376 KB
testcase_43 AC 2 ms
5,376 KB
testcase_44 AC 1 ms
5,376 KB
testcase_45 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	int H, W;
	cin >> H >> W;
	char s[H][W];
	rep(i, H) rep(j, W) cin >> s[i][j];
	rep(l, H) {
		rep(r, W) {
			if (l == 0 && r == 0) continue;
			char k[H][W];
			rep(i, H) rep(j, W) k[i][j] = s[i][j];
			bool f = true;
			rep(i, H - l) {
				if (f == false) break;
				rep(j, W - r) {
					//cout << i + l << " " << j + r << endl;
					if (k[i][j] == '#') {
						if (k[i + l][j + r] != '#') {
							f = false;
							break;
						}
						k[i][j] = '.';
						k[i + l][j + r] = '.';
					}
				}
			}
			rep(i, H) {
				rep(j, W) {
					if (k[i][j] == '#') {
						f = false;
						break;
					}
				}
			}
			if (f) {
				cout << "YES" << endl;
				return 0;
			}
		}
	}
	cout << "NO" << endl;

	return 0;
}
0