結果

問題 No.98 円を描こう
ユーザー kenji_shioyakenji_shioya
提出日時 2016-06-27 17:30:33
言語 Java21
(openjdk 21)
結果
AC  
実行時間 116 ms / 5,000 ms
コード長 363 bytes
コンパイル時間 3,470 ms
コンパイル使用メモリ 74,912 KB
実行使用メモリ 54,292 KB
最終ジャッジ日時 2024-04-20 03:29:54
合計ジャッジ時間 4,327 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
54,064 KB
testcase_01 AC 115 ms
54,208 KB
testcase_02 AC 109 ms
53,012 KB
testcase_03 AC 98 ms
53,224 KB
testcase_04 AC 101 ms
53,064 KB
testcase_05 AC 110 ms
54,236 KB
testcase_06 AC 108 ms
53,904 KB
testcase_07 AC 114 ms
54,292 KB
testcase_08 AC 105 ms
53,824 KB
testcase_09 AC 108 ms
54,040 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Exercise133{
  public static void main (String[] args){

    Scanner sc = new Scanner(System.in);

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

    double r = Math.sqrt(x * x + y * y);
    if(r % 1 == 0){
      System.out.println((int)(r * 2 + 1));
    }else{
      System.out.println((int)(Math.ceil(r * 2)));
    }
	}
}
0