結果
問題 |
No.455 冬の大三角
|
ユーザー |
![]() |
提出日時 | 2023-08-08 01:22:48 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 37 ms / 2,000 ms |
コード長 | 558 bytes |
コンパイル時間 | 638 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 11,264 KB |
最終ジャッジ日時 | 2024-11-08 07:01:17 |
合計ジャッジ時間 | 4,821 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 54 |
ソースコード
from random import randint H,W=map(int,input().split()) MAP=[list(input().strip()) for i in range(H)] A=[] for i in range(H): for j in range(W): if MAP[i][j]=="*": A.append((i,j)) while True: x=randint(0,H-1) y=randint(0,W-1) if MAP[x][y]=="*": continue if (A[0][1]-A[1][1])*(A[0][0]-x)==(A[0][0]-A[1][0])*(A[0][1]-y): continue if x==A[0][0]==A[1][0]: continue if y==A[0][1]==A[1][1]: continue MAP[x][y]="*" break for i in range(H): print("".join(MAP[i]))