結果

問題 No.98 円を描こう
ユーザー GrenacheGrenache
提出日時 2015-09-23 19:42:45
言語 Java21
(openjdk 21)
結果
AC  
実行時間 139 ms / 5,000 ms
コード長 429 bytes
コンパイル時間 3,735 ms
コンパイル使用メモリ 72,236 KB
実行使用メモリ 55,944 KB
最終ジャッジ日時 2023-09-26 14:37:48
合計ジャッジ時間 5,678 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
55,944 KB
testcase_01 AC 134 ms
55,684 KB
testcase_02 AC 134 ms
55,852 KB
testcase_03 AC 135 ms
55,736 KB
testcase_04 AC 130 ms
55,796 KB
testcase_05 AC 136 ms
55,676 KB
testcase_06 AC 139 ms
55,620 KB
testcase_07 AC 133 ms
55,868 KB
testcase_08 AC 132 ms
55,736 KB
testcase_09 AC 133 ms
53,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main_yukicoder98 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

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

        int l = (int)Math.ceil(Math.sqrt(x * x + y * y) * 2);

        if (l % 2 == 0 && l * l / 2 / 2 == x * x + y * y) {
        	l++;
        }

        System.out.println(l);
        
        sc.close();
    }
}
0