結果

問題 No.410 出会い
ユーザー YukimotoPGYukimotoPG
提出日時 2019-02-13 18:00:05
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 517 bytes
コンパイル時間 1,976 ms
コンパイル使用メモリ 71,600 KB
実行使用メモリ 56,328 KB
最終ジャッジ日時 2023-10-11 12:21:18
合計ジャッジ時間 6,730 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
56,328 KB
testcase_01 AC 121 ms
56,324 KB
testcase_02 AC 121 ms
55,796 KB
testcase_03 AC 122 ms
56,004 KB
testcase_04 AC 124 ms
56,204 KB
testcase_05 AC 123 ms
55,868 KB
testcase_06 AC 126 ms
56,152 KB
testcase_07 AC 124 ms
55,816 KB
testcase_08 AC 126 ms
56,144 KB
testcase_09 AC 124 ms
56,060 KB
testcase_10 AC 123 ms
55,880 KB
testcase_11 AC 123 ms
56,164 KB
testcase_12 AC 123 ms
56,184 KB
testcase_13 AC 125 ms
55,568 KB
testcase_14 AC 123 ms
55,888 KB
testcase_15 AC 124 ms
56,016 KB
testcase_16 AC 124 ms
56,212 KB
testcase_17 AC 124 ms
56,108 KB
testcase_18 AC 123 ms
56,100 KB
testcase_19 AC 126 ms
56,132 KB
testcase_20 AC 122 ms
56,188 KB
testcase_21 AC 122 ms
53,832 KB
testcase_22 AC 125 ms
55,728 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		
		System.out.println((double)calcManhatDistance(sc.nextInt(),sc.nextInt(),sc.nextInt(),sc.nextInt())/2);
		
	}
	
	static int calcManhatDistance (int x1, int y1, int x2, int y2) {
		int d = Math.abs(x1-x2)+Math.abs(y1-y2);
		return d;
	}
	static double calcEuclidDistance (double x1, double y1, double x2, double y2) {
		double d = Math.sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
		return d;
	}
	
}
0