結果

問題 No.172 UFOを捕まえろ
ユーザー キョウチクキョウチク
提出日時 2022-05-15 10:47:05
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 5,000 ms
コード長 402 bytes
コンパイル時間 3,160 ms
コンパイル使用メモリ 71,564 KB
実行使用メモリ 56,152 KB
最終ジャッジ日時 2023-10-01 05:38:07
合計ジャッジ時間 7,430 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
55,784 KB
testcase_01 AC 119 ms
55,956 KB
testcase_02 AC 118 ms
55,720 KB
testcase_03 AC 120 ms
55,792 KB
testcase_04 AC 119 ms
55,812 KB
testcase_05 AC 121 ms
56,152 KB
testcase_06 AC 119 ms
56,036 KB
testcase_07 AC 120 ms
56,016 KB
testcase_08 AC 119 ms
56,004 KB
testcase_09 AC 119 ms
55,916 KB
testcase_10 AC 120 ms
55,916 KB
testcase_11 AC 120 ms
55,544 KB
testcase_12 AC 121 ms
55,856 KB
testcase_13 AC 122 ms
56,120 KB
testcase_14 AC 122 ms
55,880 KB
testcase_15 AC 120 ms
55,712 KB
testcase_16 AC 119 ms
55,716 KB
testcase_17 AC 119 ms
55,800 KB
testcase_18 AC 119 ms
55,520 KB
testcase_19 AC 119 ms
56,088 KB
testcase_20 AC 119 ms
55,912 KB
testcase_21 AC 120 ms
55,844 KB
testcase_22 AC 119 ms
55,940 KB
testcase_23 AC 119 ms
55,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Test10 {
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    String[] line;
    line=sc.nextLine().split(" ");
    int x=Integer.parseInt(line[0]);
    int y=Integer.parseInt(line[1]);
    int r=Integer.parseInt(line[2]);
    int dist=Math.abs(x)+Math.abs(y)+(int)(r*Math.sqrt(2))+1;
    System.out.println(dist);
    sc.close();
  }
}
0