結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
7,924 KB
testcase_01 AC 19 ms
7,884 KB
testcase_02 WA -
testcase_03 AC 23 ms
7,884 KB
testcase_04 AC 20 ms
7,784 KB
testcase_05 AC 23 ms
7,848 KB
testcase_06 AC 21 ms
7,888 KB
testcase_07 WA -
testcase_08 AC 17 ms
7,780 KB
testcase_09 WA -
testcase_10 AC 19 ms
7,880 KB
testcase_11 AC 16 ms
7,960 KB
testcase_12 AC 15 ms
7,784 KB
testcase_13 WA -
testcase_14 AC 21 ms
7,844 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 15 ms
7,924 KB
testcase_18 AC 16 ms
7,836 KB
testcase_19 AC 45 ms
7,784 KB
testcase_20 AC 31 ms
7,956 KB
testcase_21 AC 31 ms
7,780 KB
testcase_22 AC 45 ms
7,880 KB
権限があれば一括ダウンロードができます

ソースコード

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

k = 0
if x_ab > 0:
    k = x_ab

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 > 0:
    l = y_ab

print(i + j + k + l)
0