QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#54565#1373. Rating Problemscpbeginner#AC ✓227ms55700kbJava11612b2022-10-09 18:17:072022-10-09 18:17:08

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-10-09 18:17:08]
  • 评测
  • 测评结果:AC
  • 用时:227ms
  • 内存:55700kb
  • [2022-10-09 18:17:07]
  • 提交

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