QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#394627 | #1373. Rating Problems | Omar_Alaa03# | AC ✓ | 1ms | 3968kb | C++14 | 765b | 2024-04-20 17:01:09 | 2024-04-20 17:01:09 |
Judging History
answer
#include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long
#define ull unsigned long long
#define ld long double
#define no "NO"
#define yes "YES"
#define forr(n) for(int i = 0;i < n; i++)
#define d(n) cout<<"value of "<<#n<<" is "<<n<<endl
#define endl '\n'
using namespace std;
const int N = 1e6 + 5, mode = 1e9 + 7;
void Code() {
double n,k;
cin >> n >> k;
double sum=0;
for(int i=0;i<k;i++){
double x;
cin >> x;
sum+=x;
}
double mn = sum,mx=sum;
mn+=-3*(n-k);
mx+=3*(n-k);
cout << mn/n << " " << mx/n;
}
int main() {
fast
int tc = 1;
// cin >> tc;
while (tc--)
Code();
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3968kb
input:
10 0
output:
-3 3
result:
ok 2 numbers
Test #2:
score: 0
Accepted
time: 1ms
memory: 3840kb
input:
10 10 3 2 1 0 -1 -2 -3 -2 -1 0
output:
-0.3 -0.3
result:
ok 2 numbers
Test #3:
score: 0
Accepted
time: 0ms
memory: 3864kb
input:
10 10 0 0 0 0 0 0 0 0 0 0
output:
0 0
result:
ok 2 numbers
Test #4:
score: 0
Accepted
time: 0ms
memory: 3912kb
input:
10 10 3 3 3 3 3 3 3 3 3 3
output:
3 3
result:
ok 2 numbers
Test #5:
score: 0
Accepted
time: 1ms
memory: 3968kb
input:
10 10 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3
output:
-3 -3
result:
ok 2 numbers
Test #6:
score: 0
Accepted
time: 1ms
memory: 3712kb
input:
1 0
output:
-3 3
result:
ok 2 numbers
Test #7:
score: 0
Accepted
time: 0ms
memory: 3912kb
input:
1 1 2
output:
2 2
result:
ok 2 numbers
Test #8:
score: 0
Accepted
time: 0ms
memory: 3900kb
input:
9 7 1 3 2 2 1 1 2
output:
0.666667 2
result:
ok 2 numbers
Test #9:
score: 0
Accepted
time: 0ms
memory: 3920kb
input:
6 4 -2 -1 -2 0
output:
-1.83333 0.166667
result:
ok 2 numbers