結果
問題 | No.179 塗り分け |
ユーザー | aka_satana_ha |
提出日時 | 2017-11-25 20:32:41 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,081 bytes |
コンパイル時間 | 122 ms |
コンパイル使用メモリ | 10,928 KB |
実行使用メモリ | 13,012 KB |
最終ジャッジ日時 | 2023-08-18 06:37:48 |
合計ジャッジ時間 | 5,365 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 18 ms
12,560 KB |
testcase_01 | AC | 17 ms
8,240 KB |
testcase_02 | AC | 16 ms
8,244 KB |
testcase_03 | AC | 16 ms
8,212 KB |
testcase_04 | AC | 16 ms
8,152 KB |
testcase_05 | AC | 34 ms
8,260 KB |
testcase_06 | AC | 18 ms
8,316 KB |
testcase_07 | AC | 17 ms
8,288 KB |
testcase_08 | AC | 17 ms
8,172 KB |
testcase_09 | AC | 17 ms
8,216 KB |
testcase_10 | AC | 151 ms
8,548 KB |
testcase_11 | AC | 132 ms
8,520 KB |
testcase_12 | TLE | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
testcase_26 | -- | - |
testcase_27 | -- | - |
testcase_28 | -- | - |
testcase_29 | -- | - |
testcase_30 | -- | - |
testcase_31 | -- | - |
testcase_32 | -- | - |
testcase_33 | -- | - |
testcase_34 | -- | - |
testcase_35 | -- | - |
testcase_36 | -- | - |
testcase_37 | -- | - |
testcase_38 | -- | - |
testcase_39 | -- | - |
testcase_40 | -- | - |
testcase_41 | -- | - |
testcase_42 | -- | - |
testcase_43 | -- | - |
testcase_44 | -- | - |
testcase_45 | -- | - |
ソースコード
H,W = [int(i) for i in input().split()] mass = [] for i in range(H): mass.append(input()) black = [[False for i in range(W)] for j in range(H)] black_count = 0 black_mass = [] for i in range(H): for j in range(W): if mass[i][j]=="#": black[i][j]=True black_mass.append([i,j]) black_count+=1 else: black[i][j]=False ans=False if len(black_mass)!=0: ref_point=black_mass[0] for move_point in black_mass: if move_point == ref_point: continue paired_mass=[] paired_mass.append(ref_point) paired_mass.append(move_point) diff=[move_point[0]-ref_point[0],move_point[1]-ref_point[1]] for test_point in black_mass: if(test_point in paired_mass): continue tmp_add=[test_point[0]+diff[0],test_point[1]+diff[1]] if(not(tmp_add in black_mass)): break paired_mass.append(test_point) paired_mass.append(tmp_add) if len(paired_mass)==len(black_mass): ans=True break print("YES" if ans==True else "NO")