QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#433843 | #8795. Mysterious Sequence | ucup-team3702# | WA | 9ms | 9660kb | Python3 | 318b | 2024-06-08 13:39:00 | 2024-06-08 13:39:02 |
Judging History
answer
a, b, n, s, t = map(eval, input().split())
x = [(1, 0), (0, 1)]
for i in range(2, n):
x.append(tuple(a * p + b * q for p, q in zip(x[i - 1], x[i - 2])))
x, y = s, (t - x[n - 1][0] * s) / x[n - 1][1]
print("{:.8f}\n{:.8f}".format(x, y))
for i in range(2, n):
print(round(x + y, 8))
x, y = y, x + y
详细
Test #1:
score: 100
Accepted
time: 7ms
memory: 9548kb
input:
1.0 1.0 10 1 10
output:
1.00000000 -0.32352941 0.67647059 0.35294118 1.02941176 1.38235294 2.41176471 3.79411765 6.20588235 10.0
result:
ok 10 numbers
Test #2:
score: 0
Accepted
time: 9ms
memory: 9600kb
input:
1 1 2 1 100
output:
1.00000000 100.00000000
result:
ok 2 numbers
Test #3:
score: 0
Accepted
time: 7ms
memory: 9660kb
input:
1 1 5 50 100
output:
50.00000000 0.00000000 50.0 50.0 100.0
result:
ok 5 numbers
Test #4:
score: -100
Wrong Answer
time: 4ms
memory: 9548kb
input:
0.25 0.25 10 1 1
output:
1.00000000 55.87553648 56.87553648 112.75107296 169.62660944 282.3776824 452.00429185 734.38197425 1186.38626609 1920.76824034
result:
wrong answer 3rd numbers differ - expected: '14.2188841', found: '56.8755365', error = '3.0000000'