QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#394620 | #1373. Rating Problems | MahmoudBassem | AC ✓ | 0ms | 3920kb | C++14 | 745b | 2024-04-20 16:55:30 | 2024-04-20 16:55:32 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define el '\n'
#define fi first
#define se second
#define Nine_seconds ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
void run_case(int tc) {
int n,k;
cin >> n >> k;
double mn = 0, mx = 0;
for(int i = 0; i < k; i++)
{
double x;
cin >> x;
mn += x, mx += x;
}
cout << fixed << setprecision(4) << (mn + (n - k) * (-3)) / n << ' ' << (mx + (n - k) * 3) / n << '\n';
}
int32_t main() {
Nine_seconds /*Turn Off for Interactive Problems*/
int _t = 1;
//cin >> _t;
for (int i = 1; i <= _t; i++) {
run_case(i);
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3880kb
input:
10 0
output:
-3.0000 3.0000
result:
ok 2 numbers
Test #2:
score: 0
Accepted
time: 0ms
memory: 3916kb
input:
10 10 3 2 1 0 -1 -2 -3 -2 -1 0
output:
-0.3000 -0.3000
result:
ok 2 numbers
Test #3:
score: 0
Accepted
time: 0ms
memory: 3876kb
input:
10 10 0 0 0 0 0 0 0 0 0 0
output:
0.0000 0.0000
result:
ok 2 numbers
Test #4:
score: 0
Accepted
time: 0ms
memory: 3920kb
input:
10 10 3 3 3 3 3 3 3 3 3 3
output:
3.0000 3.0000
result:
ok 2 numbers
Test #5:
score: 0
Accepted
time: 0ms
memory: 3732kb
input:
10 10 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3
output:
-3.0000 -3.0000
result:
ok 2 numbers
Test #6:
score: 0
Accepted
time: 0ms
memory: 3880kb
input:
1 0
output:
-3.0000 3.0000
result:
ok 2 numbers
Test #7:
score: 0
Accepted
time: 0ms
memory: 3880kb
input:
1 1 2
output:
2.0000 2.0000
result:
ok 2 numbers
Test #8:
score: 0
Accepted
time: 0ms
memory: 3868kb
input:
9 7 1 3 2 2 1 1 2
output:
0.6667 2.0000
result:
ok 2 numbers
Test #9:
score: 0
Accepted
time: 0ms
memory: 3876kb
input:
6 4 -2 -1 -2 0
output:
-1.8333 0.1667
result:
ok 2 numbers