QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#473502#4676. Amalgamated ArtichokesGeothermalAC ✓131ms20092kbC++201.1kb2024-07-12 07:03:172024-07-12 07:03:18

Judging History

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

  • [2024-07-12 07:03:18]
  • 评测
  • 测评结果:AC
  • 用时:131ms
  • 内存:20092kb
  • [2024-07-12 07:03:17]
  • 提交

answer

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ld, ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;

#define FOR(i, a, b) for (int i = a; i < (b); i++)
#define F0R(i, a) for (int i = 0; i < (a); i++)
#define FORd(i, a, b) for (int i = (b) - 1; i >= (a); i--)
#define F0Rd(i, a) for (int i = (a) - 1; i >= 0; i--)
#define trav(a, x) for (auto &a : x)
#define sz(x) (int)(x).size()
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert

const char nl = '\n';

void solve() {
    int P, A, B, C, D, N; cin >> P >> A >> B >> C >> D >> N;
    ld X[N], cap = -1e9, ans = 0;
    F0R(i, N) {
        X[i] = P * (sin(A*(i+1)+B)+cos(C*(i+1)+D)+2);
        cap = max(cap, X[i]);
        ans = max(ans, cap-X[i]);
    }
    cout << fixed << setprecision(20) << ans << nl;
}

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);
	solve();
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

42 1 23 4 8 10

output:

104.85511047739417733737

result:

ok found '104.8551105', expected '104.8551105', error '0.0000000'

Test #2:

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

input:

100 7 615 998 801 3

output:

0.00000000000000000000

result:

ok found '0.0000000', expected '0.0000000', error '-0.0000000'

Test #3:

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

input:

100 432 406 867 60 1000

output:

399.30381259211193878400

result:

ok found '399.3038126', expected '399.3038130', error '0.0000000'

Test #4:

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

input:

350 120 957 785 310 1

output:

0.00000000000000000000

result:

ok found '0.0000000', expected '0.0000000', error '-0.0000000'

Test #5:

score: 0
Accepted
time: 24ms
memory: 19880kb

input:

350 0 957 0 310 1000000

output:

0.00000000000000000000

result:

ok found '0.0000000', expected '0.0000000', error '-0.0000000'

Test #6:

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

input:

200 411 433 922 805 2

output:

665.52243036159052280709

result:

ok found '665.5224304', expected '665.5224300', error '0.0000000'

Test #7:

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

input:

200 178 828 458 260 2

output:

0.00000000000000000000

result:

ok found '0.0000000', expected '0.0000000', error '-0.0000000'

Test #8:

score: 0
Accepted
time: 128ms
memory: 19812kb

input:

1000 797 148 780 347 1000000

output:

3999.97711698992742768155

result:

ok found '3999.9771170', expected '3999.9771170', error '0.0000000'

Test #9:

score: 0
Accepted
time: 119ms
memory: 19888kb

input:

1000 358 984 955 264 1000000

output:

3999.98018206129482976507

result:

ok found '3999.9801821', expected '3999.9801820', error '0.0000000'

Test #10:

score: 0
Accepted
time: 79ms
memory: 19920kb

input:

1000 811 740 98 337 1000000

output:

3999.98600340426655819215

result:

ok found '3999.9860034', expected '3999.9860030', error '0.0000000'

Test #11:

score: 0
Accepted
time: 131ms
memory: 19976kb

input:

1000 889 755 966 497 1000000

output:

3999.91903872442656719954

result:

ok found '3999.9190387', expected '3999.9190390', error '0.0000000'

Test #12:

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

input:

1000 208 734 845 264 1000000

output:

3999.44150830449750877449

result:

ok found '3999.4415083', expected '3999.4415080', error '0.0000000'

Test #13:

score: 0
Accepted
time: 130ms
memory: 19920kb

input:

1000 429 460 845 909 1000000

output:

3999.27677109727660464955

result:

ok found '3999.2767711', expected '3999.2767710', error '0.0000000'

Test #14:

score: 0
Accepted
time: 108ms
memory: 20092kb

input:

1000 355 190 512 960 1000000

output:

3999.97506040443258612527

result:

ok found '3999.9750604', expected '3999.9750600', error '0.0000000'

Test #15:

score: 0
Accepted
time: 109ms
memory: 19840kb

input:

1000 417 443 386 589 1000000

output:

3999.99072540471957815100

result:

ok found '3999.9907254', expected '3999.9907250', error '0.0000000'

Test #16:

score: 0
Accepted
time: 2ms
memory: 4844kb

input:

100 710 178 710 189 40000

output:

370.12811539742684985299

result:

ok found '370.1281154', expected '370.1281150', error '0.0000000'

Test #17:

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

input:

100 710 89 710 198 20000

output:

0.00000000000000000000

result:

ok found '0.0000000', expected '0.0000000', error '-0.0000000'

Test #18:

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

input:

200 411 433 922 805 1

output:

0.00000000000000000000

result:

ok found '0.0000000', expected '0.0000000', error '-0.0000000'

Test #19:

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

input:

72 90 242 453 236 104681

output:

287.99190025937999948269

result:

ok found '287.9919003', expected '287.9919000', error '0.0000000'

Test #20:

score: 0
Accepted
time: 98ms
memory: 18564kb

input:

105 261 294 699 72 915601

output:

419.99628343596678758942

result:

ok found '419.9962834', expected '419.9962830', error '0.0000000'

Test #21:

score: 0
Accepted
time: 98ms
memory: 17772kb

input:

127 955 277 297 997 862467

output:

507.99849093916933329140

result:

ok found '507.9984909', expected '507.9984910', error '0.0000000'

Test #22:

score: 0
Accepted
time: 123ms
memory: 19664kb

input:

170 868 132 455 11 990921

output:

679.97810002066117451847

result:

ok found '679.9781000', expected '679.9781000', error '0.0000000'

Test #23:

score: 0
Accepted
time: 56ms
memory: 17420kb

input:

183 83 47 406 493 836911

output:

731.99512847544677862643

result:

ok found '731.9951285', expected '731.9951280', error '0.0000000'

Test #24:

score: 0
Accepted
time: 47ms
memory: 13576kb

input:

212 516 989 348 25 583181

output:

847.54742032416588237709

result:

ok found '847.5474203', expected '847.5474200', error '0.0000000'

Test #25:

score: 0
Accepted
time: 114ms
memory: 19084kb

input:

229 734 14 604 812 953661

output:

915.99492365069632104913

result:

ok found '915.9949237', expected '915.9949240', error '0.0000000'

Test #26:

score: 0
Accepted
time: 47ms
memory: 15776kb

input:

238 212 818 251 990 730696

output:

951.99352577331177815978

result:

ok found '951.9935258', expected '951.9935260', error '0.0000000'

Test #27:

score: 0
Accepted
time: 5ms
memory: 6432kb

input:

265 643 912 153 217 148106

output:

1059.98786808919576452048

result:

ok found '1059.9878681', expected '1059.9878680', error '0.0000000'

Test #28:

score: 0
Accepted
time: 36ms
memory: 12660kb

input:

278 858 827 104 700 531501

output:

1110.78543134798330793700

result:

ok found '1110.7854313', expected '1110.7854310', error '0.0000000'

Test #29:

score: 0
Accepted
time: 37ms
memory: 15048kb

input:

307 291 768 46 232 684128

output:

1227.99088672167341229624

result:

ok found '1227.9908867', expected '1227.9908870', error '0.0000000'

Test #30:

score: 0
Accepted
time: 2ms
memory: 4976kb

input:

320 772 682 998 714 43981

output:

1279.90803329643532038062

result:

ok found '1279.9080333', expected '1279.9080330', error '0.0000000'

Test #31:

score: 0
Accepted
time: 126ms
memory: 19464kb

input:

333 987 597 950 196 969471

output:

1331.99392792592897705184

result:

ok found '1331.9939279', expected '1331.9939280', error '0.0000000'

Test #32:

score: 0
Accepted
time: 4ms
memory: 5816kb

input:

666 2 192 2 394 100000

output:

828.80179696494644758786

result:

ok found '828.8017970', expected '828.8017970', error '0.0000000'

Test #33:

score: 0
Accepted
time: 8ms
memory: 7360kb

input:

667 2 483 4 293 200000

output:

2264.75404381279446397457

result:

ok found '2264.7540438', expected '2264.7540440', error '0.0000000'

Test #34:

score: 0
Accepted
time: 22ms
memory: 17380kb

input:

900 6 392 2 111 837842

output:

3530.58861911904913455373

result:

ok found '3530.5886191', expected '3530.5886190', error '0.0000000'

Test #35:

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

input:

293 152 392 456 333 29321

output:

979.71089937431877103791

result:

ok found '979.7108994', expected '979.7108990', error '0.0000000'

Test #36:

score: 0
Accepted
time: 14ms
memory: 9792kb

input:

392 456 222 152 222 348222

output:

1556.78685480556034015365

result:

ok found '1556.7868548', expected '1556.7868550', error '0.0000000'