結果
問題 | No.98 円を描こう |
ユーザー | scache |
提出日時 | 2014-12-09 23:27:50 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 451 bytes |
コンパイル時間 | 3,499 ms |
コンパイル使用メモリ | 72,144 KB |
実行使用メモリ | 58,168 KB |
最終ジャッジ日時 | 2023-09-02 12:17:36 |
合計ジャッジ時間 | 5,687 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge16 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 127 ms
56,188 KB |
testcase_01 | AC | 125 ms
56,036 KB |
testcase_02 | AC | 128 ms
56,072 KB |
testcase_03 | AC | 126 ms
56,132 KB |
testcase_04 | AC | 127 ms
55,580 KB |
testcase_05 | AC | 128 ms
55,816 KB |
testcase_06 | WA | - |
testcase_07 | AC | 132 ms
55,804 KB |
testcase_08 | AC | 126 ms
55,996 KB |
testcase_09 | WA | - |
ソースコード
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); } }