結果

問題 No.1042 愚直大学
ユーザー motmot
提出日時 2020-05-01 21:49:50
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 599 bytes
コンパイル時間 2,074 ms
コンパイル使用メモリ 75,688 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-08-26 09:12:40
合計ジャッジ時間 3,199 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
4,380 KB
testcase_01 AC 50 ms
4,376 KB
testcase_02 AC 18 ms
4,380 KB
testcase_03 AC 49 ms
4,376 KB
testcase_04 AC 47 ms
4,380 KB
testcase_05 AC 47 ms
4,376 KB
testcase_06 AC 49 ms
4,380 KB
testcase_07 AC 48 ms
4,380 KB
testcase_08 AC 48 ms
4,380 KB
testcase_09 AC 48 ms
4,384 KB
testcase_10 AC 51 ms
4,380 KB
testcase_11 AC 52 ms
4,380 KB
testcase_12 AC 49 ms
4,380 KB
testcase_13 AC 50 ms
4,376 KB
testcase_14 AC 50 ms
4,376 KB
testcase_15 AC 47 ms
4,380 KB
testcase_16 AC 48 ms
4,380 KB
testcase_17 AC 50 ms
4,376 KB
testcase_18 AC 51 ms
4,376 KB
testcase_19 AC 48 ms
4,380 KB
testcase_20 AC 50 ms
4,380 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 46 ms
4,380 KB
testcase_24 AC 48 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
const int inf=1e9+7;
const ll mod=1e9+7;

int main() {
    ll P, Q;
    cin>>P>>Q;
    double l, m, r;
    l = 0;
    r = P * Q;
    for(int i=0;i<1000000;++i){
        m = (l+r)/2;
        if(P+Q*m*log2(m)-m*m>0){
            l = m;
        }
        else{
            r = m;
        }
    }
    cout<<setprecision(20)<<l<<endl;
}

0