結果
問題 |
No.1042 愚直大学
|
ユーザー |
![]() |
提出日時 | 2023-12-21 22:08:51 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 375 bytes |
コンパイル時間 | 2,133 ms |
コンパイル使用メモリ | 193,792 KB |
最終ジャッジ日時 | 2025-02-18 13:07:50 |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 23 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ld = long double; int main(){ cin.tie(nullptr); ios_base::sync_with_stdio(false); ld P, Q; cin >> P >> Q; ld l=1, r=4e10, c; for (int i=0; i<1000; i++){ c = (l+r)/2; if (c <= P/c+Q*log2(c)) l=c; else r=c; } cout << setprecision(18) << l << endl; return 0; }