QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#332037 | #1373. Rating Problems | ishmeal# | AC ✓ | 1ms | 3912kb | C++14 | 470b | 2024-02-19 06:09:19 | 2024-02-19 06:09:20 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0)->ios_base::sync_with_stdio(0);
cout << fixed << setprecision(6);
int n, k;
cin >> n >> k;
double minAm = 0;
double maxAm = 0;
for(int i = 0; i < k; i++){
int a;
cin >> a;
minAm += a;
maxAm += a;
}
minAm += (-3)*(n-k);
maxAm += (3)*(n-k);
minAm /= n;
maxAm /= n;
cout << minAm <<" " << maxAm << endl;
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3868kb
input:
10 0
output:
-3.000000 3.000000
result:
ok 2 numbers
Test #2:
score: 0
Accepted
time: 0ms
memory: 3912kb
input:
10 10 3 2 1 0 -1 -2 -3 -2 -1 0
output:
-0.300000 -0.300000
result:
ok 2 numbers
Test #3:
score: 0
Accepted
time: 1ms
memory: 3892kb
input:
10 10 0 0 0 0 0 0 0 0 0 0
output:
0.000000 0.000000
result:
ok 2 numbers
Test #4:
score: 0
Accepted
time: 0ms
memory: 3776kb
input:
10 10 3 3 3 3 3 3 3 3 3 3
output:
3.000000 3.000000
result:
ok 2 numbers
Test #5:
score: 0
Accepted
time: 0ms
memory: 3856kb
input:
10 10 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3
output:
-3.000000 -3.000000
result:
ok 2 numbers
Test #6:
score: 0
Accepted
time: 0ms
memory: 3756kb
input:
1 0
output:
-3.000000 3.000000
result:
ok 2 numbers
Test #7:
score: 0
Accepted
time: 1ms
memory: 3856kb
input:
1 1 2
output:
2.000000 2.000000
result:
ok 2 numbers
Test #8:
score: 0
Accepted
time: 1ms
memory: 3868kb
input:
9 7 1 3 2 2 1 1 2
output:
0.666667 2.000000
result:
ok 2 numbers
Test #9:
score: 0
Accepted
time: 0ms
memory: 3896kb
input:
6 4 -2 -1 -2 0
output:
-1.833333 0.166667
result:
ok 2 numbers