QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#331211#1373. Rating Problemsape_packAC ✓1ms3876kbC++23396b2024-02-18 03:27:382024-02-18 03:27:39

Judging History

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

  • [2024-02-18 03:27:39]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3876kb
  • [2024-02-18 03:27:38]
  • 提交

answer

#include <iostream>
using namespace std;

int main() {
    int N, K;
    cin >> N >> K;

    int total = 0;
    for (int i = 0; i < K; i++) {
        int r;
        cin >> r;
        total += r;
    }
    double min_rating = (double) (total - 3 * (N-K)) / N;
    double max_rating = (double) (total + 3 * (N-K)) / N;
    cout << min_rating << endl;
    cout << max_rating << endl;
    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3832kb

input:

10 0

output:

-3
3

result:

ok 2 numbers

Test #2:

score: 0
Accepted
time: 0ms
memory: 3804kb

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: 3844kb

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: 3876kb

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: 3808kb

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: 3776kb

input:

1 0

output:

-3
3

result:

ok 2 numbers

Test #7:

score: 0
Accepted
time: 0ms
memory: 3776kb

input:

1 1
2

output:

2
2

result:

ok 2 numbers

Test #8:

score: 0
Accepted
time: 0ms
memory: 3848kb

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: 3776kb

input:

6 4
-2
-1
-2
0

output:

-1.83333
0.166667

result:

ok 2 numbers