QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#559608 | #1373. Rating Problems | Tenshi | AC ✓ | 0ms | 3916kb | C++20 | 805b | 2024-09-12 06:03:09 | 2024-09-12 06:03:09 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define debug(x) cerr << #x << ": " << (x) << endl
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define dwn(i,a,b) for(int i=(a);i>=(b);i--)
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define x first
#define y second
using pii = pair<int, int>;
using ll = long long;
inline void read(int &x){
int s=0; x=1;
char ch=getchar();
while(ch<'0' || ch>'9') {if(ch=='-')x=-1;ch=getchar();}
while(ch>='0' && ch<='9') s=(s<<3)+(s<<1)+ch-'0',ch=getchar();
x*=s;
}
int n, k;
double cal(int sum, int del){
return (double)(sum+del)/n;
}
signed main(){
cin>>n>>k;
int sum=0;
rep(i, 1, k){
int x; read(x);
sum+=x;
}
cout<<cal(sum, (n-k)*-3)<<" "<<cal(sum, (n-k)*3)<<endl;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3916kb
input:
10 0
output:
-3 3
result:
ok 2 numbers
Test #2:
score: 0
Accepted
time: 0ms
memory: 3904kb
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: 3860kb
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: 3856kb
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: 0ms
memory: 3864kb
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: 0ms
memory: 3860kb
input:
1 0
output:
-3 3
result:
ok 2 numbers
Test #7:
score: 0
Accepted
time: 0ms
memory: 3780kb
input:
1 1 2
output:
2 2
result:
ok 2 numbers
Test #8:
score: 0
Accepted
time: 0ms
memory: 3864kb
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: 3812kb
input:
6 4 -2 -1 -2 0
output:
-1.83333 0.166667
result:
ok 2 numbers