結果

問題 No.410 出会い
ユーザー TwinkleStar74
提出日時 2017-10-16 15:56:54
言語 Java
(openjdk 23)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 949 bytes
コンパイル時間 2,059 ms
コンパイル使用メモリ 77,856 KB
実行使用メモリ 41,788 KB
最終ジャッジ日時 2024-06-28 11:26:23
合計ジャッジ時間 5,764 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

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