結果

問題 No.455 冬の大三角
ユーザー nebukuro09nebukuro09
提出日時 2016-12-07 15:12:13
言語 Python2
(2.7.18)
結果
AC  
実行時間 15 ms / 2,000 ms
コード長 673 bytes
コンパイル時間 427 ms
コンパイル使用メモリ 6,656 KB
実行使用メモリ 6,044 KB
最終ジャッジ日時 2023-09-12 08:33:25
合計ジャッジ時間 3,697 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
5,992 KB
testcase_01 AC 11 ms
5,904 KB
testcase_02 AC 11 ms
5,844 KB
testcase_03 AC 11 ms
5,968 KB
testcase_04 AC 11 ms
5,964 KB
testcase_05 AC 11 ms
5,952 KB
testcase_06 AC 11 ms
5,960 KB
testcase_07 AC 11 ms
5,916 KB
testcase_08 AC 15 ms
5,928 KB
testcase_09 AC 11 ms
5,884 KB
testcase_10 AC 11 ms
5,916 KB
testcase_11 AC 11 ms
5,908 KB
testcase_12 AC 11 ms
5,956 KB
testcase_13 AC 11 ms
5,900 KB
testcase_14 AC 11 ms
5,848 KB
testcase_15 AC 11 ms
5,836 KB
testcase_16 AC 11 ms
5,884 KB
testcase_17 AC 11 ms
5,992 KB
testcase_18 AC 11 ms
5,880 KB
testcase_19 AC 11 ms
5,984 KB
testcase_20 AC 11 ms
5,964 KB
testcase_21 AC 11 ms
5,844 KB
testcase_22 AC 11 ms
5,888 KB
testcase_23 AC 11 ms
5,952 KB
testcase_24 AC 11 ms
5,824 KB
testcase_25 AC 11 ms
5,840 KB
testcase_26 AC 11 ms
5,916 KB
testcase_27 AC 11 ms
6,044 KB
testcase_28 AC 11 ms
5,916 KB
testcase_29 AC 13 ms
5,968 KB
testcase_30 AC 13 ms
5,908 KB
testcase_31 AC 12 ms
5,972 KB
testcase_32 AC 11 ms
6,020 KB
testcase_33 AC 14 ms
5,856 KB
testcase_34 AC 11 ms
5,840 KB
testcase_35 AC 12 ms
5,968 KB
testcase_36 AC 12 ms
5,852 KB
testcase_37 AC 12 ms
5,852 KB
testcase_38 AC 12 ms
5,916 KB
testcase_39 AC 14 ms
5,832 KB
testcase_40 AC 12 ms
5,884 KB
testcase_41 AC 13 ms
5,988 KB
testcase_42 AC 12 ms
5,824 KB
testcase_43 AC 11 ms
6,000 KB
testcase_44 AC 11 ms
5,832 KB
testcase_45 AC 13 ms
5,832 KB
testcase_46 AC 13 ms
5,956 KB
testcase_47 AC 13 ms
5,992 KB
testcase_48 AC 12 ms
5,916 KB
testcase_49 AC 11 ms
5,900 KB
testcase_50 AC 11 ms
5,908 KB
testcase_51 AC 11 ms
5,892 KB
testcase_52 AC 11 ms
5,904 KB
testcase_53 AC 11 ms
5,992 KB
testcase_54 AC 11 ms
5,904 KB
testcase_55 AC 11 ms
5,828 KB
testcase_56 AC 11 ms
5,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H, W = map(int, raw_input().split())
B = [raw_input() for _ in xrange(H)]

s = []
for i in xrange(H):
    for j in xrange(W):
        if B[i][j] == '*':
            s.append((i, j))

flag = False
for i in xrange(H):
    for j in xrange(W):
        if (B[i][j] != '*'):
            v1 = (s[0][0]-i, s[0][1]-j)
            v2 = (s[1][0]-i, s[1][1]-j)
            if (v1[0]*v2[1] != v1[1]*v2[0]):
                x, y = i, j
                flag = True
                break
    if flag:
        break

for i in xrange(H):
    s = ''
    for j in xrange(W):
        if B[i][j] == '*' or (i == x and j == y):
            s += '*'
        else:
            s += '-'
    print s
0