結果

問題 No.172 UFOを捕まえろ
ユーザー GrenacheGrenache
提出日時 2015-11-02 00:25:17
言語 Java21
(openjdk 21)
結果
AC  
実行時間 133 ms / 5,000 ms
コード長 464 bytes
コンパイル時間 3,570 ms
コンパイル使用メモリ 74,328 KB
実行使用メモリ 41,752 KB
最終ジャッジ日時 2024-04-23 14:22:56
合計ジャッジ時間 7,232 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
41,084 KB
testcase_01 AC 130 ms
41,752 KB
testcase_02 AC 128 ms
41,452 KB
testcase_03 AC 130 ms
41,336 KB
testcase_04 AC 131 ms
41,092 KB
testcase_05 AC 131 ms
41,584 KB
testcase_06 AC 129 ms
41,272 KB
testcase_07 AC 118 ms
39,940 KB
testcase_08 AC 130 ms
41,508 KB
testcase_09 AC 127 ms
41,228 KB
testcase_10 AC 118 ms
40,024 KB
testcase_11 AC 130 ms
41,544 KB
testcase_12 AC 129 ms
41,392 KB
testcase_13 AC 129 ms
41,640 KB
testcase_14 AC 125 ms
41,172 KB
testcase_15 AC 133 ms
41,092 KB
testcase_16 AC 129 ms
41,288 KB
testcase_17 AC 133 ms
41,364 KB
testcase_18 AC 129 ms
41,332 KB
testcase_19 AC 128 ms
41,120 KB
testcase_20 AC 130 ms
41,232 KB
testcase_21 AC 128 ms
41,528 KB
testcase_22 AC 131 ms
41,424 KB
testcase_23 AC 132 ms
41,172 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main_yukicoder172 {

    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 r = sc.nextInt();
        int min = Math.min(x, y);
        int tmp = (int)Math.ceil((Math.sqrt(2.0) * min + r) * Math.sqrt(2.0));
        System.out.println(Math.abs(x - y) + tmp);
        
        sc.close();
    }
}
0