QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#435182 | #8795. Mysterious Sequence | ucup-team3215# | AC ✓ | 1ms | 4056kb | C++23 | 568b | 2024-06-08 19:13:58 | 2024-06-08 19:13:58 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0)->sync_with_stdio(0);
using fp = long double;
fp x, t, a, b;
int n;
cin >> a >> b >> n >> x >> t;
vector<array<fp, 2>> nums;
nums.push_back({0, x});
nums.push_back({1});
for (int i = 2; i < n; ++i) {
auto p = nums.end()[-1];
auto q = nums.end()[-2];
nums.push_back({p[0] * a + q[0] * b, p[1] * a + q[1] * b});
}
auto p = nums.back();
fp y = (t - p[1]) / p[0];
cout.precision(20);
for (auto& [a, b]: nums) cout << a * y + b << '\n';
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3756kb
input:
1.0 1.0 10 1 10
output:
1 -0.32352941176470588236 0.67647058823529411764 0.35294117647058823527 1.029411764705882353 1.3823529411764705881 2.4117647058823529411 3.7941176470588235292 6.2058823529411764703 10
result:
ok 10 numbers
Test #2:
score: 0
Accepted
time: 0ms
memory: 3820kb
input:
1 1 2 1 100
output:
1 100
result:
ok 2 numbers
Test #3:
score: 0
Accepted
time: 0ms
memory: 4048kb
input:
1 1 5 50 100
output:
50 0 50 50 100
result:
ok 5 numbers
Test #4:
score: 0
Accepted
time: 0ms
memory: 3816kb
input:
0.25 0.25 10 1 1
output:
1 55.875536480686695279 14.21888412017167382 17.523605150214592275 7.9356223175965665238 6.3648068669527896996 3.5751072961373390558 2.4849785407725321889 1.5150214592274678112 1
result:
ok 10 numbers
Test #5:
score: 0
Accepted
time: 0ms
memory: 3884kb
input:
0.25 0.63 6 93 12
output:
93 -14.204807958665044742 55.038798010333738815 4.8106704886244565159 35.877110368666369582 12
result:
ok 6 numbers
Test #6:
score: 0
Accepted
time: 0ms
memory: 3940kb
input:
0.25 0.80 10 5 63
output:
5 78.769536183531355437 23.692384045882838859 68.938724958295794068 36.188588476280219606 64.198127085706690152 45.000402552450848224 62.60860230667806418 51.652472618630194626 63.000000000000000003
result:
ok 10 numbers
Test #7:
score: 0
Accepted
time: 0ms
memory: 3820kb
input:
0.25 0.99 3 18 30
output:
18 48.720000000000000001 30
result:
ok 3 numbers
Test #8:
score: 0
Accepted
time: 0ms
memory: 3884kb
input:
0.28 0.64 9 6 10
output:
6 20.950403348507805112 9.7061129375821854313 16.125969765568007193 10.72718381441164069 13.324232117998783996 10.596182634263109561 11.494439693112892434 10
result:
ok 9 numbers
Test #9:
score: 0
Accepted
time: 0ms
memory: 3760kb
input:
0.31 0.40 7 10 49
output:
10 240.11506399868826393 78.435669839593361821 120.36108324974924774 68.686203743259611525 69.437156460310178664 49
result:
ok 7 numbers
Test #10:
score: 0
Accepted
time: 0ms
memory: 3884kb
input:
0.32 0.28 5 36 6
output:
36 10.121376811594202898 13.318840579710144927 7.0960144927536231881 6
result:
ok 5 numbers
Test #11:
score: 0
Accepted
time: 0ms
memory: 3816kb
input:
0.35 0.65 10 86 82
output:
86 79.533924786230832019 83.736873675180791207 81.004956897363317732 82.780702802944675492 81.626467964316792948 82.3767206094249166 81.889056390104636218 82.206038132662818466 82
result:
ok 10 numbers
Test #12:
score: 0
Accepted
time: 0ms
memory: 3760kb
input:
0.36 0.68 8 72 59
output:
72 38.239918642605698229 62.72637071133805136 48.584638133053573286 60.14440181160916131 54.689538582655727907 60.586427121650291736 59
result:
ok 8 numbers
Test #13:
score: 0
Accepted
time: 0ms
memory: 3760kb
input:
0.43 0.61 2 93 84
output:
93 84
result:
ok 2 numbers
Test #14:
score: 0
Accepted
time: 0ms
memory: 3760kb
input:
0.46 0.96 6 65 35
output:
65 -16.617423662818047687 54.755985115103698063 9.23502643664237533 56.813857871355042794 35
result:
ok 6 numbers
Test #15:
score: 0
Accepted
time: 0ms
memory: 3880kb
input:
0.50 0.90 4 19 1
output:
19 -6.5652173913043478264 13.817391304347826087 1
result:
ok 4 numbers
Test #16:
score: 0
Accepted
time: 0ms
memory: 3760kb
input:
0.54 0.35 3 16 22
output:
16 30.370370370370370369 22
result:
ok 3 numbers
Test #17:
score: 0
Accepted
time: 0ms
memory: 3824kb
input:
0.55 0.89 10 74 13
output:
74 -48.321937076576519085 39.282934607882914503 -21.400909963817499007 23.191311320916169453 -6.2915886412936809086 17.17989332290386631 3.8494274368457504637 17.407290147649603765 13
result:
ok 10 numbers
Test #18:
score: 0
Accepted
time: 0ms
memory: 3880kb
input:
0.56 0.36 3 31 88
output:
31 137.21428571428571427 88
result:
ok 3 numbers
Test #19:
score: 0
Accepted
time: 0ms
memory: 3880kb
input:
0.57 0.93 7 71 48
output:
71 -34.080565361686018078 46.604077743838969693 -5.1306014723797840893 40.417349462513764889 18.266429824319646773 48
result:
ok 7 numbers
Test #20:
score: 0
Accepted
time: 1ms
memory: 3884kb
input:
0.58 0.41 8 30 69
output:
30 89.432121682809812148 64.170630576029691047 73.886135624049243786 69.163917198120734721 70.408387580770216092 69.194070848076226564 69.000000000000000007
result:
ok 8 numbers
Test #21:
score: 0
Accepted
time: 0ms
memory: 4044kb
input:
0.58 0.49 6 31 96
output:
31 99.557613538417172448 72.933415852281960022 91.084611828147951318 88.566448627943972167 96
result:
ok 6 numbers
Test #22:
score: 0
Accepted
time: 0ms
memory: 3916kb
input:
0.61 0.29 8 62 25
output:
62 34.40765125713371532 38.968667266851566344 33.749105897348232914 31.887868104769376316 29.238840254140307099 27.083174305408706461 25
result:
ok 8 numbers
Test #23:
score: 0
Accepted
time: 1ms
memory: 4044kb
input:
0.63 0.89 9 37 85
output:
37 -5.8878533021768835122 29.220652419628563388 13.168821585428568609 34.30273825228941964 33.33097630997376043 51.527952119821052553 62.127178751363909888 85
result:
ok 9 numbers
Test #24:
score: 0
Accepted
time: 1ms
memory: 3944kb
input:
0.64 0.67 2 74 42
output:
74 42
result:
ok 2 numbers
Test #25:
score: 0
Accepted
time: 0ms
memory: 4056kb
input:
0.65 0.56 2 94 96
output:
94 96
result:
ok 2 numbers
Test #26:
score: 0
Accepted
time: 0ms
memory: 3764kb
input:
0.65 0.90 10 97 23
output:
97 -61.703576279117554274 47.192675418573589718 -24.857979629132965535 26.315721117779803148 -5.2669629396627969317 20.260623095221004825 8.4291383661971358843 23.713500723727042652 23
result:
ok 10 numbers
Test #27:
score: 0
Accepted
time: 0ms
memory: 4040kb
input:
0.67 0.88 4 70 42
output:
70 0.54782150650914290108 61.967040409361125744 42
result:
ok 4 numbers
Test #28:
score: 0
Accepted
time: 0ms
memory: 3816kb
input:
0.69 0.39 10 2 27
output:
2 22.36590768701612574 16.212476304041126761 19.909312647724666502 20.060291485506059323 21.606233057611800867 22.731814489099505736 24.111382889947261294 25.50226184481241753 27
result:
ok 10 numbers
Test #29:
score: 0
Accepted
time: 0ms
memory: 3820kb
input:
0.69 0.57 4 88 47
output:
88 11.84360959755281522 58.332090622311442502 47
result:
ok 4 numbers
Test #30:
score: 0
Accepted
time: 0ms
memory: 3884kb
input:
0.71 0.89 8 4 41
output:
4 6.8388903626910718253 8.4156121575106609956 12.061697054627623232 16.053699728970100781 22.133037186187356229 30.002249160976412617 41
result:
ok 8 numbers
Test #31:
score: 0
Accepted
time: 0ms
memory: 3756kb
input:
0.72 0.49 8 21 48
output:
21 19.94044236994030132 24.64711850635701695 27.516742085847799851 31.889142369925354198 36.443386128411676954 41.864917773719830967 48
result:
ok 8 numbers
Test #32:
score: 0
Accepted
time: 0ms
memory: 3816kb
input:
0.74 0.58 3 57 29
output:
57 -5.4864864864864864836 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
result:
ok 2 numbers
Test #34:
score: 0
Accepted
time: 0ms
memory: 3816kb
input:
0.77 0.36 10 31 25
output:
31 5.2149720850264223672 15.175528505470345223 13.562546899821677875 15.906351374832016244 17.130407442556456542 18.916700225707997387 20.732805853115482343 22.774272588153800463 25
result:
ok 10 numbers
Test #35:
score: 0
Accepted
time: 0ms
memory: 3792kb
input:
0.77 0.96 8 78 68
output:
78 -40.097557007604979293 44.00488110414416594 -4.609896277109772348 38.695065726603874598 25.369700183459601983 56.681932238803613117 68
result:
ok 8 numbers
Test #36:
score: 0
Accepted
time: 0ms
memory: 3940kb
input:
0.78 0.52 7 73 77
output:
73 8.7275475060529322932 44.767487054721287188 39.456964605830128798 54.055525661002569802 62.680931610613671415 77
result:
ok 7 numbers
Test #37:
score: 0
Accepted
time: 0ms
memory: 3816kb
input:
0.78 0.69 4 42 97
output:
42 57.297905113986444859 73.67236598890942699 97
result:
ok 4 numbers
Test #38:
score: 0
Accepted
time: 0ms
memory: 3880kb
input:
0.78 0.70 10 54 99
output:
54 -13.012886350899695974 27.649948646298237141 12.457939498482837788 29.072156861225379471 31.396840000693782434 44.840045003398915927 56.953023103136802132 75.811389522825946813 99
result:
ok 10 numbers
Test #39:
score: 0
Accepted
time: 0ms
memory: 3816kb
input:
0.78 0.76 10 97 83
output:
97 -43.734736959040487601 39.606905171948419673 -2.3450140547510032324 28.272136967975016429 20.270056153409750359 37.297467895320617765 44.49726763494149212 63.053944355698033339 83
result:
ok 10 numbers
Test #40:
score: 0
Accepted
time: 0ms
memory: 3812kb
input:
0.78 0.95 10 100 32
output:
100 -63.269578817364127813 45.649728522455980308 -24.499311628980256779 24.257779025728581003 -4.3532784074629507498 19.649332916621050332 11.190865187874616066 27.395741117332198411 32
result:
ok 10 numbers
Test #41:
score: 0
Accepted
time: 0ms
memory: 3916kb
input:
0.79 0.90 10 98 42
output:
98 -58.246914628041362081 42.184937443847323951 -19.096122584597839948 22.880506857630298005 0.88909009138987946108 21.294837344065272983 17.623102584062457165 33.087604651068086847 42
result:
ok 10 numbers
Test #42:
score: 0
Accepted
time: 0ms
memory: 3916kb
input:
0.81 0.48 10 97 1
output:
97 -38.257501681599215937 15.571423637904635089 -5.7507476604648692271 2.8161777412176807675 -0.47925490663681580977 0.96356884140866595756 0.55044840635534784262 0.90837625302399140764 1
result:
ok 10 numbers
Test #43:
score: 0
Accepted
time: 0ms
memory: 3880kb
input:
0.81 0.86 10 20 100
output:
20 -3.3328428696514015843 14.500397275582364717 8.8790769253215100585 19.662393966511256805 23.562545268650616661 35.995320478806680349 49.419998518872941411 70.986174412060827642 100
result:
ok 10 numbers
Test #44:
score: 0
Accepted
time: 0ms
memory: 3948kb
input:
0.84 0.85 10 74 95
output:
74 -36.290804877098289942 32.415723903237436451 -3.6179760668140998336 24.514265421627977129 17.516703297375515923 35.551156378179213938 44.752169160439728243 67.810305016221703589 95.000000000000000028
result:
ok 10 numbers
Test #45:
score: 0
Accepted
time: 0ms
memory: 3756kb
input:
0.88 0.37 10 3 96
output:
3 29.021828490376422992 26.649209071531252234 34.189380524386778472 39.94686221792692838 47.803309545798805012 56.847251420935911905 67.712805782369160333 80.620752114231148504 96
result:
ok 10 numbers
Test #46:
score: 0
Accepted
time: 0ms
memory: 3776kb
input:
0.91 0.50 10 100 98
output:
100 -22.586857854484423583 29.445959352419174539 15.502394083459237039 28.830158292157492973 33.986641087592937126 45.342922535788319275 58.255380051363839108 75.683857114635253241 98
result:
ok 10 numbers
Test #47:
score: 0
Accepted
time: 0ms
memory: 3832kb
input:
0.94 0.48 10 44 97
output:
44 -1.5827434387178068996 19.632221167605261513 17.69457104696439851 26.056362944597060125 32.986375270464147805 43.514246967642887798 56.736852279407105477 74.219479687111265288 97
result:
ok 10 numbers
Test #48:
score: 0
Accepted
time: 0ms
memory: 3884kb
input:
0.94 0.54 10 28 95
output:
28 0.45254630714584047972 15.545393528717090052 14.857044922852818507 22.360134732988878024 29.041330907350067338 39.37332380872305743 52.693243070168710347 70.793243342669038738 95
result:
ok 10 numbers
Test #49:
score: 0
Accepted
time: 0ms
memory: 3760kb
input:
0.95 0.57 10 2 94
output:
2 9.2272841741610597908 9.9059199654530068011 14.670175946452160541 19.58304152943776639 26.965889742443609579 36.779928927100955943 50.311489633938765605 68.760474640689372212 94
result:
ok 10 numbers
Test #50:
score: 0
Accepted
time: 0ms
memory: 3880kb
input:
0.98 0.90 10 21 99
output:
21 -8.2131934849701753523 10.851070384729228155 3.2421748405614857743 12.943294690006561397 15.602386152711767361 26.939303650663437274 40.442665115090759155 63.87918509838603752 99.000000000000000014
result:
ok 10 numbers
Extra Test:
score: 0
Extra Test Passed