結果

問題 No.455 冬の大三角
ユーザー maspymaspy
提出日時 2020-01-07 21:44:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 532 ms / 2,000 ms
コード長 516 bytes
コンパイル時間 86 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 44,484 KB
最終ジャッジ日時 2024-05-02 11:46:06
合計ジャッジ時間 30,298 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 446 ms
44,004 KB
testcase_01 AC 463 ms
44,348 KB
testcase_02 AC 451 ms
43,968 KB
testcase_03 AC 472 ms
43,960 KB
testcase_04 AC 462 ms
44,408 KB
testcase_05 AC 464 ms
43,964 KB
testcase_06 AC 457 ms
43,972 KB
testcase_07 AC 460 ms
44,232 KB
testcase_08 AC 457 ms
44,228 KB
testcase_09 AC 457 ms
44,484 KB
testcase_10 AC 440 ms
44,356 KB
testcase_11 AC 441 ms
44,068 KB
testcase_12 AC 443 ms
44,356 KB
testcase_13 AC 448 ms
43,964 KB
testcase_14 AC 449 ms
44,140 KB
testcase_15 AC 461 ms
43,964 KB
testcase_16 AC 463 ms
43,972 KB
testcase_17 AC 449 ms
44,400 KB
testcase_18 AC 455 ms
43,976 KB
testcase_19 AC 450 ms
44,100 KB
testcase_20 AC 453 ms
44,356 KB
testcase_21 AC 443 ms
44,356 KB
testcase_22 AC 476 ms
44,232 KB
testcase_23 AC 456 ms
44,352 KB
testcase_24 AC 459 ms
44,484 KB
testcase_25 AC 459 ms
43,964 KB
testcase_26 AC 475 ms
44,100 KB
testcase_27 AC 462 ms
44,228 KB
testcase_28 AC 450 ms
44,356 KB
testcase_29 AC 457 ms
44,096 KB
testcase_30 AC 458 ms
44,116 KB
testcase_31 AC 448 ms
43,968 KB
testcase_32 AC 451 ms
44,352 KB
testcase_33 AC 462 ms
43,972 KB
testcase_34 AC 453 ms
44,232 KB
testcase_35 AC 444 ms
44,100 KB
testcase_36 AC 462 ms
44,360 KB
testcase_37 AC 453 ms
44,224 KB
testcase_38 AC 465 ms
44,348 KB
testcase_39 AC 532 ms
44,096 KB
testcase_40 AC 526 ms
43,980 KB
testcase_41 AC 453 ms
44,232 KB
testcase_42 AC 467 ms
44,228 KB
testcase_43 AC 461 ms
43,968 KB
testcase_44 AC 462 ms
44,356 KB
testcase_45 AC 458 ms
44,440 KB
testcase_46 AC 475 ms
43,964 KB
testcase_47 AC 456 ms
43,960 KB
testcase_48 AC 457 ms
44,356 KB
testcase_49 AC 469 ms
44,484 KB
testcase_50 AC 449 ms
44,484 KB
testcase_51 AC 453 ms
44,104 KB
testcase_52 AC 452 ms
43,968 KB
testcase_53 AC 466 ms
44,092 KB
testcase_54 AC 467 ms
44,228 KB
testcase_55 AC 442 ms
44,364 KB
testcase_56 AC 464 ms
44,108 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