結果

問題 No.98 円を描こう
ユーザー abcabc
提出日時 2016-11-03 02:05:36
言語 Java21
(openjdk 21)
結果
AC  
実行時間 136 ms / 5,000 ms
コード長 362 bytes
コンパイル時間 2,135 ms
コンパイル使用メモリ 73,836 KB
実行使用メモリ 41,516 KB
最終ジャッジ日時 2024-05-03 21:17:56
合計ジャッジ時間 4,121 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
41,316 KB
testcase_01 AC 129 ms
41,208 KB
testcase_02 AC 133 ms
40,960 KB
testcase_03 AC 130 ms
41,040 KB
testcase_04 AC 129 ms
41,516 KB
testcase_05 AC 131 ms
40,964 KB
testcase_06 AC 132 ms
40,856 KB
testcase_07 AC 129 ms
40,928 KB
testcase_08 AC 132 ms
41,044 KB
testcase_09 AC 136 ms
41,328 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int x = sc.nextInt();
        int y = sc.nextInt();

        double radius = Math.sqrt((x * x) + (y * y));

        int diameter = (int) Math.floor(2 * radius) + 1;

        System.out.println(diameter);

    }

}
0