結果

問題 No.98 円を描こう
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-11-12 06:39:34
言語 Java21
(openjdk 21)
結果
AC  
実行時間 120 ms / 5,000 ms
コード長 492 bytes
コンパイル時間 1,864 ms
コンパイル使用メモリ 74,120 KB
実行使用メモリ 54,460 KB
最終ジャッジ日時 2024-05-04 09:19:40
合計ジャッジ時間 3,559 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
53,804 KB
testcase_01 AC 117 ms
54,460 KB
testcase_02 AC 116 ms
53,868 KB
testcase_03 AC 103 ms
53,016 KB
testcase_04 AC 104 ms
54,332 KB
testcase_05 AC 104 ms
52,824 KB
testcase_06 AC 114 ms
54,220 KB
testcase_07 AC 116 ms
53,848 KB
testcase_08 AC 113 ms
54,252 KB
testcase_09 AC 102 ms
53,100 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    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 r = (int)Math.sqrt(d);
        double z = r;
        while(true){
            if(z*z<=d){
                z=z+0.5;
            }else{
                break;
            }
        }
        int a = (int)(2*z);
        System.out.println(a);
    }
}
0