結果

問題 No.456 Millions of Submits!
ユーザー FF256grhyFF256grhy
提出日時 2016-12-07 23:52:39
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 3,286 ms / 4,500 ms
コード長 1,790 bytes
コンパイル時間 212 ms
コンパイル使用メモリ 34,000 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-08-26 06:00:44
合計ジャッジ時間 8,504 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <cstdio>
#include <cmath>

typedef long long   signed int LL;
typedef long long unsigned int LU;

#define incID(i, l, r) for(int i = (l)    ; i <  (r); i++)
#define incII(i, l, r) for(int i = (l)    ; i <= (r); i++)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); i--)
#define decII(i, l, r) for(int i = (r)    ; i >= (l); i--)
#define inc( i, n) incID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define dec( i, n) decID(i, 0, n)
#define dec1(i, n) decII(i, 1, n)

#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))

template<typename T> void swap(T & x, T & y) { T t = x; x = y; y = t; return; }
template<typename T> T abs(T x) { return (0 <= x ? x : -x); }
template<typename T> T max(T a, T b) { return (b <= a ? a : b); }
template<typename T> T min(T a, T b) { return (a <= b ? a : b); }
template<typename T> bool setmin(T & a, T b) { if(a <= b) { return false; } else { a = b; return true; } }
template<typename T> bool setmax(T & a, T b) { if(b <= a) { return false; } else { a = b; return true; } }
template<typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }

// ---- ----

int m;

int main() {
	scanf("%d", &m);
	inc(i, m) {
		double a, b, t;
		scanf("%lf%lf%lf", &a, &b, &t);
		
		if(a == 0) {
			printf("%.12f\n", pow(2.718281828459, pow(t, 1.0 / b)));
		} else if(b == 0) {
			printf("%.12f\n", pow(t, 1.0 / a));
		} else {
			double n = 2.7;
			inc(j, 30) {
				double v = pow(n, a) * pow(log(n), b) - t;
				double diff = v / (pow(n, a - 1) * (a * pow(log(n), b) + b * pow(log(n), b - 1)));
				n -= diff;
				if(abs(diff) < 6e-10) { break; }
				// printf("%2d %.12f\n", j, n);
			}
			printf("%.12f\n", n);
		}
	}
	
	return 0;
}
0