結果

問題 No.179 塗り分け
ユーザー a_s_ka_s_k
提出日時 2023-11-06 01:49:39
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 842 bytes
コンパイル時間 2,143 ms
コンパイル使用メモリ 205,900 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-11-06 01:49:44
合計ジャッジ時間 4,788 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include"bits/stdc++.h"
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i,m,n) for(ll i=(ll)m;i<(ll)n;i++)
#define Endl endl
#define pr(i,j) make_pair(i,j) 
const ll mod = 998244353;
const ll inf = 5e18;
const ld pi = 3.14159265358979;
int main() {
	ll h, w;
	cin >> h >> w;
	vector<string>m(h);
	rep(i, 0, h)cin >> m[i];
	rep(i, -70, 70) {
		rep(j, -70, 70) {
			if (i == 0 && j == 0)continue;
			vector<string>copy = m;
			rep(k, 0, h) {
				rep(l, 0, w) {
					if (copy[k][l] == '#') {
						if (!(0 <= k + i && k + i < h))goto next;
						if (!(0 <= l + j && l + j < w))goto next;
						if (copy[k + i][l + j] == '#') {
							copy[k + i][l + j] = '.';
							copy[k][l] = '.';
						}
						else goto next;
					}
				}
			}
			cout << "YES" << endl;
			return 0;
			next:{}
		}
	}
	cout << "NO" << endl;
}
0