結果

問題 No.172 UFOを捕まえろ
ユーザー chiho_miyakochiho_miyako
提出日時 2015-04-05 23:27:23
言語 Java21
(openjdk 21)
結果
AC  
実行時間 138 ms / 5,000 ms
コード長 485 bytes
コンパイル時間 2,038 ms
コンパイル使用メモリ 73,852 KB
実行使用メモリ 41,896 KB
最終ジャッジ日時 2024-04-23 13:59:53
合計ジャッジ時間 6,036 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
41,152 KB
testcase_01 AC 131 ms
41,104 KB
testcase_02 AC 129 ms
41,288 KB
testcase_03 AC 131 ms
40,980 KB
testcase_04 AC 132 ms
41,500 KB
testcase_05 AC 138 ms
41,416 KB
testcase_06 AC 133 ms
41,028 KB
testcase_07 AC 134 ms
41,232 KB
testcase_08 AC 118 ms
40,076 KB
testcase_09 AC 131 ms
41,300 KB
testcase_10 AC 131 ms
41,408 KB
testcase_11 AC 132 ms
41,184 KB
testcase_12 AC 132 ms
41,684 KB
testcase_13 AC 131 ms
41,032 KB
testcase_14 AC 133 ms
41,512 KB
testcase_15 AC 128 ms
41,416 KB
testcase_16 AC 128 ms
41,360 KB
testcase_17 AC 132 ms
41,640 KB
testcase_18 AC 133 ms
41,252 KB
testcase_19 AC 118 ms
39,840 KB
testcase_20 AC 133 ms
41,896 KB
testcase_21 AC 129 ms
41,544 KB
testcase_22 AC 131 ms
41,352 KB
testcase_23 AC 134 ms
41,692 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner koko = new Scanner (System.in);
        int x = koko.nextInt();
        int y = koko.nextInt();
        int r = koko.nextInt();
        double kekkai = Math.abs(x)+Math.abs(y)+r*Math.sqrt(2);
        if(kekkai%1==0){
          System.out.println((int)kekkai);  
        }else{
            System.out.println((int)Math.ceil(kekkai));
        }
        
    }
}
0