結果

問題 No.172 UFOを捕まえろ
ユーザー mobius_bkstmobius_bkst
提出日時 2015-04-20 18:23:48
言語 Java19
(openjdk 21)
結果
AC  
実行時間 47 ms / 5,000 ms
コード長 805 bytes
コンパイル時間 3,422 ms
コンパイル使用メモリ 83,216 KB
実行使用メモリ 49,788 KB
最終ジャッジ日時 2023-08-05 17:02:26
合計ジャッジ時間 5,532 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
49,228 KB
testcase_01 AC 44 ms
49,204 KB
testcase_02 AC 43 ms
49,572 KB
testcase_03 AC 44 ms
49,304 KB
testcase_04 AC 44 ms
49,228 KB
testcase_05 AC 44 ms
49,164 KB
testcase_06 AC 43 ms
49,488 KB
testcase_07 AC 44 ms
49,208 KB
testcase_08 AC 44 ms
49,264 KB
testcase_09 AC 45 ms
49,468 KB
testcase_10 AC 44 ms
49,380 KB
testcase_11 AC 44 ms
49,160 KB
testcase_12 AC 43 ms
49,276 KB
testcase_13 AC 45 ms
49,260 KB
testcase_14 AC 44 ms
49,212 KB
testcase_15 AC 44 ms
49,344 KB
testcase_16 AC 44 ms
49,268 KB
testcase_17 AC 47 ms
49,168 KB
testcase_18 AC 44 ms
49,256 KB
testcase_19 AC 43 ms
49,272 KB
testcase_20 AC 43 ms
47,704 KB
testcase_21 AC 45 ms
49,380 KB
testcase_22 AC 44 ms
49,788 KB
testcase_23 AC 45 ms
49,296 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