QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#332037#1373. Rating Problemsishmeal#AC ✓1ms3912kbC++14470b2024-02-19 06:09:192024-02-19 06:09:20

Judging History

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

  • [2024-02-19 06:09:20]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3912kb
  • [2024-02-19 06:09:19]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;


int main() {
    cin.tie(0)->ios_base::sync_with_stdio(0);
    cout << fixed << setprecision(6);

    int n, k;
    cin >> n >> k;
    double minAm = 0;
    double maxAm = 0;
    for(int i = 0; i < k; i++){
        int a;
        cin >> a;
        minAm += a;
        maxAm += a;
    }
    minAm += (-3)*(n-k);
    maxAm += (3)*(n-k);
    minAm /= n;
    maxAm /= n;
    cout << minAm <<" " << maxAm << endl;
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3868kb

input:

10 0

output:

-3.000000 3.000000

result:

ok 2 numbers

Test #2:

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

input:

10 10
3
2
1
0
-1
-2
-3
-2
-1
0

output:

-0.300000 -0.300000

result:

ok 2 numbers

Test #3:

score: 0
Accepted
time: 1ms
memory: 3892kb

input:

10 10
0
0
0
0
0
0
0
0
0
0

output:

0.000000 0.000000

result:

ok 2 numbers

Test #4:

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

input:

10 10
3
3
3
3
3
3
3
3
3
3

output:

3.000000 3.000000

result:

ok 2 numbers

Test #5:

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

input:

10 10
-3
-3
-3
-3
-3
-3
-3
-3
-3
-3

output:

-3.000000 -3.000000

result:

ok 2 numbers

Test #6:

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

input:

1 0

output:

-3.000000 3.000000

result:

ok 2 numbers

Test #7:

score: 0
Accepted
time: 1ms
memory: 3856kb

input:

1 1
2

output:

2.000000 2.000000

result:

ok 2 numbers

Test #8:

score: 0
Accepted
time: 1ms
memory: 3868kb

input:

9 7
1
3
2
2
1
1
2

output:

0.666667 2.000000

result:

ok 2 numbers

Test #9:

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

input:

6 4
-2
-1
-2
0

output:

-1.833333 0.166667

result:

ok 2 numbers