結果
問題 |
No.1042 愚直大学
|
ユーザー |
![]() |
提出日時 | 2020-05-15 23:13:49 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 363 bytes |
コンパイル時間 | 1,365 ms |
コンパイル使用メモリ | 167,592 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-19 13:19:10 |
合計ジャッジ時間 | 2,259 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 23 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); double p, q; cin >> p >> q; double l = 0, r = 1e18; for (int i = 0; i < 200; i++) { double mid = (l + r) / 2; if (mid * mid < p + q * mid * log2(mid)) l = mid; else r = mid; } cout << fixed << setprecision(10) << l << '\n'; }