QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#490412 | #5740. Testing Subjects Usually Die | ucup-team1525# | WA | 0ms | 3912kb | C++20 | 531b | 2024-07-25 15:05:58 | 2024-07-25 15:05:59 |
Judging History
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'