結果
| 問題 |
No.707 書道
|
| コンテスト | |
| ユーザー |
prd_xxx
|
| 提出日時 | 2018-06-29 22:48:59 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 671 bytes |
| コンパイル時間 | 144 ms |
| コンパイル使用メモリ | 82,264 KB |
| 実行使用メモリ | 76,636 KB |
| 最終ジャッジ日時 | 2024-07-01 00:05:44 |
| 合計ジャッジ時間 | 1,481 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 6 |
ソースコード
import math
H,W = map(int,input().split())
src = [[]]
src += ['0' + input() + '0' for i in range(H)]
ans = float('inf')
for px in (0,W+1):
for py in range(1,H+1):
print(px,py)
tmp = 0
for y in range(1,H+1):
for x in range(1,W+1):
if src[y][x] == '0': continue
tmp += math.hypot(px-x, py-y)
ans = min(ans, tmp)
for py in (0,H+1):
for px in range(1,W+1):
print(px,py)
tmp = 0
for y in range(1,H+1):
for x in range(1,W+1):
if src[y][x] == '0': continue
tmp += math.hypot(px-x, py-y)
ans = min(ans, tmp)
print(ans)
prd_xxx