結果

問題 No.455 冬の大三角
ユーザー ynyn
提出日時 2016-12-06 01:23:19
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 938 bytes
コンパイル時間 1,726 ms
コンパイル使用メモリ 86,596 KB
実行使用メモリ 90,512 KB
最終ジャッジ日時 2023-08-18 16:06:02
合計ジャッジ時間 16,540 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 208 ms
89,248 KB
testcase_01 AC 209 ms
89,492 KB
testcase_02 AC 209 ms
89,520 KB
testcase_03 RE -
testcase_04 AC 209 ms
89,484 KB
testcase_05 AC 210 ms
89,512 KB
testcase_06 AC 212 ms
89,536 KB
testcase_07 AC 205 ms
89,308 KB
testcase_08 RE -
testcase_09 RE -
testcase_10 AC 204 ms
89,436 KB
testcase_11 AC 201 ms
89,564 KB
testcase_12 AC 204 ms
89,440 KB
testcase_13 AC 201 ms
89,580 KB
testcase_14 RE -
testcase_15 AC 211 ms
89,516 KB
testcase_16 AC 218 ms
89,528 KB
testcase_17 AC 213 ms
89,428 KB
testcase_18 AC 214 ms
89,508 KB
testcase_19 AC 215 ms
89,400 KB
testcase_20 AC 219 ms
89,200 KB
testcase_21 RE -
testcase_22 AC 215 ms
89,572 KB
testcase_23 AC 216 ms
89,520 KB
testcase_24 AC 216 ms
89,444 KB
testcase_25 AC 214 ms
89,556 KB
testcase_26 AC 217 ms
89,612 KB
testcase_27 RE -
testcase_28 RE -
testcase_29 AC 215 ms
90,152 KB
testcase_30 AC 216 ms
90,116 KB
testcase_31 RE -
testcase_32 AC 214 ms
90,512 KB
testcase_33 AC 216 ms
89,880 KB
testcase_34 AC 212 ms
89,520 KB
testcase_35 AC 214 ms
90,164 KB
testcase_36 AC 217 ms
89,992 KB
testcase_37 AC 218 ms
90,132 KB
testcase_38 AC 217 ms
90,156 KB
testcase_39 AC 222 ms
89,952 KB
testcase_40 AC 215 ms
89,880 KB
testcase_41 AC 213 ms
90,168 KB
testcase_42 AC 211 ms
90,256 KB
testcase_43 AC 218 ms
90,364 KB
testcase_44 AC 218 ms
89,956 KB
testcase_45 AC 222 ms
90,136 KB
testcase_46 AC 218 ms
90,108 KB
testcase_47 AC 218 ms
90,044 KB
testcase_48 AC 222 ms
90,160 KB
testcase_49 AC 212 ms
89,604 KB
testcase_50 AC 211 ms
89,336 KB
testcase_51 AC 211 ms
89,496 KB
testcase_52 AC 215 ms
89,560 KB
testcase_53 AC 212 ms
89,540 KB
testcase_54 AC 214 ms
89,604 KB
testcase_55 AC 210 ms
90,104 KB
testcase_56 AC 210 ms
89,208 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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 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 f:
        break

for j in range(h):
    print("".join(s[j][:]))
0