結果

問題 No.172 UFOを捕まえろ
ユーザー reon777reon777
提出日時 2017-06-25 07:33:58
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 5,000 ms
コード長 564 bytes
コンパイル時間 2,153 ms
コンパイル使用メモリ 74,280 KB
実行使用メモリ 54,392 KB
最終ジャッジ日時 2024-04-15 01:14:51
合計ジャッジ時間 5,992 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
54,044 KB
testcase_01 AC 119 ms
54,176 KB
testcase_02 AC 106 ms
53,084 KB
testcase_03 AC 117 ms
53,952 KB
testcase_04 AC 119 ms
54,016 KB
testcase_05 AC 118 ms
54,120 KB
testcase_06 AC 118 ms
54,064 KB
testcase_07 AC 120 ms
54,000 KB
testcase_08 AC 120 ms
54,160 KB
testcase_09 AC 121 ms
53,996 KB
testcase_10 AC 119 ms
54,104 KB
testcase_11 AC 118 ms
54,020 KB
testcase_12 AC 122 ms
53,888 KB
testcase_13 AC 118 ms
54,204 KB
testcase_14 AC 107 ms
52,904 KB
testcase_15 AC 120 ms
54,308 KB
testcase_16 AC 122 ms
53,872 KB
testcase_17 AC 119 ms
54,252 KB
testcase_18 AC 108 ms
52,948 KB
testcase_19 AC 122 ms
54,300 KB
testcase_20 AC 126 ms
54,088 KB
testcase_21 AC 117 ms
54,040 KB
testcase_22 AC 121 ms
54,392 KB
testcase_23 AC 119 ms
54,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.util.Scanner;
import java.io.FileNotFoundException;
import java.io.File;

class CatchTheUFO{
  public static void main(String args[]){
      Scanner scan = new Scanner(System.in);


      int x = Integer.parseInt(scan.next());
      int y = Integer.parseInt(scan.next());
      int r = Integer.parseInt(scan.next());

      x = Math.abs(x);
      y = Math.abs(y);

      double ans_d = Math.sqrt(2) * r;
      ans_d = Math.ceil(ans_d);
      int ans = (int) ans_d;

      ans = ans + x + y;

      System.out.println(ans);

    }
}
0