結果
| 問題 |
No.1042 愚直大学
|
| コンテスト | |
| ユーザー |
mot
|
| 提出日時 | 2020-05-01 21:51:35 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 44 ms / 2,000 ms |
| コード長 | 598 bytes |
| コンパイル時間 | 899 ms |
| コンパイル使用メモリ | 81,440 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-25 03:34:04 |
| 合計ジャッジ時間 | 3,554 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 |
ソースコード
#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 = 1e20;
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;
}
mot