結果
問題 | No.1042 愚直大学 |
ユーザー |
|
提出日時 | 2024-11-19 17:34:19 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 397 bytes |
コンパイル時間 | 842 ms |
コンパイル使用メモリ | 89,196 KB |
最終ジャッジ日時 | 2025-02-25 05:28:16 |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 23 |
ソースコード
#include <iostream> #include <iomanip> #include <cstdint> #include <cmath> using namespace std; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); uint32_t P, Q; cin >> P >> Q; auto l = 1.0, r = 1e18; while (r - l >= 1e-5) { const auto c = (l + r) / 2; if (c * c <= P + Q * c * log2(c)) l = c; else r = c; } cout << fixed << setprecision(10) << l << '\n'; return 0; }