結果
問題 | No.455 冬の大三角 |
ユーザー | yn |
提出日時 | 2016-12-06 01:27:21 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 144 ms / 2,000 ms |
コード長 | 1,305 bytes |
コンパイル時間 | 171 ms |
コンパイル使用メモリ | 82,260 KB |
実行使用メモリ | 89,196 KB |
最終ジャッジ日時 | 2024-06-29 21:06:30 |
合計ジャッジ時間 | 10,122 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 135 ms
88,556 KB |
testcase_01 | AC | 133 ms
88,528 KB |
testcase_02 | AC | 135 ms
88,832 KB |
testcase_03 | AC | 134 ms
88,452 KB |
testcase_04 | AC | 133 ms
88,456 KB |
testcase_05 | AC | 132 ms
88,480 KB |
testcase_06 | AC | 133 ms
88,480 KB |
testcase_07 | AC | 134 ms
88,504 KB |
testcase_08 | AC | 137 ms
88,880 KB |
testcase_09 | AC | 135 ms
88,576 KB |
testcase_10 | AC | 134 ms
88,524 KB |
testcase_11 | AC | 141 ms
88,464 KB |
testcase_12 | AC | 137 ms
88,488 KB |
testcase_13 | AC | 133 ms
88,500 KB |
testcase_14 | AC | 135 ms
88,352 KB |
testcase_15 | AC | 135 ms
88,492 KB |
testcase_16 | AC | 139 ms
88,420 KB |
testcase_17 | AC | 137 ms
88,636 KB |
testcase_18 | AC | 136 ms
88,540 KB |
testcase_19 | AC | 131 ms
88,500 KB |
testcase_20 | AC | 132 ms
88,508 KB |
testcase_21 | AC | 133 ms
88,372 KB |
testcase_22 | AC | 133 ms
88,276 KB |
testcase_23 | AC | 135 ms
88,664 KB |
testcase_24 | AC | 132 ms
88,464 KB |
testcase_25 | AC | 133 ms
88,360 KB |
testcase_26 | AC | 132 ms
88,536 KB |
testcase_27 | AC | 135 ms
88,460 KB |
testcase_28 | AC | 133 ms
88,560 KB |
testcase_29 | AC | 139 ms
88,768 KB |
testcase_30 | AC | 144 ms
88,680 KB |
testcase_31 | AC | 139 ms
88,864 KB |
testcase_32 | AC | 137 ms
89,164 KB |
testcase_33 | AC | 139 ms
88,808 KB |
testcase_34 | AC | 133 ms
88,224 KB |
testcase_35 | AC | 136 ms
88,944 KB |
testcase_36 | AC | 134 ms
88,844 KB |
testcase_37 | AC | 136 ms
89,028 KB |
testcase_38 | AC | 137 ms
88,676 KB |
testcase_39 | AC | 135 ms
88,796 KB |
testcase_40 | AC | 135 ms
88,908 KB |
testcase_41 | AC | 135 ms
88,872 KB |
testcase_42 | AC | 135 ms
88,844 KB |
testcase_43 | AC | 137 ms
89,196 KB |
testcase_44 | AC | 135 ms
88,656 KB |
testcase_45 | AC | 138 ms
89,016 KB |
testcase_46 | AC | 136 ms
89,016 KB |
testcase_47 | AC | 139 ms
88,476 KB |
testcase_48 | AC | 136 ms
88,744 KB |
testcase_49 | AC | 135 ms
88,464 KB |
testcase_50 | AC | 133 ms
88,368 KB |
testcase_51 | AC | 134 ms
88,520 KB |
testcase_52 | AC | 134 ms
88,716 KB |
testcase_53 | AC | 135 ms
88,204 KB |
testcase_54 | AC | 134 ms
88,648 KB |
testcase_55 | AC | 136 ms
88,684 KB |
testcase_56 | AC | 136 ms
88,104 KB |
ソースコード
import fractions h, w = map(int,input().split()) s = [list(input()) for i in range(h)] star = [] for j in range(h): for i in range(w): if s[j][i] == "*": star.append(j) star.append(i) f = False for j in range(h): for i in range(w): if s[j][i] == "*": continue if j == star[0] == star[2]: continue if i == star[1] == star[3]: continue if star[0] == star[2]: s[j][i] = "*" f = True break if star[1] == star[3]: s[j][i] = "*" f = True break if star[1] - star[3] != 0 and i - star[3] != 0 and \ fractions.Fraction((star[0] - star[2]), (star[1] - star[3])) == \ fractions.Fraction((j - star[2]), (i - star[3])): continue else: s[j][i] = "*" f = True break if star[0] - star[2] != 0 and j - star[2] != 0 and \ fractions.Fraction((star[1] - star[3]), (star[0] - star[2])) == \ fractions.Fraction((i - star[3]), (j - star[2])): continue else: s[j][i] = "*" f = True break if f: break for j in range(h): print("".join(s[j][:]))