QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#466578 | #968. Extreme Wealth | Kevin5307 | WA | 6ms | 19976kb | C++23 | 1.1kb | 2024-07-07 22:38:31 | 2024-07-07 22:38:32 |
Judging History
answer
//Author: Kevin
#include<bits/stdc++.h>
//#pragma GCC optimize("O2")
using namespace std;
#define ll long long
#define ull unsigned ll
#define pb emplace_back
#define mp make_pair
#define ALL(x) (x).begin(),(x).end()
#define rALL(x) (x).rbegin(),(x).rend()
#define srt(x) sort(ALL(x))
#define rev(x) reverse(ALL(x))
#define rsrt(x) sort(rALL(x))
#define sz(x) (int)(x.size())
#define inf 0x3f3f3f3f
#define pii pair<int,int>
#define lb(v,x) (int)(lower_bound(ALL(v),x)-v.begin())
#define ub(v,x) (int)(upper_bound(ALL(v),x)-v.begin())
#define uni(v) v.resize(unique(ALL(v))-v.begin())
#define longer __int128_t
void die(string S){puts(S.c_str());exit(0);}
const long double eps=1e-9;
long double dp[1005][1005];
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
for(int i=0;i<1005;i++)
dp[i][0]=dp[0][i]=pow(0.5,i);
for(int i=1;i<1005;i++)
for(int j=1;j<1005;j++)
dp[i][j]=(dp[i-1][j]+dp[i][j-1])/2;
ll a,b;
cin>>a>>b;
if(max(a,b)>1000) die("Extreme Wealth");
long double ans=1/dp[a][b];
if(ans>1e9) die("Extreme Wealth");
cout<<fixed<<setprecision(15)<<ans<<endl;
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 19888kb
input:
3 2
output:
3.200000000000000
result:
ok OK 3.20000000, real ans = 3.20000000, error = 0.00000000
Test #2:
score: 0
Accepted
time: 6ms
memory: 19824kb
input:
0 29
output:
536870912.000000000000000
result:
ok OK 536870912.00000000, real ans = 536870912.00000000, error = 0.00000000
Test #3:
score: 0
Accepted
time: 0ms
memory: 19696kb
input:
30 0
output:
Extreme Wealth
result:
ok OK Extreme Wealth, real ans = 1073741824.00000000
Test #4:
score: 0
Accepted
time: 3ms
memory: 19976kb
input:
37 73
output:
5028.488859583218828
result:
ok OK 5028.48885958, real ans = 5028.48885958, error = 0.00000000
Test #5:
score: -100
Wrong Answer
time: 6ms
memory: 19876kb
input:
10000000000 10000000000
output:
Extreme Wealth
result:
wrong answer WA not Extreme Wealth, real ans = 177245.38509055