QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#100744 | #4676. Amalgamated Artichokes | fzj2007 | AC ✓ | 141ms | 4096kb | C++14 | 1.4kb | 2023-04-27 21:13:59 | 2023-04-27 21:14:57 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
namespace IO{
template<typename T>inline bool read(T &x){
x=0;
char ch=getchar();
bool flag=0,ret=0;
while(ch<'0'||ch>'9') flag=flag||(ch=='-'),ch=getchar();
while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar(),ret=1;
x=flag?-x:x;
return ret;
}
template<typename T,typename ...Args>inline bool read(T& a,Args& ...args){
return read(a)&&read(args...);
}
template<typename T>void prt(T x){
if(x>9) prt(x/10);
putchar(x%10+'0');
}
template<typename T>inline void put(T x){
if(x<0) putchar('-'),x=-x;
prt(x);
}
template<typename T>inline void put(char ch,T x){
if(x<0) putchar('-'),x=-x;
prt(x);
putchar(ch);
}
template<typename T,typename ...Args>inline void put(T a,Args ...args){
put(a);
put(args...);
}
template<typename T,typename ...Args>inline void put(const char ch,T a,Args ...args){
put(ch,a);
put(ch,args...);
}
inline void put(string s){
for(int i=0,sz=s.length();i<sz;i++) putchar(s[i]);
}
inline void put(const char* s){
for(int i=0,sz=strlen(s);i<sz;i++) putchar(s[i]);
}
}
using namespace IO;
int p,a,b,c,d,n;
long double maxn,ans;
int main(){
read(p,a,b,c,d,n);
for(int i=1;i<=n;i++){
long double x=(long double)p*(sin(a*i+b)+cos(c*i+d)+2);
ans=max(ans,maxn-x),maxn=max(maxn,x);
}
printf("%.10Lf\n",ans);
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 2ms
memory: 3860kb
input:
42 1 23 4 8 10
output:
104.8551104774
result:
ok found '104.8551105', expected '104.8551105', error '0.0000000'
Test #2:
score: 0
Accepted
time: 2ms
memory: 3840kb
input:
100 7 615 998 801 3
output:
0.0000000000
result:
ok found '0.0000000', expected '0.0000000', error '-0.0000000'
Test #3:
score: 0
Accepted
time: 2ms
memory: 3840kb
input:
100 432 406 867 60 1000
output:
399.3038125921
result:
ok found '399.3038126', expected '399.3038130', error '0.0000000'
Test #4:
score: 0
Accepted
time: 2ms
memory: 3880kb
input:
350 120 957 785 310 1
output:
0.0000000000
result:
ok found '0.0000000', expected '0.0000000', error '-0.0000000'
Test #5:
score: 0
Accepted
time: 33ms
memory: 3948kb
input:
350 0 957 0 310 1000000
output:
0.0000000000
result:
ok found '0.0000000', expected '0.0000000', error '-0.0000000'
Test #6:
score: 0
Accepted
time: 2ms
memory: 3884kb
input:
200 411 433 922 805 2
output:
665.5224303616
result:
ok found '665.5224304', expected '665.5224300', error '0.0000000'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3912kb
input:
200 178 828 458 260 2
output:
0.0000000000
result:
ok found '0.0000000', expected '0.0000000', error '-0.0000000'
Test #8:
score: 0
Accepted
time: 141ms
memory: 3920kb
input:
1000 797 148 780 347 1000000
output:
3999.9771169899
result:
ok found '3999.9771170', expected '3999.9771170', error '0.0000000'
Test #9:
score: 0
Accepted
time: 129ms
memory: 4076kb
input:
1000 358 984 955 264 1000000
output:
3999.9801820613
result:
ok found '3999.9801821', expected '3999.9801820', error '0.0000000'
Test #10:
score: 0
Accepted
time: 88ms
memory: 3964kb
input:
1000 811 740 98 337 1000000
output:
3999.9860034043
result:
ok found '3999.9860034', expected '3999.9860030', error '0.0000000'
Test #11:
score: 0
Accepted
time: 140ms
memory: 3952kb
input:
1000 889 755 966 497 1000000
output:
3999.9190387244
result:
ok found '3999.9190387', expected '3999.9190390', error '0.0000000'
Test #12:
score: 0
Accepted
time: 115ms
memory: 3824kb
input:
1000 208 734 845 264 1000000
output:
3999.4415083045
result:
ok found '3999.4415083', expected '3999.4415080', error '0.0000000'
Test #13:
score: 0
Accepted
time: 131ms
memory: 3904kb
input:
1000 429 460 845 909 1000000
output:
3999.2767710973
result:
ok found '3999.2767711', expected '3999.2767710', error '0.0000000'
Test #14:
score: 0
Accepted
time: 109ms
memory: 3796kb
input:
1000 355 190 512 960 1000000
output:
3999.9750604044
result:
ok found '3999.9750604', expected '3999.9750600', error '0.0000000'
Test #15:
score: 0
Accepted
time: 117ms
memory: 3808kb
input:
1000 417 443 386 589 1000000
output:
3999.9907254047
result:
ok found '3999.9907254', expected '3999.9907250', error '0.0000000'
Test #16:
score: 0
Accepted
time: 3ms
memory: 3916kb
input:
100 710 178 710 189 40000
output:
370.1281153974
result:
ok found '370.1281154', expected '370.1281150', error '0.0000000'
Test #17:
score: 0
Accepted
time: 3ms
memory: 3892kb
input:
100 710 89 710 198 20000
output:
0.0000000000
result:
ok found '0.0000000', expected '0.0000000', error '-0.0000000'
Test #18:
score: 0
Accepted
time: 2ms
memory: 3908kb
input:
200 411 433 922 805 1
output:
0.0000000000
result:
ok found '0.0000000', expected '0.0000000', error '-0.0000000'
Test #19:
score: 0
Accepted
time: 5ms
memory: 3908kb
input:
72 90 242 453 236 104681
output:
287.9919002594
result:
ok found '287.9919003', expected '287.9919000', error '0.0000000'
Test #20:
score: 0
Accepted
time: 106ms
memory: 4020kb
input:
105 261 294 699 72 915601
output:
419.9962834360
result:
ok found '419.9962834', expected '419.9962830', error '0.0000000'
Test #21:
score: 0
Accepted
time: 103ms
memory: 3948kb
input:
127 955 277 297 997 862467
output:
507.9984909392
result:
ok found '507.9984909', expected '507.9984910', error '0.0000000'
Test #22:
score: 0
Accepted
time: 135ms
memory: 4016kb
input:
170 868 132 455 11 990921
output:
679.9781000207
result:
ok found '679.9781000', expected '679.9781000', error '0.0000000'
Test #23:
score: 0
Accepted
time: 64ms
memory: 4068kb
input:
183 83 47 406 493 836911
output:
731.9951284754
result:
ok found '731.9951285', expected '731.9951280', error '0.0000000'
Test #24:
score: 0
Accepted
time: 55ms
memory: 3976kb
input:
212 516 989 348 25 583181
output:
847.5474203242
result:
ok found '847.5474203', expected '847.5474200', error '0.0000000'
Test #25:
score: 0
Accepted
time: 129ms
memory: 3904kb
input:
229 734 14 604 812 953661
output:
915.9949236507
result:
ok found '915.9949237', expected '915.9949240', error '0.0000000'
Test #26:
score: 0
Accepted
time: 57ms
memory: 3904kb
input:
238 212 818 251 990 730696
output:
951.9935257733
result:
ok found '951.9935258', expected '951.9935260', error '0.0000000'
Test #27:
score: 0
Accepted
time: 4ms
memory: 3836kb
input:
265 643 912 153 217 148106
output:
1059.9878680892
result:
ok found '1059.9878681', expected '1059.9878680', error '0.0000000'
Test #28:
score: 0
Accepted
time: 43ms
memory: 3924kb
input:
278 858 827 104 700 531501
output:
1110.7854313480
result:
ok found '1110.7854313', expected '1110.7854310', error '0.0000000'
Test #29:
score: 0
Accepted
time: 40ms
memory: 3952kb
input:
307 291 768 46 232 684128
output:
1227.9908867217
result:
ok found '1227.9908867', expected '1227.9908870', error '0.0000000'
Test #30:
score: 0
Accepted
time: 3ms
memory: 3912kb
input:
320 772 682 998 714 43981
output:
1279.9080332964
result:
ok found '1279.9080333', expected '1279.9080330', error '0.0000000'
Test #31:
score: 0
Accepted
time: 137ms
memory: 4096kb
input:
333 987 597 950 196 969471
output:
1331.9939279259
result:
ok found '1331.9939279', expected '1331.9939280', error '0.0000000'
Test #32:
score: 0
Accepted
time: 5ms
memory: 3900kb
input:
666 2 192 2 394 100000
output:
828.8017969649
result:
ok found '828.8017970', expected '828.8017970', error '0.0000000'
Test #33:
score: 0
Accepted
time: 8ms
memory: 3956kb
input:
667 2 483 4 293 200000
output:
2264.7540438128
result:
ok found '2264.7540438', expected '2264.7540440', error '0.0000000'
Test #34:
score: 0
Accepted
time: 28ms
memory: 4032kb
input:
900 6 392 2 111 837842
output:
3530.5886191190
result:
ok found '3530.5886191', expected '3530.5886190', error '0.0000000'
Test #35:
score: 0
Accepted
time: 2ms
memory: 3956kb
input:
293 152 392 456 333 29321
output:
979.7108993743
result:
ok found '979.7108994', expected '979.7108990', error '0.0000000'
Test #36:
score: 0
Accepted
time: 19ms
memory: 3816kb
input:
392 456 222 152 222 348222
output:
1556.7868548056
result:
ok found '1556.7868548', expected '1556.7868550', error '0.0000000'