QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#860054 | #9966. High Jump | mzmz001# | RE | 49ms | 19248kb | C++14 | 840b | 2025-01-18 09:52:24 | 2025-01-18 09:52:25 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
long long n,m,k,l,k4[1000007];
double eps=1e-8,ak[1000007],ab[1000007],ans,f[1000007],a[1000007],ss;
double gy(int z,int x){return ak[z]*x+ab[z];}
void X(int x,int y,int z,long long h){
if(!k4[z]){
k4[z]=h;
return;
}
int mid=(x+y)/2;
if(gy(h,mid)>gy(k4[z],mid))swap(h,k4[z]);
if(gy(h,x)>gy(k4[z],x))X(x,mid,z*2,h);
if(gy(h,y)>gy(k4[z],y))X(mid+1,y,z*2+1,h);
}
void Q(int x,int y,int z,int h){
if(!k4[z])return;
ans=max(ans,gy(k4[z],h));
if(x==y)return;
int mid=(x+y)/2;
if(x<=h&&h<=mid)Q(x,mid,z*2,h);
else Q(mid+1,y,z*2+1,h);
}
int main(){
cin>>n;
for(int i=1;i<=n;i++)scanf("%lf",&a[i]);
for(int i=n;i>=1;i--){
ans=0;Q(1,n,1,i);
f[i]=ans+i;
ak[i]=-a[i],ab[i]=a[i]*f[i];
X(1,n,1,i);
ss=max(ss,a[i]*f[i]);
}
printf("%.12lf",ss);
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 10064kb
input:
5 0.9 0.85 0.6 0.456000 0.000000017
output:
2.475200006589
result:
ok found '2.4752000', expected '2.4752000', error '0.0000000'
Test #2:
score: 0
Accepted
time: 0ms
memory: 10192kb
input:
1 0.000000001
output:
0.000000001000
result:
ok found '0.0000000', expected '0.0000000', error '-0.0000000'
Test #3:
score: 0
Accepted
time: 0ms
memory: 10192kb
input:
2 0.828496829 0.645649353
output:
1.363415270606
result:
ok found '1.3634153', expected '1.3634153', error '0.0000000'
Test #4:
score: 0
Accepted
time: 0ms
memory: 10188kb
input:
3 0.551197930 0.393255768 0.207104323
output:
0.867956505597
result:
ok found '0.8679565', expected '0.8679565', error '0.0000000'
Test #5:
score: 0
Accepted
time: 0ms
memory: 10192kb
input:
4 0.795361966 0.464795612 0.331129862 0.063526593
output:
1.338829040057
result:
ok found '1.3388290', expected '1.3388290', error '0.0000000'
Test #6:
score: 0
Accepted
time: 0ms
memory: 10196kb
input:
5 0.895888800 0.546833708 0.412641158 0.222811308 0.111288348
output:
1.726785711701
result:
ok found '1.7267857', expected '1.7267857', error '0.0000000'
Test #7:
score: 0
Accepted
time: 0ms
memory: 10028kb
input:
6 0.980827003 0.951772494 0.903718587 0.460647740 0.409951573 0.403255978
output:
3.825938315957
result:
ok found '3.8259383', expected '3.8259383', error '0.0000000'
Test #8:
score: 0
Accepted
time: 0ms
memory: 10064kb
input:
7 0.964710946 0.660694845 0.569051685 0.519424206 0.347976236 0.103554534 0.003582098
output:
2.660483845894
result:
ok found '2.6604838', expected '2.6604838', error '0.0000000'
Test #9:
score: 0
Accepted
time: 0ms
memory: 10192kb
input:
10 0.908256456 0.813576564 0.742549305 0.649326027 0.554646135 0.461422857 0.372638782 0.277958891 0.183440845 0.094656770
output:
3.465133268121
result:
ok found '3.4651333', expected '3.4651333', error '0.0000000'
Test #10:
score: 0
Accepted
time: 0ms
memory: 10136kb
input:
14 0.965125864 0.957983158 0.894060589 0.767619278 0.708280001 0.562719570 0.524554410 0.428166908 0.332545137 0.257543419 0.171522463 0.080323478 0.048170500 0.020758694
output:
4.986812883512
result:
ok found '4.9868129', expected '4.9868129', error '0.0000000'
Test #11:
score: 0
Accepted
time: 0ms
memory: 10064kb
input:
20 0.999312308 0.993123094 0.792022793 0.785833579 0.773356911 0.773356910 0.760880241 0.710678846 0.707633359 0.706159736 0.706159735 0.705865010 0.705177319 0.680125741 0.655074164 0.604872769 0.604185078 0.403084776 0.402397085 0.000098242
output:
11.722910896183
result:
ok found '11.7229109', expected '11.7229109', error '0.0000000'
Test #12:
score: 0
Accepted
time: 0ms
memory: 10192kb
input:
35 0.999999999 0.500000000 0.333333333 0.250000000 0.200000000 0.166666667 0.142857143 0.125000000 0.111111111 0.100000000 0.090909091 0.083333333 0.076923077 0.071428571 0.066666667 0.062500000 0.058823529 0.055555556 0.052631579 0.050000000 0.047619048 0.045454545 0.043478261 0.041666667 0.0400000...
output:
1.971428584084
result:
ok found '1.9714286', expected '1.9714286', error '0.0000000'
Test #13:
score: 0
Accepted
time: 0ms
memory: 10188kb
input:
42 0.999999997 0.999999957 0.999999558 0.999995984 0.999967570 0.999770574 0.998606056 0.992914780 0.970865633 0.906613334 0.772832688 0.578915971 0.379098588 0.222796093 0.121846038 0.063881487 0.032730211 0.016569178 0.008336477 0.004181321 0.002093945 0.001047795 0.000524103 0.000262103 0.0001310...
output:
11.074111636681
result:
ok found '11.0741116', expected '11.0741116', error '0.0000000'
Test #14:
score: 0
Accepted
time: 0ms
memory: 10060kb
input:
50 0.991131730 0.919779550 0.909523499 0.902541075 0.893803502 0.838347025 0.830500600 0.816318610 0.806306448 0.805684783 0.804210835 0.798232009 0.789231219 0.781205446 0.770460902 0.721836276 0.721271617 0.714886066 0.706142418 0.691410488 0.679542322 0.679399638 0.638774737 0.631666488 0.5962186...
output:
18.746675716668
result:
ok found '18.7466757', expected '18.7466757', error '0.0000000'
Test #15:
score: 0
Accepted
time: 1ms
memory: 10040kb
input:
75 0.720531716 0.718707013 0.709343553 0.694459021 0.689578156 0.682674306 0.679584797 0.678491929 0.670621566 0.666003031 0.665315768 0.659922689 0.659583167 0.658225062 0.658114386 0.653584609 0.649780198 0.639566830 0.636645846 0.630488992 0.628876218 0.628515225 0.615173462 0.613656515 0.6100964...
output:
21.997695508059
result:
ok found '21.9976955', expected '21.9976955', error '0.0000000'
Test #16:
score: 0
Accepted
time: 0ms
memory: 10068kb
input:
99 0.999999999 0.991828371 0.983639875 0.975434302 0.967211435 0.958971054 0.950712932 0.942436838 0.934142534 0.925829777 0.917498319 0.909147903 0.900778269 0.892389147 0.883980263 0.875551333 0.867102067 0.858632167 0.850141328 0.841629234 0.833095563 0.824539982 0.815962149 0.807361713 0.7987383...
output:
35.862420653994
result:
ok found '35.8624207', expected '35.8624207', error '0.0000000'
Test #17:
score: 0
Accepted
time: 0ms
memory: 10196kb
input:
150 0.999999999 0.999999998 0.999999997 0.999999996 0.999999995 0.999999994 0.999999993 0.999999992 0.999999991 0.99999999 0.999999989 0.999999988 0.999999987 0.999999986 0.999999985 0.999999984 0.999999983 0.999999982 0.999999981 0.99999998 0.999999979 0.999999978 0.999999977 0.999999976 0.99999997...
output:
63.222334038287
result:
ok found '63.2223340', expected '63.2223340', error '0.0000000'
Test #18:
score: 0
Accepted
time: 0ms
memory: 10064kb
input:
300 0.999999999 0.707106781 0.577350269 0.500000000 0.447213595 0.408248290 0.377964473 0.353553391 0.333333333 0.316227766 0.301511345 0.288675135 0.277350098 0.267261242 0.258198890 0.250000000 0.242535625 0.235702260 0.229415734 0.223606798 0.218217890 0.213200716 0.208514414 0.204124145 0.200000...
output:
18.262773054737
result:
ok found '18.2627731', expected '18.2627731', error '0.0000000'
Test #19:
score: 0
Accepted
time: 0ms
memory: 10200kb
input:
1000 0.999963957 0.999207697 0.999118706 0.997891974 0.994768087 0.990015892 0.989383451 0.987882675 0.987414725 0.986968311 0.986227809 0.985662929 0.985106306 0.983544346 0.982602847 0.981634680 0.980590743 0.978325691 0.977878867 0.977742455 0.974366243 0.972436723 0.972370267 0.972283135 0.97127...
output:
314.248999866927
result:
ok found '314.2489999', expected '314.2489999', error '0.0000000'
Test #20:
score: 0
Accepted
time: 1ms
memory: 10204kb
input:
1234 0.999999999 0.999999998 0.999999997 0.999999996 0.999999995 0.999999994 0.999999993 0.999999992 0.999999991 0.99999999 0.999999989 0.999999988 0.999999987 0.999999986 0.999999985 0.999999984 0.999999983 0.999999982 0.999999981 0.99999998 0.999999979 0.999999978 0.999999977 0.999999976 0.9999999...
output:
954.663514488509
result:
ok found '954.6635145', expected '954.6635145', error '0.0000000'
Test #21:
score: 0
Accepted
time: 1ms
memory: 12148kb
input:
3000 0.999479046 0.999467644 0.999384041 0.998543297 0.998530995 0.998473219 0.998371918 0.997799207 0.997737486 0.996491143 0.996240960 0.995286006 0.994641002 0.994623139 0.994477752 0.994465945 0.994343783 0.993985630 0.993841254 0.993633501 0.993625451 0.993495246 0.993371638 0.993313042 0.99251...
output:
934.613452337382
result:
ok found '934.6134523', expected '934.6134523', error '0.0000000'
Test #22:
score: 0
Accepted
time: 2ms
memory: 10112kb
input:
10000 0.999999999 0.999999998 0.999999997 0.999999996 0.999999995 0.999999994 0.999999993 0.999999992 0.999999991 0.999999990 0.999999989 0.999999988 0.999999987 0.999999986 0.999999985 0.999999984 0.999999983 0.999999982 0.999999981 0.999999980 0.999999979 0.999999978 0.954488188 0.876604603 0.8078...
output:
29.189038043790
result:
ok found '29.1890380', expected '29.1890380', error '0.0000000'
Test #23:
score: 0
Accepted
time: 4ms
memory: 10244kb
input:
23555 0.999818911 0.999779383 0.999771707 0.999753903 0.999742135 0.999733246 0.999717661 0.999712926 0.999652283 0.999647616 0.999638618 0.999560822 0.999556789 0.999499466 0.999489721 0.999475268 0.999454593 0.999447586 0.999438520 0.999435065 0.999417583 0.999402401 0.999400167 0.999400098 0.9993...
output:
7396.227922190848
result:
ok found '7396.2279222', expected '7396.2279222', error '0.0000000'
Test #24:
score: 0
Accepted
time: 5ms
memory: 10284kb
input:
33333 0.999998516 0.999989382 0.999956277 0.999903321 0.999893982 0.999885155 0.999833175 0.999817408 0.999814615 0.999766219 0.999763276 0.999699760 0.999670993 0.999640968 0.999610071 0.999573638 0.999566420 0.999482175 0.999434538 0.999420310 0.999389080 0.999376248 0.999369994 0.999368427 0.9993...
output:
10263.199349936343
result:
ok found '10263.1993499', expected '10263.1993499', error '0.0000000'
Test #25:
score: 0
Accepted
time: 18ms
memory: 13632kb
input:
90875 0.999999999 0.999999998 0.999999997 0.999999996 0.999999995 0.999999994 0.999999993 0.999999992 0.999999991 0.999999990 0.999999989 0.999999988 0.999999987 0.999999986 0.999999985 0.999999984 0.999999983 0.999999982 0.999999981 0.999999980 0.999999979 0.999999978 0.999999977 0.999999976 0.9999...
output:
89310.244826015114
result:
ok found '89310.2448260', expected '89310.2448260', error '0.0000000'
Test #26:
score: 0
Accepted
time: 18ms
memory: 12928kb
input:
100000 0.999988194 0.999982288 0.999970500 0.999958782 0.999946973 0.999935185 0.999929279 0.999917653 0.999907318 0.999901412 0.999889647 0.999889646 0.999878573 0.999866855 0.999860949 0.999849161 0.999849160 0.999837533 0.999837532 0.999825733 0.999814014 0.999808108 0.999797773 0.999785968 0.999...
output:
30691.812612741374
result:
ok found '30691.8126127', expected '30691.8126127', error '0.0000000'
Test #27:
score: 0
Accepted
time: 16ms
memory: 14372kb
input:
100000 0.999934487 0.999933478 0.999917111 0.999917094 0.999915061 0.999914948 0.999912915 0.999912914 0.999912673 0.999912560 0.999912063 0.999895696 0.999879329 0.999813816 0.999813799 0.999813750 0.999813509 0.999813396 0.999813155 0.999811123 0.999778374 0.999762007 0.999761894 0.999761845 0.999...
output:
30828.364979560927
result:
ok found '30828.3649796', expected '30828.3649796', error '0.0000000'
Test #28:
score: 0
Accepted
time: 49ms
memory: 19248kb
input:
190855 0.29900163 0.298982563 0.298963497 0.298944432 0.298925368 0.298906305 0.298887243 0.298868182 0.298849122 0.298830063 0.298811005 0.298791948 0.298772892 0.298753837 0.298734783 0.298715730 0.298696678 0.298677627 0.298658577 0.298639528 0.298620480 0.298601433 0.298582387 0.298563342 0.2985...
output:
1867.653493114023
result:
ok found '1867.6534931', expected '1867.6534931', error '0.0000000'
Test #29:
score: 0
Accepted
time: 33ms
memory: 17124kb
input:
200000 0.999984405 0.999984056 0.999974045 0.999973846 0.999970550 0.999966366 0.999960892 0.999959457 0.999957222 0.999956435 0.999955996 0.999955896 0.999951232 0.999947389 0.999942533 0.999939999 0.99993916 0.999931816 0.999928302 0.999926519 0.999925813 0.999924029 0.999921166 0.999917003 0.9999...
output:
61566.206649811931
result:
ok found '61566.2066498', expected '61566.2066498', error '0.0000000'
Test #30:
score: 0
Accepted
time: 35ms
memory: 18960kb
input:
233123 0.848660824 0.848659427 0.848647976 0.848640315 0.848637483 0.848637038 0.848633746 0.848633680 0.848633651 0.848632631 0.848630099 0.848629147 0.848628187 0.848627769 0.848623417 0.848623086 0.848622027 0.848620778 0.848619164 0.848618682 0.848617632 0.848616548 0.848614367 0.848612837 0.848...
output:
61860.941365398285
result:
ok found '61860.9413654', expected '61860.9413654', error '0.0000000'
Test #31:
score: -100
Runtime Error
input:
300000 0.999999999 0.999994667 0.999989333 0.999984000 0.999978667 0.999973333 0.999968000 0.999962667 0.999957334 0.999952000 0.999946667 0.999941334 0.999936001 0.999930667 0.999925334 0.999920001 0.999914668 0.999909335 0.999904001 0.999898668 0.999893335 0.999888002 0.999882669 0.999877336 0.999...