結果

問題 No.1042 愚直大学
ユーザー joybeeeejoybeeee
提出日時 2020-05-13 12:01:25
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 546 bytes
コンパイル時間 1,834 ms
コンパイル使用メモリ 71,756 KB
実行使用メモリ 62,072 KB
最終ジャッジ日時 2023-10-12 16:57:09
合計ジャッジ時間 5,977 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,936 KB
testcase_01 AC 120 ms
55,908 KB
testcase_02 AC 119 ms
55,640 KB
testcase_03 AC 119 ms
55,792 KB
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Main {

  public static void main(String[] args) { 
      Scanner sc = new Scanner(System.in);
      int p = sc.nextInt();
      int q = sc.nextInt();

      double left = 1.0, right = Double.MAX_VALUE;
      while(right - left > 10e-9) {
        double mid = left + (right - left) / 2;
        double res1 = mid * mid;
        double res2 = p + q * mid * Math.log(mid) / Math.log(2);
        if(res1 < res2)
          left = mid;
        else
          right = mid;
      }
      System.out.println(right);
  }
}
0