QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#356458 | #4676. Amalgamated Artichokes | Sa3tElSefr# | AC ✓ | 327ms | 4348kb | C++14 | 1.5kb | 2024-03-17 20:04:35 | 2024-03-17 20:04:35 |
Judging History
answer
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
#include <array>
#include <climits>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
#include <array>
#include <climits>
#pragma GCC optimize("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx,avx2,fma")
#define ll long long
#define ld long double
using namespace std;
const int N = 1e4 + 5, lg = 19, mod = 998244353;
const int M = 5e2 + 5;
int main() {
int p, a, b, c, d, n;
cin >> p >> a >> b >> c >> d >> n;
ld ans = 0, max_num = - 1.0l / 0.0;
for (int i = 1; i <= n; ++i) {
ld cur = p * (sinl(a * i + b) + cosl(c * i + d) + 2);
ans = max(ans, max_num - cur);
max_num = max(max_num, cur);
}
cout << fixed << setprecision(6) << ans << '\n';
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 4132kb
input:
42 1 23 4 8 10
output:
104.855110
result:
ok found '104.8551100', expected '104.8551105', error '0.0000000'
Test #2:
score: 0
Accepted
time: 0ms
memory: 4072kb
input:
100 7 615 998 801 3
output:
0.000000
result:
ok found '0.0000000', expected '0.0000000', error '-0.0000000'
Test #3:
score: 0
Accepted
time: 1ms
memory: 4200kb
input:
100 432 406 867 60 1000
output:
399.303813
result:
ok found '399.3038130', expected '399.3038130', error '0.0000000'
Test #4:
score: 0
Accepted
time: 0ms
memory: 4228kb
input:
350 120 957 785 310 1
output:
0.000000
result:
ok found '0.0000000', expected '0.0000000', error '-0.0000000'
Test #5:
score: 0
Accepted
time: 327ms
memory: 4196kb
input:
350 0 957 0 310 1000000
output:
0.000000
result:
ok found '0.0000000', expected '0.0000000', error '-0.0000000'
Test #6:
score: 0
Accepted
time: 0ms
memory: 4348kb
input:
200 411 433 922 805 2
output:
665.522430
result:
ok found '665.5224300', expected '665.5224300', error '0.0000000'
Test #7:
score: 0
Accepted
time: 0ms
memory: 4044kb
input:
200 178 828 458 260 2
output:
0.000000
result:
ok found '0.0000000', expected '0.0000000', error '-0.0000000'
Test #8:
score: 0
Accepted
time: 315ms
memory: 4048kb
input:
1000 797 148 780 347 1000000
output:
3999.977117
result:
ok found '3999.9771170', expected '3999.9771170', error '0.0000000'
Test #9:
score: 0
Accepted
time: 316ms
memory: 4268kb
input:
1000 358 984 955 264 1000000
output:
3999.980182
result:
ok found '3999.9801820', expected '3999.9801820', error '0.0000000'
Test #10:
score: 0
Accepted
time: 319ms
memory: 4076kb
input:
1000 811 740 98 337 1000000
output:
3999.986003
result:
ok found '3999.9860030', expected '3999.9860030', error '0.0000000'
Test #11:
score: 0
Accepted
time: 324ms
memory: 4200kb
input:
1000 889 755 966 497 1000000
output:
3999.919039
result:
ok found '3999.9190390', expected '3999.9190390', error '0.0000000'
Test #12:
score: 0
Accepted
time: 317ms
memory: 4264kb
input:
1000 208 734 845 264 1000000
output:
3999.441508
result:
ok found '3999.4415080', expected '3999.4415080', error '0.0000000'
Test #13:
score: 0
Accepted
time: 318ms
memory: 3952kb
input:
1000 429 460 845 909 1000000
output:
3999.276771
result:
ok found '3999.2767710', expected '3999.2767710', error '0.0000000'
Test #14:
score: 0
Accepted
time: 311ms
memory: 4072kb
input:
1000 355 190 512 960 1000000
output:
3999.975060
result:
ok found '3999.9750600', expected '3999.9750600', error '0.0000000'
Test #15:
score: 0
Accepted
time: 312ms
memory: 4072kb
input:
1000 417 443 386 589 1000000
output:
3999.990725
result:
ok found '3999.9907250', expected '3999.9907250', error '0.0000000'
Test #16:
score: 0
Accepted
time: 10ms
memory: 4112kb
input:
100 710 178 710 189 40000
output:
370.128115
result:
ok found '370.1281150', expected '370.1281150', error '0.0000000'
Test #17:
score: 0
Accepted
time: 3ms
memory: 4180kb
input:
100 710 89 710 198 20000
output:
0.000000
result:
ok found '0.0000000', expected '0.0000000', error '-0.0000000'
Test #18:
score: 0
Accepted
time: 0ms
memory: 4196kb
input:
200 411 433 922 805 1
output:
0.000000
result:
ok found '0.0000000', expected '0.0000000', error '-0.0000000'
Test #19:
score: 0
Accepted
time: 35ms
memory: 4216kb
input:
72 90 242 453 236 104681
output:
287.991900
result:
ok found '287.9919000', expected '287.9919000', error '0.0000000'
Test #20:
score: 0
Accepted
time: 291ms
memory: 4080kb
input:
105 261 294 699 72 915601
output:
419.996283
result:
ok found '419.9962830', expected '419.9962830', error '0.0000000'
Test #21:
score: 0
Accepted
time: 274ms
memory: 4212kb
input:
127 955 277 297 997 862467
output:
507.998491
result:
ok found '507.9984910', expected '507.9984910', error '0.0000000'
Test #22:
score: 0
Accepted
time: 316ms
memory: 4196kb
input:
170 868 132 455 11 990921
output:
679.978100
result:
ok found '679.9781000', expected '679.9781000', error '0.0000000'
Test #23:
score: 0
Accepted
time: 268ms
memory: 3948kb
input:
183 83 47 406 493 836911
output:
731.995128
result:
ok found '731.9951280', expected '731.9951280', error '0.0000000'
Test #24:
score: 0
Accepted
time: 185ms
memory: 4176kb
input:
212 516 989 348 25 583181
output:
847.547420
result:
ok found '847.5474200', expected '847.5474200', error '0.0000000'
Test #25:
score: 0
Accepted
time: 308ms
memory: 4172kb
input:
229 734 14 604 812 953661
output:
915.994924
result:
ok found '915.9949240', expected '915.9949240', error '0.0000000'
Test #26:
score: 0
Accepted
time: 234ms
memory: 4172kb
input:
238 212 818 251 990 730696
output:
951.993526
result:
ok found '951.9935260', expected '951.9935260', error '0.0000000'
Test #27:
score: 0
Accepted
time: 48ms
memory: 4072kb
input:
265 643 912 153 217 148106
output:
1059.987868
result:
ok found '1059.9878680', expected '1059.9878680', error '0.0000000'
Test #28:
score: 0
Accepted
time: 174ms
memory: 4084kb
input:
278 858 827 104 700 531501
output:
1110.785431
result:
ok found '1110.7854310', expected '1110.7854310', error '0.0000000'
Test #29:
score: 0
Accepted
time: 223ms
memory: 4176kb
input:
307 291 768 46 232 684128
output:
1227.990887
result:
ok found '1227.9908870', expected '1227.9908870', error '0.0000000'
Test #30:
score: 0
Accepted
time: 15ms
memory: 4212kb
input:
320 772 682 998 714 43981
output:
1279.908033
result:
ok found '1279.9080330', expected '1279.9080330', error '0.0000000'
Test #31:
score: 0
Accepted
time: 314ms
memory: 4204kb
input:
333 987 597 950 196 969471
output:
1331.993928
result:
ok found '1331.9939280', expected '1331.9939280', error '0.0000000'
Test #32:
score: 0
Accepted
time: 34ms
memory: 4268kb
input:
666 2 192 2 394 100000
output:
828.801797
result:
ok found '828.8017970', expected '828.8017970', error '0.0000000'
Test #33:
score: 0
Accepted
time: 66ms
memory: 4172kb
input:
667 2 483 4 293 200000
output:
2264.754044
result:
ok found '2264.7540440', expected '2264.7540440', error '0.0000000'
Test #34:
score: 0
Accepted
time: 275ms
memory: 4220kb
input:
900 6 392 2 111 837842
output:
3530.588619
result:
ok found '3530.5886190', expected '3530.5886190', error '0.0000000'
Test #35:
score: 0
Accepted
time: 10ms
memory: 4044kb
input:
293 152 392 456 333 29321
output:
979.710899
result:
ok found '979.7108990', expected '979.7108990', error '0.0000000'
Test #36:
score: 0
Accepted
time: 111ms
memory: 4232kb
input:
392 456 222 152 222 348222
output:
1556.786855
result:
ok found '1556.7868550', expected '1556.7868550', error '0.0000000'