QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#433768#8795. Mysterious Sequenceucup-team3702#WA 14ms10592kbPython3381b2024-06-08 13:26:452024-06-08 13:26:48

Judging History

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

  • [2024-06-08 13:26:48]
  • 评测
  • 测评结果:WA
  • 用时:14ms
  • 内存:10592kb
  • [2024-06-08 13:26:45]
  • 提交

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

詳細信息

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'