結果
問題 | No.179 塗り分け |
ユーザー | nbisco |
提出日時 | 2017-02-24 00:49:38 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,237 bytes |
コンパイル時間 | 266 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 11,008 KB |
最終ジャッジ日時 | 2024-10-03 03:32:44 |
合計ジャッジ時間 | 7,087 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 30 ms
10,752 KB |
testcase_01 | AC | 29 ms
10,624 KB |
testcase_02 | AC | 28 ms
10,752 KB |
testcase_03 | AC | 28 ms
10,752 KB |
testcase_04 | AC | 29 ms
10,880 KB |
testcase_05 | AC | 28 ms
10,880 KB |
testcase_06 | WA | - |
testcase_07 | AC | 28 ms
10,752 KB |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | AC | 28 ms
10,752 KB |
testcase_11 | AC | 32 ms
10,752 KB |
testcase_12 | AC | 733 ms
10,880 KB |
testcase_13 | AC | 27 ms
10,880 KB |
testcase_14 | AC | 28 ms
10,880 KB |
testcase_15 | AC | 27 ms
10,752 KB |
testcase_16 | WA | - |
testcase_17 | AC | 28 ms
10,880 KB |
testcase_18 | AC | 39 ms
10,752 KB |
testcase_19 | WA | - |
testcase_20 | AC | 32 ms
10,752 KB |
testcase_21 | AC | 30 ms
10,752 KB |
testcase_22 | AC | 76 ms
10,752 KB |
testcase_23 | WA | - |
testcase_24 | AC | 60 ms
10,752 KB |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | AC | 209 ms
10,752 KB |
testcase_28 | WA | - |
testcase_29 | AC | 318 ms
10,752 KB |
testcase_30 | WA | - |
testcase_31 | AC | 418 ms
10,880 KB |
testcase_32 | AC | 117 ms
10,752 KB |
testcase_33 | AC | 439 ms
10,624 KB |
testcase_34 | WA | - |
testcase_35 | AC | 524 ms
10,624 KB |
testcase_36 | AC | 29 ms
10,752 KB |
testcase_37 | AC | 30 ms
10,752 KB |
testcase_38 | AC | 29 ms
10,752 KB |
testcase_39 | AC | 28 ms
10,624 KB |
testcase_40 | AC | 28 ms
10,880 KB |
testcase_41 | AC | 29 ms
10,752 KB |
testcase_42 | AC | 29 ms
10,752 KB |
testcase_43 | AC | 34 ms
10,752 KB |
testcase_44 | AC | 64 ms
10,752 KB |
testcase_45 | AC | 29 ms
10,880 KB |
ソースコード
def move_ok(_S, H, W, count, diff): S = [[_S[i][j] for j in range(W)] for i in range(H)] for i in range(H): for j in range(W): if S[i][j] == ".": continue elif i+diff[0] < H and j+diff[1] < W \ and S[i+diff[0]][j+diff[1]] == "#": count -= 2 S[i+diff[0]][j+diff[1]] = "." return count == 0 def main(): H, W = map(int, input().split(" ")) S = [] for i in range(H): S.append(list(input())) start = [-1,-1] count = 0 for i in range(H): count += S[i].count("#") if start[0] != -1: for j in range(W): if S[i][j] == "#": start[0] = i start[1] = j break if count % 2 != 0: print("NO") return for i in range(start[0], H): for j in range(W): if start[0] == i and start[1] == j: continue if S[i][j] == ".": continue diff = (i-start[0], j-start[1]) if move_ok(S, H, W, count, diff): print("YES") return print("NO") if __name__ == "__main__": main()