結果

問題 No.172 UFOを捕まえろ
ユーザー matsuyoshi30matsuyoshi30
提出日時 2016-02-14 23:08:54
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 5,000 ms
コード長 382 bytes
コンパイル時間 2,136 ms
コンパイル使用メモリ 74,096 KB
実行使用メモリ 41,548 KB
最終ジャッジ日時 2024-04-23 14:25:19
合計ジャッジ時間 5,628 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
41,548 KB
testcase_01 AC 115 ms
41,272 KB
testcase_02 AC 116 ms
41,424 KB
testcase_03 AC 111 ms
40,480 KB
testcase_04 AC 111 ms
41,384 KB
testcase_05 AC 113 ms
41,448 KB
testcase_06 AC 101 ms
40,032 KB
testcase_07 AC 113 ms
41,164 KB
testcase_08 AC 106 ms
40,000 KB
testcase_09 AC 102 ms
40,320 KB
testcase_10 AC 111 ms
40,524 KB
testcase_11 AC 101 ms
39,848 KB
testcase_12 AC 105 ms
39,948 KB
testcase_13 AC 116 ms
41,120 KB
testcase_14 AC 107 ms
40,416 KB
testcase_15 AC 109 ms
41,164 KB
testcase_16 AC 117 ms
40,680 KB
testcase_17 AC 116 ms
40,976 KB
testcase_18 AC 117 ms
41,344 KB
testcase_19 AC 115 ms
41,444 KB
testcase_20 AC 100 ms
40,432 KB
testcase_21 AC 114 ms
41,216 KB
testcase_22 AC 116 ms
41,052 KB
testcase_23 AC 119 ms
41,012 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Main {
    public static void main(String[] args) throws Exception {
        Scanner in = new Scanner(System.in);
        int x = in.nextInt();
        int y = in.nextInt();
        int r = in.nextInt();
        double temp = 2 * r / Math.sqrt(2);
        int ans = Math.abs(x) + Math.abs(y) + (int)temp + 1;
        System.out.println(ans);
    }
}
0