結果

問題 No.3063 幅優先探索
ユーザー maspymaspy
提出日時 2020-04-01 21:42:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 19 ms / 2,000 ms
コード長 345 bytes
コンパイル時間 1,115 ms
コンパイル使用メモリ 10,504 KB
実行使用メモリ 8,612 KB
最終ジャッジ日時 2023-09-09 17:25:51
合計ジャッジ時間 1,281 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,484 KB
testcase_01 AC 18 ms
8,612 KB
testcase_02 AC 17 ms
8,428 KB
testcase_03 AC 18 ms
8,404 KB
testcase_04 AC 17 ms
8,476 KB
testcase_05 AC 17 ms
8,544 KB
testcase_06 AC 18 ms
8,488 KB
testcase_07 AC 18 ms
8,428 KB
testcase_08 AC 17 ms
8,516 KB
testcase_09 AC 17 ms
8,480 KB
testcase_10 AC 19 ms
8,472 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/ python3.8
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from collections import deque

H, W = map(int, readline().split())
sx, sy = map(int, readline().split())
gx, gy = map(int, readline().split())
sx = H + 1 - sx
gx = H + 1 - gx

print(abs(sx-gx) + abs(sy-gy))
0