結果
問題 | No.456 Millions of Submits! |
ユーザー |
![]() |
提出日時 | 2016-12-07 23:53:23 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 3,014 ms / 4,500 ms |
コード長 | 511 bytes |
コンパイル時間 | 113 ms |
コンパイル使用メモリ | 23,936 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-26 03:12:09 |
合計ジャッジ時間 | 12,171 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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("%lf", &m); | ^~~~~~~~~~~~~~~~ main.c:12:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 12 | scanf("%d %d %lf", &a, &b, &t); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>#include <math.h>int main() {double m;scanf("%lf", &m);int a, b, i;double t, ans;for (i = 0; i < m; i++) {scanf("%d %d %lf", &a, &b, &t);if (b == 0) ans = pow(t, 1.0 / a);else {double n = 1.0;double tmp1 = pow(t, 1.0 / b);while (1) {double tmp2 = pow(n, (double)a / b);double tmp3 = n - exp(tmp1 / tmp2);if (fabs(tmp3) < 10e-10) {ans = n;break;}else n -= tmp3 / 4.0;}}printf("%.10lf\n", ans);}return 0;}