QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#394647#1373. Rating ProblemsAl-Hassan_Mohamed#AC ✓0ms3996kbC++20594b2024-04-20 17:12:212024-04-20 17:12:21

Judging History

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

  • [2024-04-20 17:12:21]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3996kb
  • [2024-04-20 17:12:21]
  • 提交

answer

#include <bits/stdc++.h>

#define sz(x)  (int)x.size()
#define bigint __int128
#define el '\n'
#define ll long long
#define ld long double
using namespace std;

void acc() {
    ld n, k;
    cin >> n >> k;
    ld sum = 0;
    for (ll i = 0; i < k; i++) {
        ld x;
        cin >> x;
        sum += x;
    }
    cout << fixed << setprecision(5);
    cout << (sum + (-3 * (n - k))) / n << ' ' << (sum + (3 * (n - k))) / n;
}

int main() {
    cout.tie(0);
    cin.tie(0);
    ios_base::sync_with_stdio(0);
    int t = 1;
    // cin >> t;
    while (t--)acc();
}

详细

Test #1:

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

input:

10 0

output:

-3.00000 3.00000

result:

ok 2 numbers

Test #2:

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

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: 0ms
memory: 3744kb

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: 3868kb

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: 0ms
memory: 3868kb

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: 0ms
memory: 3936kb

input:

1 0

output:

-3.00000 3.00000

result:

ok 2 numbers

Test #7:

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

input:

1 1
2

output:

2.00000 2.00000

result:

ok 2 numbers

Test #8:

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

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: 3880kb

input:

6 4
-2
-1
-2
0

output:

-1.83333 0.16667

result:

ok 2 numbers