結果

問題 No.455 冬の大三角
ユーザー maspymaspy
提出日時 2020-01-07 21:44:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 516 bytes
コンパイル時間 90 ms
コンパイル使用メモリ 10,936 KB
実行使用メモリ 29,768 KB
最終ジャッジ日時 2023-08-14 23:34:39
合計ジャッジ時間 11,150 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
29,616 KB
testcase_01 AC 128 ms
29,616 KB
testcase_02 AC 126 ms
29,648 KB
testcase_03 AC 128 ms
29,624 KB
testcase_04 AC 129 ms
29,656 KB
testcase_05 AC 126 ms
29,664 KB
testcase_06 AC 129 ms
29,640 KB
testcase_07 AC 128 ms
29,616 KB
testcase_08 AC 129 ms
29,608 KB
testcase_09 AC 129 ms
29,600 KB
testcase_10 AC 129 ms
29,628 KB
testcase_11 AC 128 ms
29,680 KB
testcase_12 AC 125 ms
29,672 KB
testcase_13 AC 128 ms
29,604 KB
testcase_14 AC 129 ms
29,704 KB
testcase_15 AC 129 ms
29,648 KB
testcase_16 AC 127 ms
29,660 KB
testcase_17 AC 128 ms
29,596 KB
testcase_18 AC 127 ms
29,604 KB
testcase_19 AC 130 ms
29,632 KB
testcase_20 AC 133 ms
29,768 KB
testcase_21 AC 126 ms
29,592 KB
testcase_22 AC 127 ms
29,512 KB
testcase_23 AC 125 ms
29,600 KB
testcase_24 AC 125 ms
29,616 KB
testcase_25 AC 126 ms
29,580 KB
testcase_26 AC 126 ms
29,636 KB
testcase_27 AC 129 ms
29,612 KB
testcase_28 AC 129 ms
29,632 KB
testcase_29 AC 128 ms
29,760 KB
testcase_30 AC 128 ms
29,672 KB
testcase_31 AC 134 ms
29,604 KB
testcase_32 AC 132 ms
29,656 KB
testcase_33 AC 132 ms
29,732 KB
testcase_34 AC 131 ms
29,608 KB
testcase_35 AC 130 ms
29,688 KB
testcase_36 AC 129 ms
29,672 KB
testcase_37 AC 129 ms
29,636 KB
testcase_38 AC 130 ms
29,596 KB
testcase_39 AC 130 ms
29,604 KB
testcase_40 AC 131 ms
29,588 KB
testcase_41 AC 128 ms
29,660 KB
testcase_42 AC 128 ms
29,676 KB
testcase_43 AC 129 ms
29,660 KB
testcase_44 AC 129 ms
29,732 KB
testcase_45 AC 131 ms
29,732 KB
testcase_46 AC 132 ms
29,660 KB
testcase_47 AC 132 ms
29,692 KB
testcase_48 AC 129 ms
29,596 KB
testcase_49 AC 132 ms
29,664 KB
testcase_50 AC 128 ms
29,568 KB
testcase_51 AC 129 ms
29,612 KB
testcase_52 AC 132 ms
29,608 KB
testcase_53 AC 131 ms
29,608 KB
testcase_54 AC 127 ms
29,656 KB
testcase_55 AC 127 ms
29,512 KB
testcase_56 AC 132 ms
29,684 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np
import random

H,W = map(int,readline().split())
S = np.frombuffer(read(),'S1').reshape(H,-1)[:,:W].astype(str)

X,Y = np.where(S == '*')

def test(x,y):
    x0,x1 = X-x
    y0,y1 = Y-y
    return x0 * y1 != y0 * x1

while True:
    x = random.randint(0,H-1)
    y = random.randint(0,W-1)
    if test(x,y):
        break

S[x][y] = '*'

print('\n'.join(''.join(row) for row in S))
0