結果

問題 No.98 円を描こう
ユーザー fkwnw3_1243fkwnw3_1243
提出日時 2017-04-27 21:42:56
言語 Java21
(openjdk 21)
結果
AC  
実行時間 44 ms / 5,000 ms
コード長 524 bytes
コンパイル時間 1,995 ms
コンパイル使用メモリ 71,748 KB
実行使用メモリ 49,440 KB
最終ジャッジ日時 2023-10-11 16:10:12
合計ジャッジ時間 3,271 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,428 KB
testcase_01 AC 44 ms
49,348 KB
testcase_02 AC 43 ms
49,440 KB
testcase_03 AC 44 ms
49,388 KB
testcase_04 AC 44 ms
49,360 KB
testcase_05 AC 44 ms
49,392 KB
testcase_06 AC 44 ms
49,212 KB
testcase_07 AC 44 ms
49,384 KB
testcase_08 AC 44 ms
49,356 KB
testcase_09 AC 44 ms
49,336 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String[] inputs = reader.readLine().split(" ");
        int x = Integer.parseInt(inputs[0]);
        int y = Integer.parseInt(inputs[1]);
        double distance = Math.sqrt(x * x + y * y);
        System.out.println((int) (distance * 2) + 1);
    }
}
0