QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#59718 | #1373. Rating Problems | Beevo# | AC ✓ | 3ms | 3852kb | C++23 | 601b | 2022-10-31 22:00:17 | 2022-10-31 22:00:18 |
Judging History
answer
#include <bits/stdc++.h>
#define el '\n'
#define ll long long
#define ld long double
#define Beevo ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
void testCase() {
int n, k;
cin >> n >> k;
int sum = 0;
for (int i = 0, a; i < k; i++)
cin >> a, sum += a;
int mx = sum + (n - k) * 3;
int mn = sum + (n - k) * -3;
cout << fixed << setprecision(5) << (ld)mn / n << ' ' << (ld)mx / n;
}
signed main() {
Beevo
int T = 1;
// cin >> T;
while (T--)
testCase();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3836kb
input:
10 0
output:
-3.00000 3.00000
result:
ok 2 numbers
Test #2:
score: 0
Accepted
time: 3ms
memory: 3780kb
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: 3764kb
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: 2ms
memory: 3780kb
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: 2ms
memory: 3580kb
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: 2ms
memory: 3644kb
input:
1 0
output:
-3.00000 3.00000
result:
ok 2 numbers
Test #7:
score: 0
Accepted
time: 0ms
memory: 3764kb
input:
1 1 2
output:
2.00000 2.00000
result:
ok 2 numbers
Test #8:
score: 0
Accepted
time: 2ms
memory: 3852kb
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: 2ms
memory: 3636kb
input:
6 4 -2 -1 -2 0
output:
-1.83333 0.16667
result:
ok 2 numbers