QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#490412#5740. Testing Subjects Usually Dieucup-team1525#WA 0ms3912kbC++20531b2024-07-25 15:05:582024-07-25 15:05:59

Judging History

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

  • [2024-07-25 15:05:59]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3912kb
  • [2024-07-25 15:05:58]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int N=100005;
int n,m,a[N];
int main()
{
    scanf("%d%d",&n,&m);
    int sum=0,mx=0;
    double sqrsum=0;
    for (int i=1;i<=n;++i)
    {
        scanf("%d",&a[i]);
        mx=max(mx,a[i]);
        sum+=a[i];
        sqrsum+=sqrt(a[i]);
    }
    double t1=(double)sum/mx,t2=0;
    for (int i=1;i<=n;++i)
        t2+=(double)sqrt(a[i])*sqrsum;
    t2=t2/sum;
    // printf("%lf %lf\n",t1,t2);
    printf("%.9lf\n",(t1*m+t2*(100-m))/100.0);
    return 0;
}

详细

Test #1:

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

input:

4 100
25 25 25 25

output:

4.000000000

result:

ok found '4.0000000', expected '4.0000000', error '0.0000000'

Test #2:

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

input:

2 0
1 4

output:

1.800000000

result:

ok found '1.8000000', expected '1.8000000', error '0.0000000'

Test #3:

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

input:

5 0
245 802 95 452 756

output:

4.468530999

result:

ok found '4.4685310', expected '4.4685310', error '0.0000000'

Test #4:

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

input:

5 10
85 144 62 67 925

output:

3.353101482

result:

wrong answer 1st numbers differ - expected: '3.0823373', found: '3.3531015', error = '0.0878438'