QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#563581#8795. Mysterious Sequencedonghanwen1225AC ✓1ms4016kbC++20530b2024-09-14 13:57:522024-09-14 13:57:54

Judging History

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

  • [2024-09-14 13:57:54]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:4016kb
  • [2024-09-14 13:57:52]
  • 提交

answer

#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
	double a,b;int n,x1,xn;
	cin>>a>>b;cin>>n>>x1>>xn;
	double l=-10000,r=10000;
	while(r-l>1e-12)
	{
		double mid=(l+r)/2;
		double c1=x1,c2=mid;
		for(int i=3;i<=n;i++)
		{
			double nc=c1*b+c2*a;
			c1=c2;c2=nc;
		}
		if(c2<xn) l=mid;
		else r=mid;
	}
	printf("%d\n%.12lf\n",x1,r);
	double c1=x1,c2=r;
	for(int i=3;i<n;i++)
	{
		double nc=c1*b+c2*a;
		c1=c2;c2=nc;printf("%.12lf\n",nc);
	}
	if(n>=3) printf("%d\n",xn);
	return 0;
}

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3956kb

input:

1.0 1.0 10 1 10

output:

1
-0.323529411764
0.676470588236
0.352941176471
1.029411764707
1.382352941179
2.411764705886
3.794117647064
6.205882352950
10

result:

ok 10 numbers

Test #2:

score: 0
Accepted
time: 0ms
memory: 4008kb

input:

1 1 2 1 100

output:

1
100.000000000000

result:

ok 2 numbers

Test #3:

score: 0
Accepted
time: 0ms
memory: 3984kb

input:

1 1 5 50 100

output:

50
0.000000000000
50.000000000000
50.000000000000
100

result:

ok 5 numbers

Test #4:

score: 0
Accepted
time: 0ms
memory: 3948kb

input:

0.25 0.25 10 1 1

output:

1
55.875536480687
14.218884120172
17.523605150215
7.935622317597
6.364806866953
3.575107296137
2.484978540773
1.515021459227
1

result:

ok 10 numbers

Test #5:

score: 0
Accepted
time: 0ms
memory: 4008kb

input:

0.25 0.63 6 93 12

output:

93
-14.204807958665
55.038798010334
4.810670488625
35.877110368666
12

result:

ok 6 numbers

Test #6:

score: 0
Accepted
time: 0ms
memory: 4012kb

input:

0.25 0.80 10 5 63

output:

5
78.769536183532
23.692384045883
68.938724958296
36.188588476280
64.198127085707
45.000402552451
62.608602306678
51.652472618630
63

result:

ok 10 numbers

Test #7:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

0.25 0.99 3 18 30

output:

18
48.720000000000
30

result:

ok 3 numbers

Test #8:

score: 0
Accepted
time: 0ms
memory: 3988kb

input:

0.28 0.64 9 6 10

output:

6
20.950403348508
9.706112937582
16.125969765568
10.727183814412
13.324232117999
10.596182634263
11.494439693113
10

result:

ok 9 numbers

Test #9:

score: 0
Accepted
time: 0ms
memory: 3944kb

input:

0.31 0.40 7 10 49

output:

10
240.115063998689
78.435669839594
120.361083249749
68.686203743260
69.437156460310
49

result:

ok 7 numbers

Test #10:

score: 0
Accepted
time: 0ms
memory: 4008kb

input:

0.32 0.28 5 36 6

output:

36
10.121376811594
13.318840579710
7.096014492754
6

result:

ok 5 numbers

Test #11:

score: 0
Accepted
time: 0ms
memory: 4012kb

input:

0.35 0.65 10 86 82

output:

86
79.533924786231
83.736873675181
81.004956897363
82.780702802945
81.626467964317
82.376720609425
81.889056390105
82.206038132663
82

result:

ok 10 numbers

Test #12:

score: 0
Accepted
time: 0ms
memory: 4012kb

input:

0.36 0.68 8 72 59

output:

72
38.239918642606
62.726370711338
48.584638133054
60.144401811609
54.689538582656
60.586427121650
59

result:

ok 8 numbers

Test #13:

score: 0
Accepted
time: 0ms
memory: 3988kb

input:

0.43 0.61 2 93 84

output:

93
84.000000000000

result:

ok 2 numbers

Test #14:

score: 0
Accepted
time: 0ms
memory: 3832kb

input:

0.46 0.96 6 65 35

output:

65
-16.617423662818
54.755985115104
9.235026436642
56.813857871355
35

result:

ok 6 numbers

Test #15:

score: 0
Accepted
time: 0ms
memory: 3940kb

input:

0.50 0.90 4 19 1

output:

19
-6.565217391304
13.817391304348
1

result:

ok 4 numbers

Test #16:

score: 0
Accepted
time: 0ms
memory: 3832kb

input:

0.54 0.35 3 16 22

output:

16
30.370370370371
22

result:

ok 3 numbers

Test #17:

score: 0
Accepted
time: 0ms
memory: 3952kb

input:

0.55 0.89 10 74 13

output:

74
-48.321937076576
39.282934607883
-21.400909963817
23.191311320916
-6.291588641293
17.179893322904
3.849427436846
17.407290147650
13

result:

ok 10 numbers

Test #18:

score: 0
Accepted
time: 0ms
memory: 3944kb

input:

0.56 0.36 3 31 88

output:

31
137.214285714286
88

result:

ok 3 numbers

Test #19:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

0.57 0.93 7 71 48

output:

71
-34.080565361685
46.604077743839
-5.130601472379
40.417349462514
18.266429824321
48

result:

ok 7 numbers

Test #20:

score: 0
Accepted
time: 0ms
memory: 3972kb

input:

0.58 0.41 8 30 69

output:

30
89.432121682810
64.170630576030
73.886135624050
69.163917198121
70.408387580771
69.194070848077
69

result:

ok 8 numbers

Test #21:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

0.58 0.49 6 31 96

output:

31
99.557613538417
72.933415852282
91.084611828148
88.566448627944
96

result:

ok 6 numbers

Test #22:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

0.61 0.29 8 62 25

output:

62
34.407651257134
38.968667266852
33.749105897348
31.887868104770
29.238840254140
27.083174305409
25

result:

ok 8 numbers

Test #23:

score: 0
Accepted
time: 0ms
memory: 3752kb

input:

0.63 0.89 9 37 85

output:

37
-5.887853302177
29.220652419629
13.168821585429
34.302738252290
33.330976309974
51.527952119822
62.127178751365
85

result:

ok 9 numbers

Test #24:

score: 0
Accepted
time: 0ms
memory: 3940kb

input:

0.64 0.67 2 74 42

output:

74
42.000000000000

result:

ok 2 numbers

Test #25:

score: 0
Accepted
time: 0ms
memory: 3944kb

input:

0.65 0.56 2 94 96

output:

94
96.000000000001

result:

ok 2 numbers

Test #26:

score: 0
Accepted
time: 0ms
memory: 3940kb

input:

0.65 0.90 10 97 23

output:

97
-61.703576279117
47.192675418574
-24.857979629133
26.315721117780
-5.266962939662
20.260623095221
8.429138366198
23.713500723728
23

result:

ok 10 numbers

Test #27:

score: 0
Accepted
time: 0ms
memory: 4008kb

input:

0.67 0.88 4 70 42

output:

70
0.547821506510
61.967040409361
42

result:

ok 4 numbers

Test #28:

score: 0
Accepted
time: 0ms
memory: 4016kb

input:

0.69 0.39 10 2 27

output:

2
22.365907687016
16.212476304041
19.909312647725
20.060291485506
21.606233057612
22.731814489100
24.111382889948
25.502261844813
27

result:

ok 10 numbers

Test #29:

score: 0
Accepted
time: 0ms
memory: 3884kb

input:

0.69 0.57 4 88 47

output:

88
11.843609597553
58.332090622312
47

result:

ok 4 numbers

Test #30:

score: 0
Accepted
time: 0ms
memory: 3820kb

input:

0.71 0.89 8 4 41

output:

4
6.838890362691
8.415612157511
12.061697054628
16.053699728971
22.133037186188
30.002249160978
41

result:

ok 8 numbers

Test #31:

score: 0
Accepted
time: 0ms
memory: 3944kb

input:

0.72 0.49 8 21 48

output:

21
19.940442369941
24.647118506357
27.516742085848
31.889142369926
36.443386128412
41.864917773720
48

result:

ok 8 numbers

Test #32:

score: 0
Accepted
time: 0ms
memory: 3836kb

input:

0.74 0.58 3 57 29

output:

57
-5.486486486486
29

result:

ok 3 numbers

Test #33:

score: 0
Accepted
time: 0ms
memory: 3816kb

input:

0.76 0.70 2 91 18

output:

91
18.000000000000

result:

ok 2 numbers

Test #34:

score: 0
Accepted
time: 0ms
memory: 3952kb

input:

0.77 0.36 10 31 25

output:

31
5.214972085027
15.175528505471
13.562546899822
15.906351374833
17.130407442557
18.916700225709
20.732805853116
22.774272588155
25

result:

ok 10 numbers

Test #35:

score: 0
Accepted
time: 0ms
memory: 3984kb

input:

0.77 0.96 8 78 68

output:

78
-40.097557007605
44.004881104145
-4.609896277109
38.695065726605
25.369700183461
56.681932238805
68

result:

ok 8 numbers

Test #36:

score: 0
Accepted
time: 0ms
memory: 3808kb

input:

0.78 0.52 7 73 77

output:

73
8.727547506053
44.767487054722
39.456964605831
54.055525661003
62.680931610614
77

result:

ok 7 numbers

Test #37:

score: 0
Accepted
time: 0ms
memory: 3884kb

input:

0.78 0.69 4 42 97

output:

42
57.297905113987
73.672365988910
97

result:

ok 4 numbers

Test #38:

score: 0
Accepted
time: 0ms
memory: 3832kb

input:

0.78 0.70 10 54 99

output:

54
-13.012886350899
27.649948646298
12.457939498483
29.072156861226
31.396840000694
44.840045003400
56.953023103138
75.811389522828
99

result:

ok 10 numbers

Test #39:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

0.78 0.76 10 97 83

output:

97
-43.734736959040
39.606905171949
-2.345014054751
28.272136967976
20.270056153410
37.297467895322
44.497267634943
63.053944355700
83

result:

ok 10 numbers

Test #40:

score: 0
Accepted
time: 0ms
memory: 3832kb

input:

0.78 0.95 10 100 32

output:

100
-63.269578817364
45.649728522456
-24.499311628980
24.257779025729
-4.353278407462
19.649332916623
11.190865187877
27.395741117336
32

result:

ok 10 numbers

Test #41:

score: 0
Accepted
time: 0ms
memory: 3952kb

input:

0.79 0.90 10 98 42

output:

98
-58.246914628041
42.184937443847
-19.096122584598
22.880506857631
0.889090091390
21.294837344066
17.623102584063
33.087604651069
42

result:

ok 10 numbers

Test #42:

score: 0
Accepted
time: 0ms
memory: 3832kb

input:

0.81 0.48 10 97 1

output:

97
-38.257501681599
15.571423637905
-5.750747660465
2.816177741218
-0.479254906636
0.963568841409
0.550448406356
0.908376253025
1

result:

ok 10 numbers

Test #43:

score: 0
Accepted
time: 0ms
memory: 3948kb

input:

0.81 0.86 10 20 100

output:

20
-3.332842869651
14.500397275583
8.879076925322
19.662393966512
23.562545268652
35.995320478808
49.419998518875
70.986174412063
100

result:

ok 10 numbers

Test #44:

score: 0
Accepted
time: 0ms
memory: 3832kb

input:

0.84 0.85 10 74 95

output:

74
-36.290804877098
32.415723903237
-3.617976066814
24.514265421628
17.516703297376
35.551156378179
44.752169160440
67.810305016222
95

result:

ok 10 numbers

Test #45:

score: 0
Accepted
time: 0ms
memory: 3992kb

input:

0.88 0.37 10 3 96

output:

3
29.021828490376
26.649209071531
34.189380524387
39.946862217927
47.803309545799
56.847251420936
67.712805782369
80.620752114231
96

result:

ok 10 numbers

Test #46:

score: 0
Accepted
time: 0ms
memory: 3884kb

input:

0.91 0.50 10 100 98

output:

100
-22.586857854484
29.445959352419
15.502394083460
28.830158292158
33.986641087594
45.342922535789
58.255380051365
75.683857114637
98

result:

ok 10 numbers

Test #47:

score: 0
Accepted
time: 0ms
memory: 3816kb

input:

0.94 0.48 10 44 97

output:

44
-1.582743438718
19.632221167605
17.694571046964
26.056362944597
32.986375270464
43.514246967643
56.736852279407
74.219479687111
97

result:

ok 10 numbers

Test #48:

score: 0
Accepted
time: 1ms
memory: 3828kb

input:

0.94 0.54 10 28 95

output:

28
0.452546307146
15.545393528717
14.857044922853
22.360134732989
29.041330907350
39.373323808723
52.693243070169
70.793243342669
95

result:

ok 10 numbers

Test #49:

score: 0
Accepted
time: 0ms
memory: 3952kb

input:

0.95 0.57 10 2 94

output:

2
9.227284174161
9.905919965453
14.670175946453
19.583041529438
26.965889742445
36.779928927102
50.311489633941
68.760474640692
94

result:

ok 10 numbers

Test #50:

score: 0
Accepted
time: 0ms
memory: 4016kb

input:

0.98 0.90 10 21 99

output:

21
-8.213193484970
10.851070384729
3.242174840562
12.943294690007
15.602386152713
26.939303650665
40.442665115093
63.879185098390
99

result:

ok 10 numbers

Extra Test:

score: 0
Extra Test Passed