結果

問題 No.179 塗り分け
ユーザー sugim48sugim48
提出日時 2015-04-05 23:33:03
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,205 bytes
コンパイル時間 671 ms
コンパイル使用メモリ 90,364 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-10 11:15:05
合計ジャッジ時間 2,230 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <unordered_map>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int v, w; };

ll MOD = 1000000009;
ll _MOD = 1000000009;
double EPS = 1e-10;

int main() {
	int H, W; cin >> H >> W;
	vector<string> S(H);
	for (int y = 0; y < H; y++)
		cin >> S[y];
	for (int dy = 0; dy < H; dy++)
		for (int dx = 0; dx < W; dx++) {
			if (dx == 0 && dy == 0) continue;
			vector<string> s = S;
			bool ok = true;
			for (int y = 0; y < H; y++)
				for (int x = 0; x < W; x++) {
					if (s[y][x] == '.') continue;
					if (x + dx >= W || y + dy >= H) {
						ok = false;
						continue;
					}
					s[y][x] = '.';
				}
			if (ok) {
				cout << "YES" << endl;
				return 0;
			}
		}
	cout << "NO" << endl;
}
0