QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#433768 | #8795. Mysterious Sequence | ucup-team3702# | WA | 14ms | 10592kb | Python3 | 381b | 2024-06-08 13:26:45 | 2024-06-08 13:26:48 |
Judging History
answer
a, b, n, x, y = map(eval, input().split())
l, r, eps = -100, 100, 1e-12
while r - l > eps:
mid = (l + r) / 2
f = [x, mid]
for i in range(2, n):
f.append(a * f[i - 1] + b * f[i - 2])
if f[n - 1] >= y: r = mid
else: l = mid
print(round(x, 10), round(l, 10), sep = '\n')
for i in range(2, n):
print(round(x + l, 10))
x, l = l, x + l
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 14ms
memory: 10468kb
input:
1.0 1.0 10 1 10
output:
1 -0.3235294118 0.6764705882 0.3529411765 1.0294117647 1.3823529412 2.4117647059 3.7941176471 6.2058823529 10.0
result:
ok 10 numbers
Test #2:
score: 0
Accepted
time: 14ms
memory: 10592kb
input:
1 1 2 1 100
output:
1 100.0
result:
ok 2 numbers
Test #3:
score: 0
Accepted
time: 10ms
memory: 10572kb
input:
1 1 5 50 100
output:
50 -0.0 50.0 50.0 100.0
result:
ok 5 numbers
Test #4:
score: -100
Wrong Answer
time: 11ms
memory: 10588kb
input:
0.25 0.25 10 1 1
output:
1 55.8755364807 56.8755364807 112.7510729614 169.6266094421 282.3776824034 452.0042918455 734.3819742489 1186.3862660944 1920.7682403433
result:
wrong answer 3rd numbers differ - expected: '14.2188841', found: '56.8755365', error = '3.0000000'