結果

問題 No.172 UFOを捕まえろ
ユーザー tsunabittsunabit
提出日時 2019-05-15 00:28:09
言語 Java21
(openjdk 21)
結果
AC  
実行時間 118 ms / 5,000 ms
コード長 555 bytes
コンパイル時間 2,751 ms
コンパイル使用メモリ 73,032 KB
実行使用メモリ 39,616 KB
最終ジャッジ日時 2023-09-27 11:12:46
合計ジャッジ時間 6,896 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
39,284 KB
testcase_01 AC 113 ms
39,136 KB
testcase_02 AC 111 ms
39,228 KB
testcase_03 AC 113 ms
39,304 KB
testcase_04 AC 109 ms
39,384 KB
testcase_05 AC 116 ms
39,192 KB
testcase_06 AC 118 ms
39,576 KB
testcase_07 AC 114 ms
39,592 KB
testcase_08 AC 112 ms
39,200 KB
testcase_09 AC 114 ms
39,152 KB
testcase_10 AC 109 ms
39,532 KB
testcase_11 AC 111 ms
39,320 KB
testcase_12 AC 110 ms
39,124 KB
testcase_13 AC 114 ms
39,164 KB
testcase_14 AC 112 ms
39,236 KB
testcase_15 AC 114 ms
39,208 KB
testcase_16 AC 111 ms
39,124 KB
testcase_17 AC 115 ms
39,568 KB
testcase_18 AC 108 ms
39,616 KB
testcase_19 AC 111 ms
39,516 KB
testcase_20 AC 111 ms
39,240 KB
testcase_21 AC 115 ms
39,292 KB
testcase_22 AC 114 ms
39,392 KB
testcase_23 AC 108 ms
39,236 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.Scanner;

public class No172 {
    public static void main(String[] args) {
        // 標準入力から読み込む際に、Scannerオブジェクトを使う。
        Scanner s = new Scanner(System.in);
        int x = s.nextInt(), y = s.nextInt(), r = s.nextInt();
//        double k = Math.sqrt(x*x + y*y);
//        // 1:1:ルート2の二等辺三角形
//        double out = (k + r) * Math.sqrt(2);
        System.out.println((int)(Math.ceil(Math.abs(x) + Math.abs(y) + Math.sqrt(2) * r)));
    }
}
0