QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#673059 | #8795. Mysterious Sequence | malkovsky | AC ✓ | 16ms | 10740kb | Python3 | 521b | 2024-10-24 20:28:11 | 2024-10-24 20:28:12 |
Judging History
answer
def __main__():
a, b, n, x1, xn = input().split()
a = float(a)
b = float(b)
n = int(n)
x1 = float(x1)
xn = float(xn)
kb = [(0, x1) for i in range(n)]
kb[1] = (1, 0)
for i in range(2, n):
kb[i] = (a * kb[i - 1][0] + b * kb[i - 2][0], a * kb[i - 1][1] + b * kb[i - 2][1])
x2 = (xn - kb[-1][1]) / kb[-1][0]
print(x1)
print(x2)
for i in range(2, n):
t = a * x2 + b * x1
x1 = x2
x2 = t
print(t)
__main__()
这程序好像有点Bug,我给组数据试试?
詳細信息
Test #1:
score: 100
Accepted
time: 15ms
memory: 10520kb
input:
1.0 1.0 10 1 10
output:
1.0 -0.3235294117647059 0.6764705882352942 0.35294117647058826 1.0294117647058825 1.3823529411764708 2.4117647058823533 3.7941176470588243 6.2058823529411775 10.000000000000002
result:
ok 10 numbers
Test #2:
score: 0
Accepted
time: 9ms
memory: 10624kb
input:
1 1 2 1 100
output:
1.0 100.0
result:
ok 2 numbers
Test #3:
score: 0
Accepted
time: 15ms
memory: 10600kb
input:
1 1 5 50 100
output:
50.0 0.0 50.0 50.0 100.0
result:
ok 5 numbers
Test #4:
score: 0
Accepted
time: 6ms
memory: 10636kb
input:
0.25 0.25 10 1 1
output:
1.0 55.8755364806867 14.218884120171674 17.523605150214593 7.935622317596566 6.36480686695279 3.575107296137339 2.4849785407725324 1.515021459227468 1.0
result:
ok 10 numbers
Test #5:
score: 0
Accepted
time: 16ms
memory: 10712kb
input:
0.25 0.63 6 93 12
output:
93.0 -14.204807958665043 55.03879801033374 4.810670488624458 35.87711036866637 12.000000000000002
result:
ok 6 numbers
Test #6:
score: 0
Accepted
time: 5ms
memory: 10584kb
input:
0.25 0.80 10 5 63
output:
5.0 78.76953618353136 23.69238404588284 68.9387249582958 36.188588476280216 64.19812708570669 45.00040255245085 62.608602306678065 51.6524726186302 63.0
result:
ok 10 numbers
Test #7:
score: 0
Accepted
time: 8ms
memory: 10708kb
input:
0.25 0.99 3 18 30
output:
18.0 48.72 30.0
result:
ok 3 numbers
Test #8:
score: 0
Accepted
time: 15ms
memory: 10556kb
input:
0.28 0.64 9 6 10
output:
6.0 20.950403348507802 9.706112937582185 16.125969765568005 10.72718381441164 13.324232117998783 10.596182634263108 11.494439693112891 10.0
result:
ok 9 numbers
Test #9:
score: 0
Accepted
time: 12ms
memory: 10696kb
input:
0.31 0.40 7 10 49
output:
10.0 240.1150639986882 78.43566983959334 120.36108324974921 68.6862037432596 69.43715646031016 48.99999999999999
result:
ok 7 numbers
Test #10:
score: 0
Accepted
time: 8ms
memory: 10608kb
input:
0.32 0.28 5 36 6
output:
36.0 10.121376811594196 13.318840579710145 7.096014492753621 6.0
result:
ok 5 numbers
Test #11:
score: 0
Accepted
time: 12ms
memory: 10696kb
input:
0.35 0.65 10 86 82
output:
86.0 79.53392478623086 83.73687367518079 81.00495689736333 82.78070280294467 81.6264679643168 82.37672060942492 81.88905639010464 82.20603813266283 82.0
result:
ok 10 numbers
Test #12:
score: 0
Accepted
time: 7ms
memory: 10640kb
input:
0.36 0.68 8 72 59
output:
72.0 38.23991864260569 62.72637071133805 48.58463813305356 60.14440181160916 54.689538582655715 60.58642712165029 58.99999999999999
result:
ok 8 numbers
Test #13:
score: 0
Accepted
time: 16ms
memory: 10640kb
input:
0.43 0.61 2 93 84
output:
93.0 84.0
result:
ok 2 numbers
Test #14:
score: 0
Accepted
time: 7ms
memory: 10580kb
input:
0.46 0.96 6 65 35
output:
65.0 -16.61742366281805 54.7559851151037 9.235026436642375 56.81385787135504 35.0
result:
ok 6 numbers
Test #15:
score: 0
Accepted
time: 15ms
memory: 10708kb
input:
0.50 0.90 4 19 1
output:
19.0 -6.565217391304349 13.817391304347828 1.0
result:
ok 4 numbers
Test #16:
score: 0
Accepted
time: 10ms
memory: 10704kb
input:
0.54 0.35 3 16 22
output:
16.0 30.370370370370367 22.0
result:
ok 3 numbers
Test #17:
score: 0
Accepted
time: 15ms
memory: 10580kb
input:
0.55 0.89 10 74 13
output:
74.0 -48.32193707657652 39.28293460788291 -21.400909963817497 23.191311320916167 -6.29158864129368 17.17989332290386 3.8494274368457484 17.407290147649597 12.999999999999996
result:
ok 10 numbers
Test #18:
score: 0
Accepted
time: 15ms
memory: 10700kb
input:
0.56 0.36 3 31 88
output:
31.0 137.2142857142857 87.99999999999999
result:
ok 3 numbers
Test #19:
score: 0
Accepted
time: 16ms
memory: 10636kb
input:
0.57 0.93 7 71 48
output:
71.0 -34.08056536168601 46.60407774383897 -5.13060147237978 40.417349462513776 18.266429824319655 48.000000000000014
result:
ok 7 numbers
Test #20:
score: 0
Accepted
time: 13ms
memory: 10740kb
input:
0.58 0.41 8 30 69
output:
30.0 89.43212168280982 64.1706305760297 73.88613562404925 69.16391719812073 70.40838758077021 69.19407084807622 68.99999999999999
result:
ok 8 numbers
Test #21:
score: 0
Accepted
time: 10ms
memory: 10600kb
input:
0.58 0.49 6 31 96
output:
31.0 99.55761353841719 72.93341585228197 91.08461182814796 88.56644862794397 96.0
result:
ok 6 numbers
Test #22:
score: 0
Accepted
time: 15ms
memory: 10648kb
input:
0.61 0.29 8 62 25
output:
62.0 34.40765125713373 38.968667266851575 33.749105897348244 31.88786810476938 29.23884025414031 27.083174305408708 25.0
result:
ok 8 numbers
Test #23:
score: 0
Accepted
time: 6ms
memory: 10696kb
input:
0.63 0.89 9 37 85
output:
37.0 -5.887853302176888 29.22065241962856 13.168821585428564 34.302738252289416 33.33097630997376 51.52795211982105 62.12717875136391 85.0
result:
ok 9 numbers
Test #24:
score: 0
Accepted
time: 7ms
memory: 10576kb
input:
0.64 0.67 2 74 42
output:
74.0 42.0
result:
ok 2 numbers
Test #25:
score: 0
Accepted
time: 10ms
memory: 10636kb
input:
0.65 0.56 2 94 96
output:
94.0 96.0
result:
ok 2 numbers
Test #26:
score: 0
Accepted
time: 14ms
memory: 10576kb
input:
0.65 0.90 10 97 23
output:
97.0 -61.70357627911756 47.19267541857358 -24.85797962913298 26.315721117779784 -5.266962939662822 20.26062309522097 8.429138366197092 23.713500723726984 22.999999999999922
result:
ok 10 numbers
Test #27:
score: 0
Accepted
time: 15ms
memory: 10612kb
input:
0.67 0.88 4 70 42
output:
70.0 0.5478215065091387 61.967040409361125 42.0
result:
ok 4 numbers
Test #28:
score: 0
Accepted
time: 8ms
memory: 10696kb
input:
0.69 0.39 10 2 27
output:
2.0 22.365907687016133 16.212476304041132 19.909312647724676 20.060291485506067 21.60623305761181 22.731814489099513 24.11138288994727 25.502261844812423 27.000000000000007
result:
ok 10 numbers
Test #29:
score: 0
Accepted
time: 14ms
memory: 10620kb
input:
0.69 0.57 4 88 47
output:
88.0 11.843609597552819 58.33209062231144 46.99999999999999
result:
ok 4 numbers
Test #30:
score: 0
Accepted
time: 7ms
memory: 10584kb
input:
0.71 0.89 8 4 41
output:
4.0 6.838890362691074 8.415612157510662 12.061697054627626 16.053699728970102 22.13303718618736 30.002249160976415 41.0
result:
ok 8 numbers
Test #31:
score: 0
Accepted
time: 3ms
memory: 10640kb
input:
0.72 0.49 8 21 48
output:
21.0 19.94044236994031 24.647118506357025 27.51674208584781 31.889142369925366 36.44338612841169 41.864917773719846 48.000000000000014
result:
ok 8 numbers
Test #32:
score: 0
Accepted
time: 15ms
memory: 10608kb
input:
0.74 0.58 3 57 29
output:
57.0 -5.48648648648648 29.0
result:
ok 3 numbers
Test #33:
score: 0
Accepted
time: 8ms
memory: 10572kb
input:
0.76 0.70 2 91 18
output:
91.0 18.0
result:
ok 2 numbers
Test #34:
score: 0
Accepted
time: 15ms
memory: 10636kb
input:
0.77 0.36 10 31 25
output:
31.0 5.21497208502642 15.175528505470343 13.562546899821676 15.906351374832015 17.130407442556454 18.916700225707995 20.73280585311548 22.774272588153796 24.999999999999993
result:
ok 10 numbers
Test #35:
score: 0
Accepted
time: 15ms
memory: 10608kb
input:
0.77 0.96 8 78 68
output:
78.0 -40.09755700760498 44.00488110414416 -4.609896277109783 38.69506572660386 25.36970018345958 56.68193223880358 67.99999999999996
result:
ok 8 numbers
Test #36:
score: 0
Accepted
time: 15ms
memory: 10604kb
input:
0.78 0.52 7 73 77
output:
73.0 8.727547506052934 44.767487054721286 39.45696460583013 54.05552566100258 62.68093161061368 77.00000000000001
result:
ok 7 numbers
Test #37:
score: 0
Accepted
time: 10ms
memory: 10740kb
input:
0.78 0.69 4 42 97
output:
42.0 57.297905113986445 73.67236598890943 97.0
result:
ok 4 numbers
Test #38:
score: 0
Accepted
time: 15ms
memory: 10740kb
input:
0.78 0.70 10 54 99
output:
54.0 -13.01288635089969 27.64994864629824 12.457939498482842 29.07215686122538 31.396840000693786 44.84004500339892 56.953023103136815 75.81138952282596 99.00000000000001
result:
ok 10 numbers
Test #39:
score: 0
Accepted
time: 15ms
memory: 10696kb
input:
0.78 0.76 10 97 83
output:
97.0 -43.73473695904049 39.60690517194842 -2.345014054751001 28.27213696797502 20.270056153409755 37.29746789532062 44.4972676349415 63.05394435569805 83.00000000000003
result:
ok 10 numbers
Test #40:
score: 0
Accepted
time: 15ms
memory: 10648kb
input:
0.78 0.95 10 100 32
output:
100.0 -63.26957881736413 45.64972852245598 -24.49931162898025 24.25777902572858 -4.353278407462945 19.649332916621056 11.190865187874628 27.395741117332214 32.00000000000003
result:
ok 10 numbers
Test #41:
score: 0
Accepted
time: 15ms
memory: 10704kb
input:
0.79 0.90 10 98 42
output:
98.0 -58.24691462804137 42.18493744384732 -19.09612258459785 22.880506857630287 0.8890900913898605 21.294837344065247 17.62310258406242 33.087604651068034 41.99999999999993
result:
ok 10 numbers
Test #42:
score: 0
Accepted
time: 10ms
memory: 10612kb
input:
0.81 0.48 10 97 1
output:
97.0 -38.25750168159922 15.571423637904623 -5.75074766046488 2.8161777412176656 -0.4792549066368328 0.9635688414086447 0.5504484063553226 0.9083762530239607 0.9999999999999631
result:
ok 10 numbers
Test #43:
score: 0
Accepted
time: 15ms
memory: 10520kb
input:
0.81 0.86 10 20 100
output:
20.0 -3.3328428696514023 14.500397275582364 8.87907692532151 19.662393966511253 23.562545268650613 35.995320478806676 49.41999851887294 70.98617441206082 100.0
result:
ok 10 numbers
Test #44:
score: 0
Accepted
time: 5ms
memory: 10608kb
input:
0.84 0.85 10 74 95
output:
74.0 -36.290804877098296 32.415723903237435 -3.617976066814105 24.51426542162797 17.516703297375507 35.5511563781792 44.752169160439706 67.81030501622166 94.99999999999994
result:
ok 10 numbers
Test #45:
score: 0
Accepted
time: 15ms
memory: 10648kb
input:
0.88 0.37 10 3 96
output:
3.0 29.021828490376418 26.649209071531246 34.18938052438677 39.94686221792692 47.8033095457988 56.8472514209359 67.71280578236914 80.62075211423112 95.99999999999997
result:
ok 10 numbers
Test #46:
score: 0
Accepted
time: 8ms
memory: 10576kb
input:
0.91 0.50 10 100 98
output:
100.0 -22.58685785448443 29.44595935241917 15.50239408345923 28.830158292157485 33.98664108759293 45.342922535788304 58.25538005136382 75.68385711463523 97.99999999999997
result:
ok 10 numbers
Test #47:
score: 0
Accepted
time: 10ms
memory: 10608kb
input:
0.94 0.48 10 44 97
output:
44.0 -1.5827434387177977 19.632221167605266 17.694571046964406 26.056362944597065 32.98637527046415 43.51424696764289 56.7368522794071 74.21947968711126 96.99999999999999
result:
ok 10 numbers
Test #48:
score: 0
Accepted
time: 15ms
memory: 10604kb
input:
0.94 0.54 10 28 95
output:
28.0 0.4525463071458427 15.545393528717094 14.857044922852822 22.360134732988882 29.041330907350073 39.373323808723065 52.69324307016872 70.79324334266904 95.0
result:
ok 10 numbers
Test #49:
score: 0
Accepted
time: 8ms
memory: 10704kb
input:
0.95 0.57 10 2 94
output:
2.0 9.227284174161063 9.90591996545301 14.670175946452165 19.58304152943777 26.965889742443615 36.77992892710096 50.31148963393878 68.76047464068938 94.00000000000001
result:
ok 10 numbers
Test #50:
score: 0
Accepted
time: 16ms
memory: 10632kb
input:
0.98 0.90 10 21 99
output:
21.0 -8.213193484970178 10.851070384729228 3.242174840561483 12.943294690006558 15.602386152711762 26.93930365066343 40.44266511509075 63.87918509838602 98.99999999999997
result:
ok 10 numbers
Extra Test:
score: 0
Extra Test Passed