結果
問題 | No.179 塗り分け |
ユーザー |
![]() |
提出日時 | 2019-03-12 21:30:40 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 666 bytes |
コンパイル時間 | 85 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-06-23 15:53:36 |
合計ジャッジ時間 | 46,543 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 6 |
other | AC * 37 WA * 1 TLE * 2 |
ソースコード
a, b = map(int, input().split(' ')) sq = [input().strip() for i in range(a)] sq2 = [c for k in sq for c in k] ans = 'NO' if ('#' not in sq2) or sq2.count('#') % 2 == 1: print('NO') exit() for h in range(a): for w in range(b): if not (h == 0 and w == 0): sq3 = list('0'*len(sq2)) for t in range(len(sq2)): if sq2[t] == '#' and t < t+w+(b*h) < a*b: if sq2[t+w+(b*h)] == '#' and sq3[t]=='0': sq3[t] = '1' sq3[t+w+(b*h)] = '1' if sq2.count('#') == sq3.count('1'): ans = 'YES' break print(ans)