QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#226309#5740. Testing Subjects Usually DieFuyuki#WA 0ms3932kbC++14594b2023-10-25 20:02:302023-10-25 20:02:30

Judging History

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

  • [2023-10-25 20:02:30]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3932kb
  • [2023-10-25 20:02:30]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define ld long double
const int N = 1e5 + 1;
int n, c, a[N];
ld foo() {
  int sum = 0, maxn = 0;
  for (int i = 1; i <= n; i++)
    sum += a[i], maxn = max(maxn, a[i]);
  return 1. * sum / maxn;
}
ld bar() {
  ld out = 0, sum = 0;
  for (int i = 1; i <= n; i++)
    sum += a[i], out += sqrtl(a[i]);
  return out * out / sum;
}
int main() {
  scanf("%d%d", &n, &c);
  for (int i = 1; i <= n; i++)
    scanf("%d", a + i);
  ld ans1 = foo(), ans2 = bar();
  printf("%.10Lf", (ans1 * c + ans2 * (100 - c) )/ 100);
  return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

4 100
25 25 25 25

output:

4.0000000000

result:

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

Test #2:

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

input:

2 0
1 4

output:

1.8000000000

result:

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

Test #3:

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

input:

5 0
245 802 95 452 756

output:

4.4685309985

result:

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

Test #4:

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

input:

5 10
85 144 62 67 925

output:

3.3531014816

result:

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