QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#433856#8795. Mysterious Sequenceucup-team3702#WA 15ms10588kbPython3321b2024-06-08 13:41:582024-06-08 13:41:59

Judging History

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

  • [2024-06-08 13:41:59]
  • 评测
  • 测评结果:WA
  • 用时:15ms
  • 内存:10588kb
  • [2024-06-08 13:41:58]
  • 提交

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("{:.12f}\n{:.12f}".format(x, y))
for i in range(2, n):
    print(round(x + y, 12))
    x, y = y, x + y

詳細信息

Test #1:

score: 100
Accepted
time: 11ms
memory: 10588kb

input:

1.0 1.0 10 1 10

output:

1.000000000000
-0.323529411765
0.676470588235
0.352941176471
1.029411764706
1.382352941176
2.411764705882
3.794117647059
6.205882352941
10.0

result:

ok 10 numbers

Test #2:

score: 0
Accepted
time: 15ms
memory: 10496kb

input:

1 1 2 1 100

output:

1.000000000000
100.000000000000

result:

ok 2 numbers

Test #3:

score: 0
Accepted
time: 10ms
memory: 10560kb

input:

1 1 5 50 100

output:

50.000000000000
0.000000000000
50.0
50.0
100.0

result:

ok 5 numbers

Test #4:

score: -100
Wrong Answer
time: 15ms
memory: 10572kb

input:

0.25 0.25 10 1 1

output:

1.000000000000
55.875536480687
56.875536480687
112.751072961373
169.62660944206
282.377682403433
452.004291845494
734.381974248927
1186.386266094421
1920.768240343348

result:

wrong answer 3rd numbers differ - expected: '14.2188841', found: '56.8755365', error = '3.0000000'