結果
| 問題 |
No.172 UFOを捕まえろ
|
| コンテスト | |
| ユーザー |
spacia
|
| 提出日時 | 2016-01-03 13:09:13 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 592 bytes |
| コンパイル時間 | 2,965 ms |
| コンパイル使用メモリ | 74,628 KB |
| 実行使用メモリ | 52,324 KB |
| 最終ジャッジ日時 | 2024-09-19 10:45:50 |
| 合計ジャッジ時間 | 4,179 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 WA * 15 |
ソースコード
import java.io.*;
import java.util.*;
class Main {
public static void out (Object o) {
System.out.println(o);
}
public static void main (String[] args) throws IOException {
BufferedReader br =
new BufferedReader(new InputStreamReader(System.in));
String[] line = br.readLine().split(" ");
int x = Math.abs(Integer.parseInt(line[0]));
int y = Math.abs(Integer.parseInt(line[1]));
int r = Integer.parseInt(line[2]);
double d = Math.sqrt(x * x + y * y) + r;
d = 2 * d * d;
for (int i = 1; ; i++) {
if (i * i >= d) {
out(i);
break;
}
}
}
}
spacia