結果

問題 No.456 Millions of Submits!
ユーザー chocoruskchocorusk
提出日時 2019-12-12 22:35:52
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 3,137 ms / 4,500 ms
コード長 1,031 bytes
コンパイル時間 907 ms
コンパイル使用メモリ 106,700 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-08 02:24:03
合計ジャッジ時間 12,226 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
double solve(int a, int b, double t){
    if(b==0) return pow(t, 1.0/a);
    if(a==0) return exp(pow(t, 1.0/b));
    double x=2;
    for(int i=0; i<20; i++){
        double y=log(x), xp=pow(x, 1-a), yp=pow(y, 1-b);
        double z=(x*y-t*xp*yp)/(a*y+b);
        x-=z;
    }
    return x;
}
int main()
{
	int m;
    scanf("%d", &m);
    for(int i=0; i<m; i++){
        int a, b; double t;
        scanf("%d %d %lf", &a, &b, &t);
        printf("%.10lf\n", solve(a, b, t));
    }
	return 0;
}
0