結果
問題 |
No.98 円を描こう
|
ユーザー |
|
提出日時 | 2014-12-09 23:27:50 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 451 bytes |
コンパイル時間 | 4,337 ms |
コンパイル使用メモリ | 74,748 KB |
実行使用メモリ | 41,664 KB |
最終ジャッジ日時 | 2024-06-11 19:00:14 |
合計ジャッジ時間 | 4,599 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 4 WA * 2 |
ソースコード
import java.util.Scanner; public class Main98 { public static void main(String[] args) { Main98 p = new Main98(); } public Main98() { Scanner sc = new Scanner(System.in); int x = sc.nextInt(); int y = sc.nextInt(); solve(x, y); } public void solve(int x, int y) { double r = Math.ceil(Math.sqrt(x*x+y*y)); if(x*x+y*y == (int)(r*r)) r = 2*r+1; else r = 2*r; System.out.println((int)r); } }