結果
問題 | No.456 Millions of Submits! |
ユーザー |
![]() |
提出日時 | 2016-12-08 00:44:40 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 2,917 ms / 4,500 ms |
コード長 | 550 bytes |
コンパイル時間 | 330 ms |
コンパイル使用メモリ | 23,808 KB |
実行使用メモリ | 6,940 KB |
最終ジャッジ日時 | 2024-06-26 03:12:20 |
合計ジャッジ時間 | 10,090 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%d", &m); | ^~~~~~~~~~~~~~~ main.c:12:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 12 | scanf("%lf %lf %lf", &a, &b, &t); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>#include <math.h>int main() {int m;scanf("%d", &m);double a, b, t, ans;int i;for (i = 0; i < m; i++) {scanf("%lf %lf %lf", &a, &b, &t);if (a == 0) ans = exp(pow(t, 1.0 / b));else if (b == 0) ans = pow(t, 1.0 / a);else {double n = 1.0;double tmp1 = pow(t, 1.0 / b);double tmp2 = a / b;while (1) {double tmp3 = n - exp(tmp1 / pow(n, tmp2));if (fabs(tmp3) <= 10e-10) {ans = n;break;}else n -= tmp3 / 4.0;}}printf("%.10lf\n", ans);}return 0;}