結果
問題 | No.98 円を描こう |
ユーザー | HEGO55 |
提出日時 | 2017-05-17 17:30:54 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 453 bytes |
コンパイル時間 | 4,176 ms |
コンパイル使用メモリ | 74,732 KB |
実行使用メモリ | 57,628 KB |
最終ジャッジ日時 | 2023-10-17 23:57:12 |
合計ジャッジ時間 | 5,409 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge11 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 129 ms
57,424 KB |
testcase_01 | AC | 132 ms
57,436 KB |
testcase_02 | AC | 130 ms
57,552 KB |
testcase_03 | AC | 131 ms
57,448 KB |
testcase_04 | WA | - |
testcase_05 | AC | 132 ms
57,456 KB |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
ソースコード
import java.util.*; public class Test39{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int Xp = sc.nextInt(); int Yp = sc.nextInt(); int D = (Xp*Xp)+(Yp*Yp); int i = 1; if(Xp == Yp){ if(Xp != 0){ while(D>i*i){ i++; } System.out.println(2*i); }else{ System.out.println("1"); } }else{ while(D>i*i){ i++; } System.out.println((2*i)+1); } } }