QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#563568 | #8795. Mysterious Sequence | donghanwen1225 | WA | 0ms | 3728kb | C++20 | 377b | 2024-09-14 13:53:55 | 2024-09-14 13:53:56 |
Judging History
answer
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
double a,b;int n,x1,xn;
cin>>a>>b;cin>>n>>x1>>xn;
double l=-10000,r=10000;
while(r-l>1e-12)
{
double mid=(l+r)/2;
double c1=x1,c2=mid;
for(int i=3;i<=n;i++)
{
double nc=c1*a+c2*b;
c1=c2;c2=nc;
}
if(c2<xn) l=mid;
else r=mid;
}
printf("%.12lf",r);
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3728kb
input:
1.0 1.0 10 1 10
output:
-0.323529411764
result:
wrong answer 1st numbers differ - expected: '1.0000000', found: '-0.3235294', error = '1.3235294'