結果
| 問題 |
No.707 書道
|
| コンテスト | |
| ユーザー |
sekihankamibanz
|
| 提出日時 | 2018-10-28 23:23:24 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 674 bytes |
| コンパイル時間 | 124 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 44,608 KB |
| 最終ジャッジ日時 | 2024-11-19 07:25:38 |
| 合計ジャッジ時間 | 6,558 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 5 RE * 1 |
ソースコード
import numpy as np
height, width = [int(x) for x in input().split(' ')]
paint_place = []
length_lists = []
for y in range(1, height + 1):
x_lists = [int(x) for x in input()]
for x, i in enumerate(x_lists):
if i == 1:
paint_place.append([x + 1,y])
paint_place = np.array(paint_place)
for x in range(width + 2):
for y in range(height + 2):
if (((x == 0) or (x == width + 1)) and (1 <= y <= height)) or (((y == 0) or (y == height + 1)) and (1 <= x <= width)) :
point = np. array([x, y])
length_lists.append(np.sum(np.sqrt(np.sum(((paint_place - point) ** 2), axis=1))))
print(min(length_lists))
sekihankamibanz