結果
問題 | No.2641 draw X |
ユーザー | 👑 rin204 |
提出日時 | 2024-02-19 21:52:29 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,777 bytes |
コンパイル時間 | 232 ms |
コンパイル使用メモリ | 82,348 KB |
実行使用メモリ | 124,912 KB |
最終ジャッジ日時 | 2024-09-29 01:51:04 |
合計ジャッジ時間 | 6,427 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 33 ms
53,268 KB |
testcase_01 | AC | 38 ms
53,996 KB |
testcase_02 | AC | 34 ms
54,116 KB |
testcase_03 | AC | 32 ms
53,012 KB |
testcase_04 | AC | 32 ms
53,420 KB |
testcase_05 | AC | 32 ms
54,172 KB |
testcase_06 | AC | 33 ms
53,744 KB |
testcase_07 | AC | 32 ms
52,752 KB |
testcase_08 | AC | 34 ms
52,868 KB |
testcase_09 | AC | 34 ms
53,072 KB |
testcase_10 | AC | 32 ms
53,416 KB |
testcase_11 | AC | 33 ms
53,268 KB |
testcase_12 | AC | 33 ms
53,680 KB |
testcase_13 | AC | 40 ms
52,592 KB |
testcase_14 | AC | 35 ms
53,488 KB |
testcase_15 | AC | 145 ms
124,668 KB |
testcase_16 | AC | 268 ms
123,532 KB |
testcase_17 | AC | 32 ms
52,936 KB |
testcase_18 | AC | 34 ms
53,080 KB |
testcase_19 | AC | 34 ms
53,956 KB |
testcase_20 | AC | 101 ms
80,624 KB |
testcase_21 | AC | 103 ms
84,404 KB |
testcase_22 | AC | 110 ms
79,984 KB |
testcase_23 | WA | - |
testcase_24 | AC | 70 ms
79,120 KB |
testcase_25 | AC | 72 ms
78,944 KB |
testcase_26 | WA | - |
testcase_27 | AC | 104 ms
79,236 KB |
testcase_28 | AC | 101 ms
92,876 KB |
testcase_29 | AC | 121 ms
106,500 KB |
testcase_30 | AC | 144 ms
106,916 KB |
testcase_31 | AC | 133 ms
97,008 KB |
testcase_32 | AC | 168 ms
114,484 KB |
testcase_33 | AC | 236 ms
113,884 KB |
testcase_34 | AC | 160 ms
98,844 KB |
testcase_35 | AC | 161 ms
95,348 KB |
testcase_36 | AC | 210 ms
120,132 KB |
testcase_37 | AC | 312 ms
123,260 KB |
testcase_38 | AC | 215 ms
117,612 KB |
testcase_39 | WA | - |
testcase_40 | WA | - |
testcase_41 | AC | 193 ms
117,932 KB |
testcase_42 | AC | 237 ms
120,412 KB |
testcase_43 | WA | - |
ソースコード
h, w = map(int, input().split()) S = [input() for _ in range(h)] ul = [[0] * w for _ in range(h)] ur = [[0] * w for _ in range(h)] dl = [[0] * w for _ in range(h)] dr = [[0] * w for _ in range(h)] for i in range(h): for j in range(w): if S[i][j] == ".": continue if i == 0: ul[i][j] = 1 ur[i][j] = 1 continue ul[i][j] = 1 ur[i][j] = 1 if j != 0: ul[i][j] = ul[i - 1][j - 1] + 1 if j != w - 1: ur[i][j] = ur[i - 1][j + 1] + 1 for i in range(h - 1, -1, -1): for j in range(w): if S[i][j] == ".": continue if i == h - 1: dl[i][j] = 1 dr[i][j] = 1 continue dl[i][j] = 1 dr[i][j] = 1 if j != 0: dl[i][j] = dl[i + 1][j - 1] + 1 if j != w - 1: dr[i][j] = dr[i + 1][j + 1] + 1 ul_imos = [[0] * (w + 1) for _ in range(h + 1)] ur_imos = [[0] * (w + 1) for _ in range(h + 1)] for i in range(h): for j in range(w): mi = min(ul[i][j], ur[i][j], dl[i][j], dr[i][j]) if mi <= 1: continue mi -= 1 ul_imos[i - mi][j + mi] += 1 ul_imos[i + mi + 1][j - mi - 1] -= 1 ur_imos[i - mi][j - mi] += 1 ur_imos[i + mi + 1][j + mi + 1] -= 1 for i in range(1, h + 1): for j in range(w + 1): if j != w: ul_imos[i][j] += ul_imos[i - 1][j + 1] if j != 0: ur_imos[i][j] += ur_imos[i - 1][j - 1] ok = True for i in range(h): for j in range(w): if S[i][j] == "#" and ul_imos[i][j] == 0 and ur_imos[i][j] == 0: ok = False break if not ok: break if ok: print("Yes") else: print("No")