結果

問題 No.172 UFOを捕まえろ
ユーザー t8m8⛄️t8m8⛄️
提出日時 2015-03-30 17:59:29
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 5,000 ms
コード長 784 bytes
コンパイル時間 3,342 ms
コンパイル使用メモリ 75,444 KB
実行使用メモリ 52,552 KB
最終ジャッジ日時 2024-04-23 13:59:18
合計ジャッジ時間 6,465 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
52,552 KB
testcase_01 AC 105 ms
41,840 KB
testcase_02 AC 115 ms
41,692 KB
testcase_03 AC 104 ms
40,036 KB
testcase_04 AC 114 ms
41,384 KB
testcase_05 AC 118 ms
41,416 KB
testcase_06 AC 116 ms
41,356 KB
testcase_07 AC 104 ms
41,320 KB
testcase_08 AC 117 ms
41,160 KB
testcase_09 AC 114 ms
41,284 KB
testcase_10 AC 103 ms
41,156 KB
testcase_11 AC 118 ms
41,576 KB
testcase_12 AC 113 ms
41,316 KB
testcase_13 AC 115 ms
41,436 KB
testcase_14 AC 116 ms
40,080 KB
testcase_15 AC 116 ms
41,696 KB
testcase_16 AC 115 ms
41,852 KB
testcase_17 AC 113 ms
41,676 KB
testcase_18 AC 116 ms
40,296 KB
testcase_19 AC 126 ms
41,592 KB
testcase_20 AC 108 ms
41,412 KB
testcase_21 AC 119 ms
41,160 KB
testcase_22 AC 118 ms
41,592 KB
testcase_23 AC 118 ms
41,444 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

//No.172 UFOを捕まえろ

import java.util.*;
import java.io.*;
import static java.util.Arrays.*;
import static java.lang.Math.*;

public class No172 {
    
    static final Scanner sc = new Scanner(System.in);
    static final PrintWriter out = new PrintWriter(System.out,false);

    static void solve() {
        int x = abs(sc.nextInt());
        int y = abs(sc.nextInt());
        int r = sc.nextInt();
        out.println((int)ceil(x+y+r*sqrt(2)));
    }

    public static void main(String[] args) {
        long start = System.currentTimeMillis();

        solve();
        out.flush();

        long end = System.currentTimeMillis();
        //trace(end-start + "ms");
        sc.close();
    }

    static void trace(Object... o) { System.out.println(deepToString(o));}
}
0