結果
| 問題 | No.456 Millions of Submits! |
| コンテスト | |
| ユーザー |
はむこ
|
| 提出日時 | 2016-11-28 00:08:37 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,520 bytes |
| 記録 | |
| コンパイル時間 | 1,414 ms |
| コンパイル使用メモリ | 159,272 KB |
| 実行使用メモリ | 10,396 KB |
| 最終ジャッジ日時 | 2024-06-23 01:10:31 |
| 合計ジャッジ時間 | 13,734 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 TLE * 1 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:21:17: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
21 | int m; scanf("%d", &m);
| ~~~~~^~~~~~~~~~
main.cpp:23:24: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
23 | int a, b; scanf("%d%d", &a, &b);
| ~~~~~^~~~~~~~~~~~~~~~
main.cpp:24:24: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
24 | Double t; scanf("%Lf", &t);
| ~~~~~^~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(long long i = 0; i < (long long)(n); i++)
#define pb push_back
#define all(x) (x).begin(), (x).end()
template<class T1, class T2> bool chmin(T1 &a, T2 b) { return b < a && (a = b, true); }
template<class T1, class T2> bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template <typename T, typename U> ostream &operator<<(ostream &o, const pair<T, U> &v) { o << "(" << v.first << ", " << v.second << ")"; return o; }
template <typename T> ostream &operator<<(ostream &o, const vector<T> &v) { if (!v.empty()) { o << '['; copy(v.begin(), v.end(), ostream_iterator<T>(o, ", ")); o << "\b\b]"; } return o; }
using ll = long long; using vll = vector<ll>; using vi = vector<int>;
typedef pair<ll, ll> P;
static const double EPS = 1e-14;
static const long long INF = 1e18;
#define MAX_N 100005
typedef long double Double;
int main(void) {
int m; scanf("%d", &m);
rep(i, m) {
int a, b; scanf("%d%d", &a, &b);
Double t; scanf("%Lf", &t);
if (!a) {
printf("%.12Lf\n", expl(powl(t, 1.0l / b)));
continue;
}
if (!b) {
printf("%.12Lf\n", powl(t, 1.0l / a));
continue;
}
Double rl = 1e-12;
Double rr = 11;
rep(i, 100) {
Double m = (rl + rr) / 2.0l;
(powl(m, a) * powl(log(m), b) - t > 0.0l) ? rr = m : rl = m;
}
Double n = rl;
printf("%.12Lf\n", n);
}
return 0;
}
はむこ