結果

問題 No.172 UFOを捕まえろ
ユーザー fkwnw3_1243fkwnw3_1243
提出日時 2017-04-30 09:41:08
言語 Java21
(openjdk 21)
結果
AC  
実行時間 44 ms / 5,000 ms
コード長 612 bytes
コンパイル時間 3,658 ms
コンパイル使用メモリ 71,476 KB
実行使用メモリ 49,708 KB
最終ジャッジ日時 2023-10-11 23:31:26
合計ジャッジ時間 6,647 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,152 KB
testcase_01 AC 43 ms
49,084 KB
testcase_02 AC 43 ms
49,280 KB
testcase_03 AC 43 ms
49,264 KB
testcase_04 AC 43 ms
49,140 KB
testcase_05 AC 43 ms
49,420 KB
testcase_06 AC 43 ms
49,068 KB
testcase_07 AC 43 ms
49,200 KB
testcase_08 AC 42 ms
49,188 KB
testcase_09 AC 43 ms
49,152 KB
testcase_10 AC 43 ms
49,188 KB
testcase_11 AC 44 ms
49,708 KB
testcase_12 AC 42 ms
49,276 KB
testcase_13 AC 43 ms
49,224 KB
testcase_14 AC 42 ms
49,500 KB
testcase_15 AC 43 ms
49,040 KB
testcase_16 AC 44 ms
49,180 KB
testcase_17 AC 44 ms
49,508 KB
testcase_18 AC 43 ms
49,376 KB
testcase_19 AC 44 ms
49,284 KB
testcase_20 AC 44 ms
49,268 KB
testcase_21 AC 43 ms
49,100 KB
testcase_22 AC 44 ms
49,180 KB
testcase_23 AC 44 ms
49,100 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

import static java.lang.System.in;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        String[] inputs = reader.readLine().split(" ");
        int x = Integer.parseInt(inputs[0]);
        int y = Integer.parseInt(inputs[1]);
        int r = Integer.parseInt(inputs[2]);
        x = Math.abs(x);
        y = Math.abs(y);
        System.out.println((int)Math.ceil(x + y + r * Math.sqrt(2)));
    }

}
0