結果

問題 No.455 冬の大三角
ユーザー ynyn
提出日時 2016-12-06 01:23:19
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 938 bytes
コンパイル時間 140 ms
コンパイル使用メモリ 82,696 KB
実行使用メモリ 89,152 KB
最終ジャッジ日時 2024-05-05 21:12:50
合計ジャッジ時間 10,009 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
88,576 KB
testcase_01 AC 132 ms
88,528 KB
testcase_02 AC 132 ms
88,576 KB
testcase_03 RE -
testcase_04 AC 131 ms
88,448 KB
testcase_05 AC 130 ms
88,448 KB
testcase_06 AC 130 ms
88,560 KB
testcase_07 AC 135 ms
88,064 KB
testcase_08 RE -
testcase_09 RE -
testcase_10 AC 130 ms
88,528 KB
testcase_11 AC 133 ms
88,472 KB
testcase_12 AC 128 ms
88,532 KB
testcase_13 AC 131 ms
88,192 KB
testcase_14 RE -
testcase_15 AC 130 ms
88,384 KB
testcase_16 AC 128 ms
88,612 KB
testcase_17 AC 130 ms
88,192 KB
testcase_18 AC 128 ms
88,424 KB
testcase_19 AC 133 ms
88,508 KB
testcase_20 AC 132 ms
88,448 KB
testcase_21 RE -
testcase_22 AC 130 ms
88,692 KB
testcase_23 AC 129 ms
88,576 KB
testcase_24 AC 131 ms
88,552 KB
testcase_25 AC 130 ms
88,576 KB
testcase_26 AC 131 ms
88,448 KB
testcase_27 RE -
testcase_28 RE -
testcase_29 AC 134 ms
88,888 KB
testcase_30 AC 134 ms
88,940 KB
testcase_31 RE -
testcase_32 AC 136 ms
88,988 KB
testcase_33 AC 138 ms
88,832 KB
testcase_34 AC 133 ms
88,476 KB
testcase_35 AC 133 ms
89,088 KB
testcase_36 AC 133 ms
88,964 KB
testcase_37 AC 133 ms
88,848 KB
testcase_38 AC 133 ms
88,956 KB
testcase_39 AC 133 ms
89,076 KB
testcase_40 AC 132 ms
88,680 KB
testcase_41 AC 133 ms
88,720 KB
testcase_42 AC 132 ms
88,896 KB
testcase_43 AC 133 ms
89,152 KB
testcase_44 AC 132 ms
88,908 KB
testcase_45 AC 133 ms
89,048 KB
testcase_46 AC 134 ms
89,016 KB
testcase_47 AC 136 ms
88,768 KB
testcase_48 AC 132 ms
88,940 KB
testcase_49 AC 130 ms
88,444 KB
testcase_50 AC 129 ms
88,316 KB
testcase_51 AC 131 ms
88,472 KB
testcase_52 AC 127 ms
88,452 KB
testcase_53 AC 132 ms
88,712 KB
testcase_54 AC 129 ms
88,336 KB
testcase_55 AC 129 ms
88,728 KB
testcase_56 AC 132 ms
88,320 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