結果

問題 No.456 Millions of Submits!
ユーザー chaemonchaemon
提出日時 2016-12-07 23:47:25
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 3,351 ms / 4,500 ms
コード長 2,318 bytes
コンパイル時間 931 ms
コンパイル使用メモリ 82,664 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-05 08:16:16
合計ジャッジ時間 12,323 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 5 ms
4,380 KB
testcase_08 AC 5 ms
4,376 KB
testcase_09 AC 36 ms
4,376 KB
testcase_10 AC 36 ms
4,376 KB
testcase_11 AC 335 ms
4,376 KB
testcase_12 AC 3,351 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: 関数 ‘rn df(rn)’ 内:
main.cpp:75:1: 警告: 非 void を戻す関数内に return 文がありません [-Wreturn-type]
   75 | }
      | ^

ソースコード

diff #

// #includes {{{
#include <algorithm>
#include <quadmath.h>
#include <numeric>
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <list>
#include <deque>
#include <stack>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <cstring>
#include <cmath>
using namespace std;
// }}}
// pre-written code {{{
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define RREP(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();++i)
#define LET(x,a) __typeof(a) x(a)
//#define IFOR(i,it,c) for(__typeof((c).begin())it=(c).begin();it!=(c).end();++it,++i)
#define ALL(c) (c).begin(), (c).end()
#define MP make_pair

#define EXIST(e,s) ((s).find(e)!=(s).end())

#define RESET(a) memset((a),0,sizeof(a))
#define SET(a) memset((a),-1,sizeof(a))
#define PB push_back
#define DEC(it,command) __typeof(command) it=command

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define debug2(x) cerr << #x << " = [";REP(__ind,(x).size()){cerr << (x)[__ind] << ", ";}cerr << "] (L" << __LINE__ << ")" << endl;

const int INF=0x3f3f3f3f;

typedef long long Int;
typedef unsigned long long uInt;
#ifdef __MINGW32__
typedef double rn;
#else
typedef long double rn;
#endif

typedef pair<int,int> pii;

/*
#ifdef MYDEBUG
#include"debug.h"
#include"print.h"
#endif
*/
// }}}

int a,b;
rn t;

rn f(rn x){
	rn ans=1.0L,l = logl(x);
	REP(i,a)ans*=x;
	REP(i,b)ans*=l;
	return ans;
//	return log(x)*(rn)a+log(log(x))*(rn)b;
}

rn df(rn x){
	
}

void main2(int ct){
	scanf("%d%d%Lf",&a,&b,&t);
//	rn l = 1.0L, r = 20L;
	rn l = 1.0L, r = 200000L;
	if(a==0){
		t = powl(t,1.0L/(rn)b);
		rn result = exp(t);
		printf("%.10Lf\n",result);
	}else if(b==0){
		printf("%.10Lf\n",powl(t,1.0L/(rn)a));
	}else{
		while(r-l>1e-10L){
			rn m =(l+r)*0.5L;
			if(f(m)<t)l=m;
//			if(f(m)<log(t))l=m;
			else r=m;
		}
		printf("%.10Lf\n",l);
	}
}

void test(){
	REP(a,10){
		::a=a;
		REP(b,10){
			::b=b;
			if(a==0 and b==0){
				continue;
			}
			if(a>0)continue;
			cout<<a<<" "<<b<<endl;
			cout<<f(10000.7182L)<<endl;
		}
	}
}

// main function {{{
int main() {
	int T;scanf("%d",&T);
	REP(ct, T)main2(ct);
	return 0;
}
//}}}
0