結果
| 問題 |
No.1042 愚直大学
|
| コンテスト | |
| ユーザー |
umezo
|
| 提出日時 | 2022-02-06 18:57:43 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 510 bytes |
| コンパイル時間 | 2,216 ms |
| コンパイル使用メモリ | 192,016 KB |
| 最終ジャッジ日時 | 2025-01-27 20:38:03 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 15 WA * 8 |
ソースコード
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
#include<bits/stdc++.h>
using namespace std;
const double EPS=1e-9;
int main(){
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
double p,q;
cin>>p>>q;
double ok=1,ng=1e9+7;
auto f=[&](double x){
if(x*x<p+q*x*log2(x)+EPS) return true;
return false;
};
rep(i,100){
double mid=(ok+ng)/2;
if(f(mid)) ok=mid;
else ng=mid;
}
printf("%.10f",ok);
return 0;
}
umezo