QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#357540#4676. Amalgamated ArtichokesUFRJWA 13ms4396kbC++20484b2024-03-18 23:04:342024-03-18 23:04:35

Judging History

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

  • [2024-03-18 23:04:35]
  • 评测
  • 测评结果:WA
  • 用时:13ms
  • 内存:4396kb
  • [2024-03-18 23:04:34]
  • 提交

answer

#include<bits/stdc++.h>

using namespace std;


int p, a, b ,c, d, n;
    
double get_val(int k){
    return (double) p*(sin(a*k+b) + cos(c*k+d) + 2);
}

int main(){
    cin.tie(0)->sync_with_stdio(false);
    cin>>p>>a>>b>>c>>d>>n;
    double ans = 0;
    double maxi = get_val(1);
    for(int i = 1; i < n; i++){
        ans = max(ans, maxi - get_val(i));
        maxi = max(maxi, get_val(i));
    }
    cout<<fixed<<setprecision(7)<<ans<<"\n";
    return 0;
}

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.8551105

result:

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

Test #2:

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

input:

100 7 615 998 801 3

output:

0.0000000

result:

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

Test #3:

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

input:

100 432 406 867 60 1000

output:

399.3038126

result:

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

Test #4:

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

input:

350 120 957 785 310 1

output:

0.0000000

result:

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

Test #5:

score: 0
Accepted
time: 13ms
memory: 4128kb

input:

350 0 957 0 310 1000000

output:

0.0000000

result:

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

Test #6:

score: -100
Wrong Answer
time: 0ms
memory: 4224kb

input:

200 411 433 922 805 2

output:

0.0000000

result:

wrong answer 1st numbers differ - expected: '665.5224300', found: '0.0000000', error = '1.0000000'