結果

問題 No.172 UFOを捕まえろ
ユーザー takeya_okinotakeya_okino
提出日時 2017-06-23 15:44:36
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 428 bytes
コンパイル時間 2,411 ms
コンパイル使用メモリ 74,332 KB
実行使用メモリ 56,288 KB
最終ジャッジ日時 2024-04-14 06:57:03
合計ジャッジ時間 6,687 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
54,220 KB
testcase_01 AC 131 ms
54,340 KB
testcase_02 AC 130 ms
53,896 KB
testcase_03 AC 132 ms
54,004 KB
testcase_04 AC 132 ms
54,000 KB
testcase_05 WA -
testcase_06 AC 134 ms
54,424 KB
testcase_07 AC 134 ms
54,344 KB
testcase_08 WA -
testcase_09 AC 132 ms
54,236 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 135 ms
54,464 KB
testcase_16 WA -
testcase_17 AC 137 ms
54,352 KB
testcase_18 AC 135 ms
54,192 KB
testcase_19 WA -
testcase_20 AC 137 ms
54,340 KB
testcase_21 WA -
testcase_22 AC 135 ms
54,196 KB
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

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();
    int r = sc.nextInt();
    int a = 0;
    for(int i = 1; i <= 200; i++) {
      if(i * i > 2 * r * r) {
        a = i;
        break;
      }
    }
    int ans = Math.max(Math.abs(x + y + a), Math.abs(x + y - a));
    System.out.println(ans);
  }
}
0