結果
問題 | No.172 UFOを捕まえろ |
ユーザー |
![]() |
提出日時 | 2018-05-17 23:44:18 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 135 ms / 5,000 ms |
コード長 | 362 bytes |
コンパイル時間 | 1,945 ms |
コンパイル使用メモリ | 74,196 KB |
実行使用メモリ | 54,320 KB |
最終ジャッジ日時 | 2024-06-28 13:37:37 |
合計ジャッジ時間 | 5,843 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int x = scan.nextInt(); int y = scan.nextInt(); int r = scan.nextInt(); scan.close(); if(x < 0) { x = - x; } if(y < 0) { y = - y; } int k = x + y + (int)(Math.sqrt(2) * r) + 1; System.out.println(k); } }