結果

問題 No.98 円を描こう
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-11-12 06:39:34
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 5,000 ms
コード長 492 bytes
コンパイル時間 2,188 ms
コンパイル使用メモリ 71,620 KB
実行使用メモリ 56,164 KB
最終ジャッジ日時 2023-08-17 02:05:14
合計ジャッジ時間 3,987 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
56,092 KB
testcase_01 AC 125 ms
55,744 KB
testcase_02 AC 119 ms
54,548 KB
testcase_03 AC 119 ms
56,044 KB
testcase_04 AC 116 ms
55,512 KB
testcase_05 AC 120 ms
56,052 KB
testcase_06 AC 118 ms
56,056 KB
testcase_07 AC 118 ms
55,668 KB
testcase_08 AC 119 ms
55,916 KB
testcase_09 AC 119 ms
56,164 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