結果

問題 No.172 UFOを捕まえろ
ユーザー mobius_bkstmobius_bkst
提出日時 2015-04-20 18:23:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 55 ms / 5,000 ms
コード長 805 bytes
コンパイル時間 3,288 ms
コンパイル使用メモリ 81,816 KB
実行使用メモリ 50,500 KB
最終ジャッジ日時 2024-04-23 14:01:24
合計ジャッジ時間 5,576 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
50,480 KB
testcase_01 AC 54 ms
50,176 KB
testcase_02 AC 55 ms
50,212 KB
testcase_03 AC 54 ms
50,500 KB
testcase_04 AC 54 ms
50,228 KB
testcase_05 AC 54 ms
50,168 KB
testcase_06 AC 52 ms
50,120 KB
testcase_07 AC 54 ms
50,208 KB
testcase_08 AC 55 ms
50,380 KB
testcase_09 AC 53 ms
50,260 KB
testcase_10 AC 55 ms
50,044 KB
testcase_11 AC 54 ms
50,324 KB
testcase_12 AC 55 ms
49,924 KB
testcase_13 AC 55 ms
50,320 KB
testcase_14 AC 55 ms
49,872 KB
testcase_15 AC 55 ms
50,272 KB
testcase_16 AC 54 ms
50,076 KB
testcase_17 AC 54 ms
49,956 KB
testcase_18 AC 53 ms
50,136 KB
testcase_19 AC 54 ms
50,424 KB
testcase_20 AC 53 ms
50,484 KB
testcase_21 AC 54 ms
50,212 KB
testcase_22 AC 54 ms
50,168 KB
testcase_23 AC 53 ms
50,160 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;


public class No172 {

    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO 自動生成されたメソッド・スタブ
                try {
            BufferedReader br = new BufferedReader(new InputStreamReader(
                    System.in));
            String[] tmpArray = br.readLine().split(" ");
            int x = Integer.parseInt(tmpArray[0]);
            int y = Integer.parseInt(tmpArray[1]);
            int r = Integer.parseInt(tmpArray[2]);

            int ans = (int) Math.ceil(Math.abs(x) + Math.abs(y) + Math.sqrt(2) * r);

            System.out.println(ans);
        } catch (Exception e) {
            System.err.println("Error:" + e.getMessage());
        }
    }

}
0