結果

問題 No.410 出会い
ユーザー mossari_aozora
提出日時 2019-10-03 17:01:49
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 29 ms / 2,000 ms
コード長 434 bytes
コンパイル時間 73 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-10-03 06:32:12
合計ジャッジ時間 1,336 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

import math


def solve():

    p = input().split(' ')
    px = int(p[0])
    py = int(p[1])

    q = input().split(' ')
    qx = int(q[0])
    qy = int(q[1])

    t = getDistance(px, py, qx, qy)

    dx = t[0] / 2
    dy = t[1] / 2

    if (t[0] % 2 != 0 and t[1] % 2 != 0):
        dx = math.ceil(dx)
        dy = math.floor(dy)

    print(dx + dy)

def getDistance(x1, y1, x2, y2):
    return (abs(x2 - x1), abs(y2 - y1))


solve()
0