QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#433843#8795. Mysterious Sequenceucup-team3702#WA 9ms9660kbPython3318b2024-06-08 13:39:002024-06-08 13:39:02

Judging History

你现在查看的是最新测评结果

  • [2024-06-08 13:39:02]
  • 评测
  • 测评结果:WA
  • 用时:9ms
  • 内存:9660kb
  • [2024-06-08 13:39:00]
  • 提交

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'