結果

問題 No.172 UFOを捕まえろ
ユーザー samplelpmassamplelpmas
提出日時 2017-01-23 15:50:09
言語 Java19
(openjdk 21)
結果
AC  
実行時間 122 ms / 5,000 ms
コード長 376 bytes
コンパイル時間 3,278 ms
コンパイル使用メモリ 72,468 KB
実行使用メモリ 56,560 KB
最終ジャッジ日時 2023-08-24 21:25:59
合計ジャッジ時間 6,585 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
56,280 KB
testcase_01 AC 121 ms
55,784 KB
testcase_02 AC 119 ms
55,792 KB
testcase_03 AC 120 ms
56,240 KB
testcase_04 AC 120 ms
56,272 KB
testcase_05 AC 120 ms
55,788 KB
testcase_06 AC 121 ms
56,208 KB
testcase_07 AC 120 ms
55,516 KB
testcase_08 AC 122 ms
55,944 KB
testcase_09 AC 120 ms
56,316 KB
testcase_10 AC 121 ms
56,204 KB
testcase_11 AC 121 ms
56,560 KB
testcase_12 AC 120 ms
55,752 KB
testcase_13 AC 120 ms
55,708 KB
testcase_14 AC 122 ms
56,360 KB
testcase_15 AC 119 ms
55,508 KB
testcase_16 AC 120 ms
55,780 KB
testcase_17 AC 122 ms
55,904 KB
testcase_18 AC 121 ms
55,808 KB
testcase_19 AC 120 ms
54,012 KB
testcase_20 AC 120 ms
56,340 KB
testcase_21 AC 120 ms
56,228 KB
testcase_22 AC 121 ms
56,188 KB
testcase_23 AC 120 ms
56,072 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