結果

問題 No.456 Millions of Submits!
ユーザー Hoi_koroHoi_koro
提出日時 2016-12-12 21:57:34
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 2,038 bytes
コンパイル時間 1,367 ms
コンパイル使用メモリ 111,204 KB
実行使用メモリ 5,048 KB
最終ジャッジ日時 2023-09-05 21:52:20
合計ジャッジ時間 18,995 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
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 #

#include <iostream>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cassert>
#include <algorithm>
#include <iterator>
#include <string>
#include <vector>
#include <list>
#include <deque>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <tuple>
#include <queue>
#include <stack>
#include <functional>
#include <utility>
#include <complex>
#include <bitset>
#include <numeric>
#include <random>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n) ;++(i))
#define REPN(i,a,n) FOR((i),(a),(a)+(n))
#define FOR(i,a,b) for(int (i)=(a); (i)<(b) ;++(i))
#define PB push_back
#define MP make_pair
#define SE second
#define FI first
#define DBG(a) cerr<<(a)<<endl;
#define dump(a) cerr<<#a <<' '<< a <<endl;
#define ALL(v) (v).begin(),(v).end()
typedef long long LL;  typedef pair<LL, LL> PLL; typedef vector<LL> VLL;
typedef pair<int,int>PI; typedef vector<int> VI;
const LL LINF=334ll<<53; const int INF=15<<26; const LL MOD=1E9+7;
double eps=1e-13;
double solve(int a, int b, double t){
    double l=0.1,u=22222.0;
    while(u-l>5e-10 or (u-l)/l>5e-10){
        double m=(l+u)/2.0;
        if(pow(m,(double)a)*pow(log(m),(double)b)<t-eps){
            l=m;
        }else{
            u=m;
        }
    }
    return (l+u)/2.0;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(11);
    double pre[11][11][1002];
    REP(i,11)REP(j,11)FOR(k,10,1002)pre[i][j][k]=solve(i,j,k*0.01);
    int m,a,b,pt;
    cin >> m;
    double t,l,u,mid;
    REP(i,m){
        cin  >> a >> b >> t;
        pt=floor((t+0.00005)*100);
        l=pre[a][b][pt],u=pre[a][b][pt+1];
        if(a==0 and b==1){
            cout << exp(t)<<endl;
            continue;
        }
        while(u-l>15e-9 or (u-l)/l>15e-9){
            mid=(l+u)/2.0;
            if(pow(mid,(double)a)*pow(log(mid),(double)b)<t-eps){
                l=mid;
            }else{
                u=mid;
            }
        }
        cout << (l+u)/2.0<<endl;
    }

    return 0;
}
0