結果

問題 No.410 出会い
ユーザー R NR N
提出日時 2020-11-21 11:21:56
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 759 bytes
コンパイル時間 69 ms
コンパイル使用メモリ 10,824 KB
実行使用メモリ 7,976 KB
最終ジャッジ日時 2023-09-30 21:42:09
合計ジャッジ時間 1,492 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 18 ms
7,728 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 15 ms
7,728 KB
testcase_13 WA -
testcase_14 AC 21 ms
7,816 KB
testcase_15 WA -
testcase_16 AC 15 ms
7,760 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding=utf-8:

a = list(map(int, input().split()))
b = list(map(int, input().split()))

x_a = a[0]
x_b = b[0]
y_a = a[1]
y_b = b[1]

x_ab = abs(x_a - x_b) / 2 
y_ab = abs(y_a - y_b) / 2

i = 0.0
j  = 0.0
k = 0.0
l = 0.0
while True:
    if x_a == x_b:
        break
    elif x_ab <= 2:
        i += 0.5
        j += 0.5
        x_ab -= 1
        break
    else:
        i += 1.0
        j += 1.0
        x_ab -= 2

if x_ab == 1:
    k += x_ab / 2
elif x_ab <= 0.5:
    k += 0.25

while True:
    if y_a == y_b:
        break
    if y_ab <= 2:
        i += 0.5
        j += 0.5
        y_ab -= 1
        break
    else:
        i += 1.0
        j += 1.0
        y_ab -= 2

if y_ab == 1:
    l += y_ab
elif x_ab <= 0.5:
    l += 0.25

print(i + j + k + l)
    
0