結果

問題 No.98 円を描こう
ユーザー takeya_okinotakeya_okino
提出日時 2017-07-08 22:45:54
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 402 bytes
コンパイル時間 2,469 ms
コンパイル使用メモリ 74,200 KB
実行使用メモリ 41,500 KB
最終ジャッジ日時 2024-04-16 06:39:33
合計ジャッジ時間 4,442 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 135 ms
41,368 KB
testcase_03 WA -
testcase_04 AC 136 ms
41,032 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 134 ms
41,344 KB
testcase_08 AC 136 ms
41,344 KB
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

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 s = xp * xp + yp * yp;
    int r = (int)Math.sqrt(s);
    int ans = 0;
    for(int i = r; i < r + 3; i++) {
      if(i * i > s) {
        ans = i;
        break; 
      }
    }
    System.out.println(2 * ans);
  }
}
0