結果

問題 No.410 出会い
ユーザー 37zigen37zigen
提出日時 2016-08-12 22:31:20
言語 Java21
(openjdk 21)
結果
AC  
実行時間 154 ms / 2,000 ms
コード長 694 bytes
コンパイル時間 3,950 ms
コンパイル使用メモリ 71,440 KB
実行使用メモリ 56,040 KB
最終ジャッジ日時 2023-09-10 19:51:44
合計ジャッジ時間 8,489 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 142 ms
55,376 KB
testcase_01 AC 146 ms
55,884 KB
testcase_02 AC 143 ms
55,668 KB
testcase_03 AC 145 ms
55,440 KB
testcase_04 AC 142 ms
55,756 KB
testcase_05 AC 143 ms
55,872 KB
testcase_06 AC 143 ms
55,740 KB
testcase_07 AC 148 ms
55,980 KB
testcase_08 AC 145 ms
55,936 KB
testcase_09 AC 145 ms
55,672 KB
testcase_10 AC 144 ms
55,676 KB
testcase_11 AC 145 ms
55,652 KB
testcase_12 AC 142 ms
55,692 KB
testcase_13 AC 143 ms
55,880 KB
testcase_14 AC 145 ms
56,020 KB
testcase_15 AC 146 ms
55,532 KB
testcase_16 AC 141 ms
55,476 KB
testcase_17 AC 154 ms
56,040 KB
testcase_18 AC 147 ms
55,828 KB
testcase_19 AC 145 ms
55,436 KB
testcase_20 AC 146 ms
55,672 KB
testcase_21 AC 142 ms
55,580 KB
testcase_22 AC 144 ms
55,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package No400番台;
import java.util.Scanner;
public class Q410 {
	public static void main(String[] args) {
		new Q410().solver();
	}

	void solver() {
		Scanner sc = new Scanner(System.in);
		double px, py, qx, qy;
		px = sc.nextDouble();
		py = sc.nextDouble();
		qx = sc.nextDouble();
		qy = sc.nextDouble();
		long t = 0;
		System.out.println(Math.abs((px - qx) / 2.0) + Math.abs((py - qy) / 2.0));
//		t = Math.abs((px - qx) / 2) + Math.abs((py - qy) / 2);
//		if ((px - qx) % 2 == 1 && (py - qy) % 2 == 1) {
//			System.out.println((t + 1));
//		} else if ((px - qx) % 2 == 0 && (py - qy) % 2 == 0) {
//			System.out.println(t);
//		} else {
//			System.out.println((t + 1));
//		}
	}
}
0