QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#59647#1373. Rating ProblemsSa3tElSefr#AC ✓3ms3856kbC++20610b2022-10-31 17:49:032022-10-31 17:49:04

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-10-31 17:49:04]
  • 评测
  • 测评结果:AC
  • 用时:3ms
  • 内存:3856kb
  • [2022-10-31 17:49:03]
  • 提交

answer

#pragma GCC optimize("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx,avx2,fma")

#include <bits/stdc++.h>

#define ll long long
#define ld  double
using namespace std;

const int N = 2e5 + 5, lg = 19, mod = 1e9 + 7;




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

    int n, k;
    cin >> n >> k;
    int sum = 0;
    for(int i = 0; i < k; i++) {
        int x;
        cin >> x;
        sum += x;
    }
    cout << fixed << setprecision(5) << (sum + -3.0l * (n - k)) / (ld) n << ' ' << (sum + 3.0l * (n - k)) / (ld) n;

    return 0;
}


Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3616kb

input:

10 0

output:

-3.00000 3.00000

result:

ok 2 numbers

Test #2:

score: 0
Accepted
time: 3ms
memory: 3616kb

input:

10 10
3
2
1
0
-1
-2
-3
-2
-1
0

output:

-0.30000 -0.30000

result:

ok 2 numbers

Test #3:

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

input:

10 10
0
0
0
0
0
0
0
0
0
0

output:

0.00000 0.00000

result:

ok 2 numbers

Test #4:

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

input:

10 10
3
3
3
3
3
3
3
3
3
3

output:

3.00000 3.00000

result:

ok 2 numbers

Test #5:

score: 0
Accepted
time: 3ms
memory: 3628kb

input:

10 10
-3
-3
-3
-3
-3
-3
-3
-3
-3
-3

output:

-3.00000 -3.00000

result:

ok 2 numbers

Test #6:

score: 0
Accepted
time: 3ms
memory: 3856kb

input:

1 0

output:

-3.00000 3.00000

result:

ok 2 numbers

Test #7:

score: 0
Accepted
time: 3ms
memory: 3856kb

input:

1 1
2

output:

2.00000 2.00000

result:

ok 2 numbers

Test #8:

score: 0
Accepted
time: 3ms
memory: 3768kb

input:

9 7
1
3
2
2
1
1
2

output:

0.66667 2.00000

result:

ok 2 numbers

Test #9:

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

input:

6 4
-2
-1
-2
0

output:

-1.83333 0.16667

result:

ok 2 numbers