結果
問題 |
No.1042 愚直大学
|
ユーザー |
![]() |
提出日時 | 2020-05-01 21:34:55 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,015 bytes |
コンパイル時間 | 2,414 ms |
コンパイル使用メモリ | 215,756 KB |
最終ジャッジ日時 | 2025-01-10 04:20:05 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 15 WA * 8 |
ソースコード
#define _GLIBCXX_DEBUG #include<bits/stdc++.h> using namespace std; #define rep(i,x) for(ll i = 0; i < (ll)(x); i++) #define rrep(i,x) for(ll i = (ll)(x)-1;0 <= i; i--) #define reps(i,x) for(ll i = 1; i < (ll)(x)+1; i++) #define rreps(i,x) for(ll i = (ll)(x); 1 <= i; i--) #define debug(x) cerr << #x << ": " << (x) << "\n"; #define all(x) (x).begin(), (x).end() typedef long long ll; typedef long double ld; typedef pair<int,int> P; typedef pair<ll,ll> Pll; typedef vector<ll> vl; typedef vector<vector<ll>> vvl; typedef vector<vector<vector<ll>>> vvvl; const ll INF = numeric_limits<ll>::max()/4; const int n_max = 1e5+10; #define int ll signed main(){ cin.tie(nullptr); ios::sync_with_stdio(false); ll p,q; cin >> p >> q; double ok = 1, ng = 1e9; rep(i,100){ double x = (ok + ng) / 2.0; // debug(x);debug(p + q * x * log2(x)); if((x * x) < (p + q * x * log2(x)))ok = x; else ng = x; } cout << fixed << setprecision(15); cout << ok << endl; }