結果
問題 |
No.98 円を描こう
|
ユーザー |
|
提出日時 | 2017-03-19 15:36:01 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 148 ms / 5,000 ms |
コード長 | 490 bytes |
コンパイル時間 | 3,466 ms |
コンパイル使用メモリ | 74,136 KB |
実行使用メモリ | 41,784 KB |
最終ジャッジ日時 | 2024-07-04 23:37:09 |
合計ジャッジ時間 | 5,613 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 6 |
ソースコード
import java.util.Scanner; public class No98 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); double x = sc.nextDouble(); double y = sc.nextDouble(); double hypo = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2)); double diameter = hypo * 2; if (diameter - Math.floor(diameter) == 0) { diameter += 1; } System.out.println((int) Math.ceil(diameter)); sc.close(); } }