結果

問題 No.456 Millions of Submits!
ユーザー くれちー
提出日時 2016-12-07 23:37:36
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
RE  
実行時間 -
コード長 554 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 31,744 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-23 03:59:26
合計ジャッジ時間 2,686 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12 RE * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         scanf("%lf", &m);
      |         ~~~~~^~~~~~~~~~~
main.cpp:15:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   15 |                 scanf("%d %d %lf", &a, &b, &t);
      |                 ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <cstdio>
#include <cmath>
using namespace std;

int main() {
	double m;
	scanf("%lf", &m);

	if (m > 300000) return -1;

	int a, b;
	double t, ans;

	for (int i = 0; i < m; i++) {
		scanf("%d %d %lf", &a, &b, &t);
		if (b == 0) ans = pow(t, 1.0 / a);
		else {
			for (double n = 1.0;;) {
				double tmp1 = pow(t, 1.0 / b);
				double tmp2 = pow(n, (double)a / b);
				double tmp3 = n - exp(tmp1 / tmp2);

				if (abs(tmp3) < 10e-10) {
					ans = n;
					break;
				}
				else n -= tmp3 / 4.0;
			}
		}
		printf("%.10lf\n", ans);
	}

	return 0;
}
0