結果

問題 No.172 UFOを捕まえろ
ユーザー AOSM_saltoneAOSM_saltone
提出日時 2017-05-21 12:02:50
言語 Java21
(openjdk 21)
結果
AC  
実行時間 139 ms / 5,000 ms
コード長 352 bytes
コンパイル時間 2,302 ms
コンパイル使用メモリ 74,052 KB
実行使用メモリ 57,672 KB
最終ジャッジ日時 2023-10-19 12:01:22
合計ジャッジ時間 6,907 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
57,516 KB
testcase_01 AC 137 ms
57,416 KB
testcase_02 AC 133 ms
55,352 KB
testcase_03 AC 132 ms
57,268 KB
testcase_04 AC 130 ms
57,612 KB
testcase_05 AC 130 ms
57,252 KB
testcase_06 AC 131 ms
57,236 KB
testcase_07 AC 131 ms
57,420 KB
testcase_08 AC 134 ms
57,616 KB
testcase_09 AC 135 ms
57,424 KB
testcase_10 AC 132 ms
57,536 KB
testcase_11 AC 139 ms
57,404 KB
testcase_12 AC 131 ms
57,548 KB
testcase_13 AC 132 ms
57,440 KB
testcase_14 AC 132 ms
57,304 KB
testcase_15 AC 137 ms
57,276 KB
testcase_16 AC 133 ms
57,408 KB
testcase_17 AC 133 ms
57,672 KB
testcase_18 AC 132 ms
57,416 KB
testcase_19 AC 130 ms
57,376 KB
testcase_20 AC 130 ms
57,284 KB
testcase_21 AC 129 ms
57,100 KB
testcase_22 AC 131 ms
57,328 KB
testcase_23 AC 132 ms
55,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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