結果
| 問題 | No.456 Millions of Submits! |
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2016-12-08 12:40:38 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,075 bytes |
| 記録 | |
| コンパイル時間 | 737 ms |
| コンパイル使用メモリ | 85,688 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-23 09:47:20 |
| 合計ジャッジ時間 | 9,051 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 WA * 3 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:56:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
56 | scanf("%d", &m);
| ~~~~~^~~~~~~~~~
main.cpp:60:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
60 | scanf("%d%d%Lf", &ai, &bi, &ti);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
/* -*- coding: utf-8 -*-
*
* 456.cc: No.456 Millions of Submits! - yukicoder
*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
using namespace std;
/* constant */
const int CNT = 50;
typedef long double ld;
const ld MIN_N = 0.0;
const ld MAX_N = expl(10);
/* typedef */
/* global variables */
ld powld(ld a, int b) {
ld p = 1.0;
while (b) {
if (b & 1) p *= a;
a *= a;
b >>= 1;
}
return p;
}
/* subroutines */
/* main */
int main() {
int m;
scanf("%d", &m);
while (m--) {
int ai, bi;
ld ti;
scanf("%d%d%Lf", &ai, &bi, &ti);
ld ln = MIN_N, rn = MAX_N;
for (int c = CNT; c--;) {
ld n = (ln + rn) / 2;
ld t = powld(n, ai) * powld(logl(n), bi);
if (t <= ti) ln = n;
else rn = n;
}
printf("%.11Lf\n", ln);
}
return 0;
}
tnakao0123