結果

問題 No.410 出会い
ユーザー matsuyoshi30matsuyoshi30
提出日時 2018-05-04 18:17:08
言語 Java21
(openjdk 21)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 696 bytes
コンパイル時間 3,666 ms
コンパイル使用メモリ 72,500 KB
実行使用メモリ 56,204 KB
最終ジャッジ日時 2023-09-10 20:36:16
合計ジャッジ時間 6,166 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
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 AC 127 ms
56,096 KB
testcase_12 AC 125 ms
55,540 KB
testcase_13 AC 126 ms
55,912 KB
testcase_14 AC 128 ms
55,920 KB
testcase_15 AC 126 ms
55,648 KB
testcase_16 AC 124 ms
55,888 KB
testcase_17 AC 126 ms
55,712 KB
testcase_18 AC 128 ms
55,516 KB
testcase_19 AC 126 ms
55,640 KB
testcase_20 AC 126 ms
55,904 KB
testcase_21 AC 127 ms
55,756 KB
testcase_22 AC 125 ms
55,856 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int px = in.nextInt();
        int py = in.nextInt();
        int qx = in.nextInt();
        int qy = in.nextInt();

        double dx = 0.0;
        double dy = 0.0;

        if(px * qx < 0)
            if(px < 0)
                dx = qx - px;
            else
                dx = px - qx;
        else
            dx = Math.abs(px - qx);

        if(py * qy < 0)
            if(py < 0)
                dy = qy - py;
            else
                dy = py - qy;
        else
            dy = Math.abs(py - qy);

        System.out.println(dx/2 + dy/2);
    }
}
0