結果

問題 No.456 Millions of Submits!
ユーザー PachicobuePachicobue
提出日時 2017-08-14 00:30:36
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,475 bytes
コンパイル時間 1,399 ms
コンパイル使用メモリ 163,700 KB
実行使用メモリ 8,752 KB
最終ジャッジ日時 2023-09-05 23:55:09
合計ジャッジ時間 11,375 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

// {{{ Templates
#include <bits/stdc++.h>

#define show(x) cerr << #x << " = " << x << endl

using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;

template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v)
{
    os << "sz:" << v.size() << "\n[";
    for (const auto& p : v) {
        os << p << ",";
    }
    os << "]\n";
    return os;
}

template <typename S, typename T>
ostream& operator<<(ostream& os, const pair<S, T>& p)
{
    os << "(" << p.first << "," << p.second
       << ")";
    return os;
}


constexpr ll MOD = (ll)1e9 + 7LL;

template <typename T>
constexpr T INF = numeric_limits<T>::max() / 100;

// }}}

inline long double calc(const ll a, const ll b, const long double s)
{
    return (long double)pow(s, b) * (long double)exp(a * s);
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll m;
    cin >> m;
    for (ll i = 0; i < m; i++) {
        ll a, b;
        cin >> a >> b;
        long double t;
        cin >> t;
        long double inf = 1.0;
        long double sup = 100000.0;
        constexpr long double EPS = 1e-10;
        while (sup - inf > EPS) {
            const long double mid = (inf + sup) / 2;
            const long double c = calc(a, b, mid);
            if (c < t) {
                inf = mid;
            } else {
                sup = mid;
            }
        }
        cout << fixed << setprecision(10) << exp(inf) << "\n";
    }
    return 0;
}
0