QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#54565 | #1373. Rating Problems | cpbeginner# | AC ✓ | 227ms | 55700kb | Java11 | 612b | 2022-10-09 18:17:07 | 2022-10-09 18:17:08 |
Judging History
answer
import java.io.*;
import java.util.*;
public class rating_finn {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] s = br.readLine().split(" ");
int n = Integer.parseInt(s[0]);
int k = Integer.parseInt(s[1]);
double initialSum = 0;
for (int i=0; i<k; i++) {
initialSum += Integer.parseInt(br.readLine());
}
double smallSum = initialSum - 3.0*(n-k);
double bigSum = initialSum + 3.0*(n-k);
System.out.println((smallSum/n) + " " + (bigSum/n));
}
}
詳細信息
Test #1:
score: 100
Accepted
time: 223ms
memory: 51816kb
input:
10 0
output:
-3.0 3.0
result:
ok 2 numbers
Test #2:
score: 0
Accepted
time: 227ms
memory: 53520kb
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: 217ms
memory: 55500kb
input:
10 10 0 0 0 0 0 0 0 0 0 0
output:
0.0 0.0
result:
ok 2 numbers
Test #4:
score: 0
Accepted
time: 193ms
memory: 55700kb
input:
10 10 3 3 3 3 3 3 3 3 3 3
output:
3.0 3.0
result:
ok 2 numbers
Test #5:
score: 0
Accepted
time: 184ms
memory: 51688kb
input:
10 10 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3
output:
-3.0 -3.0
result:
ok 2 numbers
Test #6:
score: 0
Accepted
time: 215ms
memory: 51936kb
input:
1 0
output:
-3.0 3.0
result:
ok 2 numbers
Test #7:
score: 0
Accepted
time: 198ms
memory: 53552kb
input:
1 1 2
output:
2.0 2.0
result:
ok 2 numbers
Test #8:
score: 0
Accepted
time: 169ms
memory: 51676kb
input:
9 7 1 3 2 2 1 1 2
output:
0.6666666666666666 2.0
result:
ok 2 numbers
Test #9:
score: 0
Accepted
time: 173ms
memory: 51740kb
input:
6 4 -2 -1 -2 0
output:
-1.8333333333333333 0.16666666666666666
result:
ok 2 numbers