結果

問題 No.455 冬の大三角
ユーザー maspy
提出日時 2020-01-07 21:43:21
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 516 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 44,684 KB
最終ジャッジ日時 2024-11-23 01:12:39
合計ジャッジ時間 34,144 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 RE * 1
other AC * 42 RE * 12
権限があれば一括ダウンロードができます

ソースコード

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,H-1)
    if test(x,y):
        break

S[x][y] = '*'

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