結果

問題 No.172 UFOを捕まえろ
ユーザー samplelpmassamplelpmas
提出日時 2017-01-23 16:07:20
言語 Java19
(openjdk 21)
結果
AC  
実行時間 122 ms / 5,000 ms
コード長 376 bytes
コンパイル時間 2,249 ms
コンパイル使用メモリ 71,304 KB
実行使用メモリ 56,420 KB
最終ジャッジ日時 2023-08-24 21:26:36
合計ジャッジ時間 6,205 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,916 KB
testcase_01 AC 121 ms
55,776 KB
testcase_02 AC 119 ms
55,812 KB
testcase_03 AC 121 ms
55,716 KB
testcase_04 AC 121 ms
56,100 KB
testcase_05 AC 120 ms
55,544 KB
testcase_06 AC 119 ms
55,496 KB
testcase_07 AC 119 ms
55,780 KB
testcase_08 AC 119 ms
56,296 KB
testcase_09 AC 119 ms
55,756 KB
testcase_10 AC 120 ms
55,636 KB
testcase_11 AC 122 ms
56,232 KB
testcase_12 AC 121 ms
55,932 KB
testcase_13 AC 122 ms
56,420 KB
testcase_14 AC 121 ms
56,392 KB
testcase_15 AC 120 ms
55,596 KB
testcase_16 AC 117 ms
55,468 KB
testcase_17 AC 122 ms
55,800 KB
testcase_18 AC 122 ms
55,708 KB
testcase_19 AC 121 ms
56,264 KB
testcase_20 AC 121 ms
56,348 KB
testcase_21 AC 120 ms
55,936 KB
testcase_22 AC 121 ms
56,144 KB
testcase_23 AC 120 ms
55,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int x = Math.abs(sc.nextInt());
        int y = Math.abs(sc.nextInt());
        int radius = sc.nextInt();

        int barrier = (int) Math.ceil(x + y + (Math.sqrt(2) * radius));

        System.out.println(barrier);

    }

}
0