結果

問題 No.455 冬の大三角
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2022-11-01 06:37:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 86 ms / 2,000 ms
コード長 664 bytes
コンパイル時間 348 ms
コンパイル使用メモリ 87,176 KB
実行使用メモリ 76,792 KB
最終ジャッジ日時 2023-09-23 02:27:28
合計ジャッジ時間 7,375 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,512 KB
testcase_01 AC 70 ms
71,256 KB
testcase_02 AC 72 ms
71,456 KB
testcase_03 AC 75 ms
71,460 KB
testcase_04 AC 70 ms
71,372 KB
testcase_05 AC 72 ms
71,376 KB
testcase_06 AC 71 ms
71,396 KB
testcase_07 AC 71 ms
71,548 KB
testcase_08 AC 86 ms
76,680 KB
testcase_09 AC 73 ms
71,380 KB
testcase_10 AC 71 ms
71,308 KB
testcase_11 AC 70 ms
71,404 KB
testcase_12 AC 71 ms
71,384 KB
testcase_13 AC 70 ms
71,524 KB
testcase_14 AC 70 ms
71,344 KB
testcase_15 AC 70 ms
71,396 KB
testcase_16 AC 71 ms
71,432 KB
testcase_17 AC 71 ms
71,516 KB
testcase_18 AC 71 ms
71,380 KB
testcase_19 AC 71 ms
71,216 KB
testcase_20 AC 71 ms
71,540 KB
testcase_21 AC 71 ms
71,520 KB
testcase_22 AC 70 ms
71,480 KB
testcase_23 AC 72 ms
71,376 KB
testcase_24 AC 71 ms
71,348 KB
testcase_25 AC 72 ms
71,248 KB
testcase_26 AC 71 ms
71,304 KB
testcase_27 AC 72 ms
71,376 KB
testcase_28 AC 70 ms
71,536 KB
testcase_29 AC 82 ms
76,788 KB
testcase_30 AC 80 ms
76,396 KB
testcase_31 AC 81 ms
76,792 KB
testcase_32 AC 80 ms
76,248 KB
testcase_33 AC 82 ms
76,752 KB
testcase_34 AC 72 ms
71,276 KB
testcase_35 AC 81 ms
76,724 KB
testcase_36 AC 82 ms
76,404 KB
testcase_37 AC 80 ms
76,432 KB
testcase_38 AC 80 ms
76,464 KB
testcase_39 AC 82 ms
76,396 KB
testcase_40 AC 81 ms
76,676 KB
testcase_41 AC 83 ms
76,740 KB
testcase_42 AC 80 ms
76,440 KB
testcase_43 AC 78 ms
76,432 KB
testcase_44 AC 79 ms
76,292 KB
testcase_45 AC 80 ms
76,756 KB
testcase_46 AC 83 ms
76,692 KB
testcase_47 AC 80 ms
76,776 KB
testcase_48 AC 82 ms
76,536 KB
testcase_49 AC 74 ms
71,352 KB
testcase_50 AC 73 ms
71,348 KB
testcase_51 AC 71 ms
71,244 KB
testcase_52 AC 73 ms
71,296 KB
testcase_53 AC 74 ms
75,552 KB
testcase_54 AC 72 ms
71,368 KB
testcase_55 AC 79 ms
76,232 KB
testcase_56 AC 73 ms
71,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H,W = map(int,input().split())
S = [list(input()) for _ in range(H)]
xi,yi = H+1,W+1
for i in range(H):
    for j in range(W):
        if S[i][j]=='*':
            xi,yi=i,j
            break
    if xi!=H+1:
        break

xj,yj = -1,-1
for i in range(H-1,-1,-1):
    for j in range(W-1,-1,-1):
        if S[i][j]=='*':
            xj,yj=i,j
            break
    if xj!=-1:
        break
for i in range(H):
    for j in range(W):
        dxi,dyi = xi-i,yi-j
        dxj,dyj = xj-i,yj-j
        if (dxi*dxj+dyi*dyj)**2!=(dxi**2+dyi**2)*(dxj**2+dyj**2):
            S[i][j]='*'

            for _ in range(H):
                print(*S[_],sep='')
            exit()
0