結果

問題 No.410 出会い
ユーザー TwinkleStar74TwinkleStar74
提出日時 2017-10-16 15:56:54
言語 Java21
(openjdk 21)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 949 bytes
コンパイル時間 2,140 ms
コンパイル使用メモリ 73,892 KB
実行使用メモリ 55,884 KB
最終ジャッジ日時 2023-09-10 20:20:39
合計ジャッジ時間 5,801 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
55,560 KB
testcase_01 AC 115 ms
55,476 KB
testcase_02 AC 115 ms
55,460 KB
testcase_03 AC 116 ms
55,356 KB
testcase_04 AC 117 ms
55,612 KB
testcase_05 AC 116 ms
55,264 KB
testcase_06 AC 116 ms
55,336 KB
testcase_07 AC 118 ms
55,324 KB
testcase_08 AC 115 ms
55,380 KB
testcase_09 AC 114 ms
55,396 KB
testcase_10 AC 113 ms
55,724 KB
testcase_11 AC 113 ms
53,364 KB
testcase_12 AC 114 ms
55,672 KB
testcase_13 AC 114 ms
55,216 KB
testcase_14 AC 114 ms
55,292 KB
testcase_15 AC 114 ms
55,336 KB
testcase_16 AC 115 ms
55,884 KB
testcase_17 AC 114 ms
55,552 KB
testcase_18 AC 114 ms
55,376 KB
testcase_19 AC 114 ms
55,372 KB
testcase_20 AC 112 ms
55,316 KB
testcase_21 AC 115 ms
55,628 KB
testcase_22 AC 115 ms
55,320 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.text.*;

class No410{
    public static void main(String[] args) {
        try{
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            String[] str1 = br.readLine().split(" ");
            String[] str2 = br.readLine().split(" ");
            int[] A = new int[2];
            int[] B = new int[2];
            for(int i=0; i < 2; i++){
                A[i] = Integer.parseInt(str1[i]);
                B[i] = Integer.parseInt(str2[i]);
            }
            Calc(A,B); 
        }catch(IOException e){
            e.getStackTrace();
        }catch(NumberFormatException e){
            e.getStackTrace();
        }
    }
    
    public static void Calc(int[] a, int[] b){
        double ans = 0;
        ans = (double)(Math.abs(a[0]-b[0]) + Math.abs(a[1]-b[1])) / 2;
        DecimalFormat DF = new DecimalFormat("0.#");
        System.out.println(DF.format(ans));
    }
}
0