QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#563192#8795. Mysterious Sequencegg_gong_is_orzAC ✓15ms10788kbPython3725b2024-09-14 04:32:312024-09-14 04:32:31

Judging History

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

  • [2024-09-14 04:32:31]
  • 评测
  • 测评结果:AC
  • 用时:15ms
  • 内存:10788kb
  • [2024-09-14 04:32:31]
  • 提交

answer

# gg_gong is orz
# gg_gong is orz
# gg_gong is orz
# gg_gong is orz
# gg_gong is orz
# gg_gong is orz
# gg_gong is orz
# gg_gong is orz
# gg_gong is orz
# gg_gong is orz
# gg_gong is orz
# gg_gong is orz
# gg_gong is orz
# gg_gong is orz
# gg_gong is orz
# gg_gong is orz
# gg_gong is orz
# gg_gong is orz
[A, B, n, X1, Xn] = [float(sus) for sus in input().split()]
# t^2-At-B=0
# t=(A+-sqrt(A^2+4B))/2
# Xn=c1*t1^(n-1)+c2*t2^(n-1)
# X1=c1+c2
# X1*t2^(n-1)=c1*t2^(n-1)+c2*t2^(n-1)
# c1=(Xn-X1*t2^(n-1))/(t1^n-t2^(n-1))
# c2=X1-c1
t1 = (A-(A**2+4*B)**0.5)/2
t2 = (A+(A**2+4*B)**0.5)/2
c1 = (Xn-X1*t2**(n-1))/(t1**(n-1)-t2**(n-1))
c2 = X1-c1
for i in range(int(n)):
    print(c1*t1**i+c2*t2**i)

这程序好像有点Bug,我给组数据试试?

詳細信息

Test #1:

score: 100
Accepted
time: 7ms
memory: 10684kb

input:

1.0 1.0 10 1 10

output:

1.0
-0.3235294117647062
0.6764705882352939
0.3529411764705877
1.0294117647058818
1.3823529411764697
2.4117647058823515
3.794117647058821
6.205882352941173
9.999999999999996

result:

ok 10 numbers

Test #2:

score: 0
Accepted
time: 14ms
memory: 10624kb

input:

1 1 2 1 100

output:

1.0
100.0

result:

ok 2 numbers

Test #3:

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

input:

1 1 5 50 100

output:

50.0
3.552713678800501e-15
50.000000000000014
50.000000000000014
100.00000000000003

result:

ok 5 numbers

Test #4:

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

input:

0.25 0.25 10 1 1

output:

1.0
55.87553648068669
14.218884120171678
17.523605150214593
7.935622317596567
6.36480686695279
3.5751072961373396
2.484978540772532
1.515021459227468
1.0

result:

ok 10 numbers

Test #5:

score: 0
Accepted
time: 12ms
memory: 10740kb

input:

0.25 0.63 6 93 12

output:

93.0
-14.204807958665032
55.03879801033375
4.810670488624464
35.87711036866638
12.000000000000009

result:

ok 6 numbers

Test #6:

score: 0
Accepted
time: 8ms
memory: 10628kb

input:

0.25 0.80 10 5 63

output:

5.0
78.76953618353127
23.692384045882832
68.93872495829574
36.188588476280216
64.19812708570666
45.00040255245084
62.608602306678044
51.6524726186302
62.999999999999986

result:

ok 10 numbers

Test #7:

score: 0
Accepted
time: 14ms
memory: 10704kb

input:

0.25 0.99 3 18 30

output:

18.0
48.720000000000006
29.999999999999993

result:

ok 3 numbers

Test #8:

score: 0
Accepted
time: 12ms
memory: 10744kb

input:

0.28 0.64 9 6 10

output:

6.0
20.950403348507795
9.706112937582185
16.125969765568
10.727183814411639
13.32423211799878
10.596182634263108
11.494439693112891
9.999999999999998

result:

ok 9 numbers

Test #9:

score: 0
Accepted
time: 11ms
memory: 10636kb

input:

0.31 0.40 7 10 49

output:

10.0
240.11506399868813
78.43566983959334
120.3610832497492
68.6862037432596
69.43715646031015
48.99999999999999

result:

ok 7 numbers

Test #10:

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

input:

0.32 0.28 5 36 6

output:

36.0
10.121376811594189
13.318840579710143
7.09601449275362
6.0

result:

ok 5 numbers

Test #11:

score: 0
Accepted
time: 11ms
memory: 10632kb

input:

0.35 0.65 10 86 82

output:

86.0
79.53392478623083
83.73687367518079
81.00495689736331
82.78070280294467
81.62646796431679
82.37672060942492
81.88905639010464
82.20603813266283
82.0

result:

ok 10 numbers

Test #12:

score: 0
Accepted
time: 12ms
memory: 10612kb

input:

0.36 0.68 8 72 59

output:

72.0
38.23991864260571
62.72637071133805
48.58463813305358
60.14440181160917
54.68953858265573
60.586427121650296
59.0

result:

ok 8 numbers

Test #13:

score: 0
Accepted
time: 11ms
memory: 10632kb

input:

0.43 0.61 2 93 84

output:

93.0
84.0

result:

ok 2 numbers

Test #14:

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

input:

0.46 0.96 6 65 35

output:

65.0
-16.617423662818045
54.7559851151037
9.235026436642375
56.81385787135503
35.0

result:

ok 6 numbers

Test #15:

score: 0
Accepted
time: 14ms
memory: 10744kb

input:

0.50 0.90 4 19 1

output:

19.0
-6.565217391304343
13.81739130434783
1.0000000000000044

result:

ok 4 numbers

Test #16:

score: 0
Accepted
time: 5ms
memory: 10600kb

input:

0.54 0.35 3 16 22

output:

16.0
30.37037037037037
22.0

result:

ok 3 numbers

Test #17:

score: 0
Accepted
time: 9ms
memory: 10608kb

input:

0.55 0.89 10 74 13

output:

74.0
-48.32193707657652
39.282934607882936
-21.400909963817494
23.19131132091619
-6.29158864129367
17.179893322903887
3.8494274368457706
17.407290147649633
13.000000000000036

result:

ok 10 numbers

Test #18:

score: 0
Accepted
time: 11ms
memory: 10624kb

input:

0.56 0.36 3 31 88

output:

31.0
137.21428571428572
88.0

result:

ok 3 numbers

Test #19:

score: 0
Accepted
time: 13ms
memory: 10768kb

input:

0.57 0.93 7 71 48

output:

71.0
-34.080565361686055
46.60407774383897
-5.130601472379837
40.41734946251375
18.26642982431958
47.99999999999996

result:

ok 7 numbers

Test #20:

score: 0
Accepted
time: 14ms
memory: 10620kb

input:

0.58 0.41 8 30 69

output:

29.999999999999993
89.43212168280981
64.1706305760297
73.88613562404925
69.16391719812073
70.40838758077021
69.19407084807622
69.0

result:

ok 8 numbers

Test #21:

score: 0
Accepted
time: 14ms
memory: 10680kb

input:

0.58 0.49 6 31 96

output:

31.0
99.55761353841716
72.93341585228195
91.08461182814794
88.56644862794397
95.99999999999999

result:

ok 6 numbers

Test #22:

score: 0
Accepted
time: 5ms
memory: 10572kb

input:

0.61 0.29 8 62 25

output:

62.0
34.40765125713372
38.96866726685157
33.74910589734824
31.887868104769375
29.238840254140303
27.083174305408704
24.999999999999996

result:

ok 8 numbers

Test #23:

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

input:

0.63 0.89 9 37 85

output:

37.0
-5.887853302176882
29.22065241962856
13.16882158542857
34.302738252289416
33.330976309973764
51.52795211982106
62.12717875136392
85.0

result:

ok 9 numbers

Test #24:

score: 0
Accepted
time: 12ms
memory: 10568kb

input:

0.64 0.67 2 74 42

output:

74.0
42.00000000000001

result:

ok 2 numbers

Test #25:

score: 0
Accepted
time: 8ms
memory: 10772kb

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: 10604kb

input:

0.65 0.90 10 97 23

output:

97.0
-61.703576279117534
47.1926754185736
-24.85797962913295
26.315721117779823
-5.266962939662767
20.260623095221042
8.429138366197186
23.71350072372711
23.000000000000085

result:

ok 10 numbers

Test #27:

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

input:

0.67 0.88 4 70 42

output:

70.0
0.5478215065091341
61.96704040936112
42.0

result:

ok 4 numbers

Test #28:

score: 0
Accepted
time: 7ms
memory: 10704kb

input:

0.69 0.39 10 2 27

output:

2.0
22.365907687016147
16.212476304041136
19.90931264772468
20.06029148550607
21.60623305761181
22.731814489099513
24.111382889947265
25.502261844812423
27.0

result:

ok 10 numbers

Test #29:

score: 0
Accepted
time: 14ms
memory: 10640kb

input:

0.69 0.57 4 88 47

output:

88.0
11.843609597552831
58.33209062231144
47.0

result:

ok 4 numbers

Test #30:

score: 0
Accepted
time: 11ms
memory: 10664kb

input:

0.71 0.89 8 4 41

output:

4.0
6.838890362691077
8.415612157510663
12.061697054627627
16.053699728970106
22.13303718618736
30.002249160976422
41.00000000000001

result:

ok 8 numbers

Test #31:

score: 0
Accepted
time: 14ms
memory: 10628kb

input:

0.72 0.49 8 21 48

output:

21.0
19.9404423699403
24.647118506357014
27.516742085847795
31.88914236992535
36.443386128411674
41.86491777371983
47.99999999999999

result:

ok 8 numbers

Test #32:

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

input:

0.74 0.58 3 57 29

output:

57.0
-5.486486486486479
29.0

result:

ok 3 numbers

Test #33:

score: 0
Accepted
time: 13ms
memory: 10668kb

input:

0.76 0.70 2 91 18

output:

91.0
18.000000000000004

result:

ok 2 numbers

Test #34:

score: 0
Accepted
time: 14ms
memory: 10664kb

input:

0.77 0.36 10 31 25

output:

31.0
5.214972085026417
15.17552850547034
13.562546899821672
15.90635137483201
17.13040744255645
18.91670022570799
20.732805853115476
22.774272588153796
24.999999999999993

result:

ok 10 numbers

Test #35:

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

input:

0.77 0.96 8 78 68

output:

78.0
-40.09755700760496
44.00488110414419
-4.609896277109737
38.69506572660393
25.369700183459678
56.681932238803725
68.00000000000014

result:

ok 8 numbers

Test #36:

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

input:

0.78 0.52 7 73 77

output:

73.0
8.727547506052929
44.76748705472129
39.45696460583013
54.05552566100257
62.680931610613676
77.0

result:

ok 7 numbers

Test #37:

score: 0
Accepted
time: 9ms
memory: 10572kb

input:

0.78 0.69 4 42 97

output:

42.0
57.29790511398643
73.67236598890942
97.0

result:

ok 4 numbers

Test #38:

score: 0
Accepted
time: 14ms
memory: 10568kb

input:

0.78 0.70 10 54 99

output:

54.0
-13.012886350899693
27.649948646298235
12.457939498482842
29.072156861225377
31.396840000693782
44.84004500339892
56.95302310313681
75.81138952282595
99.00000000000001

result:

ok 10 numbers

Test #39:

score: 0
Accepted
time: 5ms
memory: 10704kb

input:

0.78 0.76 10 97 83

output:

97.0
-43.734736959040475
39.60690517194841
-2.345014054750999
28.27213696797501
20.270056153409744
37.2974678953206
44.497267634941466
63.053944355697986
82.99999999999994

result:

ok 10 numbers

Test #40:

score: 0
Accepted
time: 14ms
memory: 10604kb

input:

0.78 0.95 10 100 32

output:

100.0
-63.26957881736415
45.64972852245599
-24.499311628980273
24.257779025728585
-4.353278407462966
19.64933291662105
11.190865187874603
27.395741117332193
31.99999999999999

result:

ok 10 numbers

Test #41:

score: 0
Accepted
time: 13ms
memory: 10668kb

input:

0.79 0.90 10 98 42

output:

98.0
-58.24691462804137
42.18493744384732
-19.09612258459785
22.88050685763028
0.8890900913898587
21.29483734406524
17.623102584062412
33.08760465106802
41.999999999999915

result:

ok 10 numbers

Test #42:

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

input:

0.81 0.48 10 97 1

output:

97.0
-38.25750168159923
15.571423637904623
-5.750747660464883
2.8161777412176643
-0.4792549066368353
0.9635688414086422
0.5504484063553193
0.9083762530239571
0.9999999999999587

result:

ok 10 numbers

Test #43:

score: 0
Accepted
time: 5ms
memory: 10604kb

input:

0.81 0.86 10 20 100

output:

20.0
-3.3328428696513965
14.500397275582365
8.879076925321517
19.662393966511264
23.562545268650627
35.99532047880669
49.419998518872966
70.98617441206085
100.00000000000003

result:

ok 10 numbers

Test #44:

score: 0
Accepted
time: 13ms
memory: 10664kb

input:

0.84 0.85 10 74 95

output:

74.0
-36.29080487709829
32.41572390323744
-3.617976066814105
24.514265421627982
17.516703297375507
35.551156378179215
44.75216916043971
67.81030501622168
94.99999999999997

result:

ok 10 numbers

Test #45:

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

input:

0.88 0.37 10 3 96

output:

3.0
29.021828490376404
26.64920907153124
34.18938052438676
39.94686221792691
47.80330954579879
56.847251420935905
67.71280578236916
80.62075211423114
96.0

result:

ok 10 numbers

Test #46:

score: 0
Accepted
time: 14ms
memory: 10604kb

input:

0.91 0.50 10 100 98

output:

100.0
-22.58685785448442
29.445959352419166
15.502394083459233
28.830158292157478
33.98664108759292
45.34292253578829
58.2553800513638
75.68385711463519
97.99999999999991

result:

ok 10 numbers

Test #47:

score: 0
Accepted
time: 14ms
memory: 10788kb

input:

0.94 0.48 10 44 97

output:

44.0
-1.5827434387177775
19.632221167605284
17.694571046964427
26.0563629445971
32.986375270464194
43.51424696764294
56.73685227940717
74.21947968711132
97.00000000000007

result:

ok 10 numbers

Test #48:

score: 0
Accepted
time: 11ms
memory: 10768kb

input:

0.94 0.54 10 28 95

output:

28.0
0.45254630714582866
15.545393528717083
14.85704492285281
22.360134732988868
29.041330907350055
39.37332380872305
52.6932430701687
70.79324334266903
95.0

result:

ok 10 numbers

Test #49:

score: 0
Accepted
time: 5ms
memory: 10684kb

input:

0.95 0.57 10 2 94

output:

2.0
9.227284174161069
9.905919965453014
14.67017594645217
19.58304152943778
26.965889742443625
36.77992892710097
50.31148963393878
68.7604746406894
94.0

result:

ok 10 numbers

Test #50:

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

input:

0.98 0.90 10 21 99

output:

21.0
-8.213193484970166
10.851070384729232
3.2421748405615007
12.943294690006574
15.602386152711793
26.939303650663472
40.44266511509082
63.87918509838612
99.00000000000011

result:

ok 10 numbers

Extra Test:

score: 0
Extra Test Passed