結果
| 問題 | No.456 Millions of Submits! |
| コンテスト | |
| ユーザー |
rickytheta
|
| 提出日時 | 2016-12-07 23:31:36 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 1,915 ms / 4,500 ms |
| コード長 | 1,721 bytes |
| 記録 | |
| コンパイル時間 | 1,473 ms |
| コンパイル使用メモリ | 158,192 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-23 03:55:08 |
| 合計ジャッジ時間 | 6,034 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:66:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
66 | scanf("%d",&m);
| ~~~~~^~~~~~~~~
main.cpp: In function ‘void solve()’:
main.cpp:36:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
36 | scanf("%lf%lf%lf",&a,&b,&t);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()
#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))
// mod
const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD
// floating
typedef double Real;
const Real EPS = 1e-11;
#define EQ0(x) (abs(x)<EPS)
#define EQ(a,b) (abs(a-b)<EPS)
typedef complex<Real> P;
inline void solve(/*double a,double b,double t*/){
double a,b,t;
scanf("%lf%lf%lf",&a,&b,&t);
if(a==0){
// ln(x)^b = t
t = pow(t,1.0/b);
printf("%.12f\n",exp(t));
}else if(b==0){
// x^a = t;
printf("%.12f\n",pow(t,1.0/a));
}else{
double dt = t;
t = log(t);
double lo=0.0, hi=12.0;
REP(_,50){
double mid = (lo+hi)/2.0;
double tt = a*mid + b*log(mid);
if(tt<t)lo = mid;
else hi = mid;
}
printf("%.12f\n",exp(lo));
// checker
// double ans = exp(lo);
// double check = pow(ans,a) * pow(log(ans),b);
// if(abs(check - dt) > EPS){
// printf("%f,%f,%f -> %f,%f\n",a,b,t,ans,check);
// }
}
}
int main(){
int m;
scanf("%d",&m);
while(m--)solve();
// FOR(a,1,11)FOR(b,1,11){
// for(double t = 0.1; t <= 10.0; t += 0.001){
// solve(a,b,t);
// }
// }
return 0;
}
rickytheta