QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#394667#1373. Rating ProblemsMohabX#AC ✓1ms3952kbC++23749b2024-04-20 17:23:502024-04-20 17:23:50

Judging History

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

  • [2024-04-20 17:23:50]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3952kb
  • [2024-04-20 17:23:50]
  • 提交

answer

#include <bits/stdc++.h>

typedef long long ll;
typedef long double ld;
using namespace std;
#define Mohab ios_base::sync_with_stdio(false); cin.tie(nullptr);
#define el '\n'

void RRR() {
    ll n, k;
    cin >> n >> k;

    ll d = n - k;

    ld mx = 0, mn = 0;

    for (ll i = 0; i < k; i++) {
        ll x;
        cin >> x;

        mn += x;
        mx += x;
    }

    mn += 1.0*(-3.0*d);
    mx += 1.0*(3.0*d);

    mn /= n;
    mx /= n;

    cout << fixed << setprecision(5) << mn << ' ' << mx;


}

signed main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    Mohab
    int T = 1;
//    cin >> T;
    while (T--)
        RRR();
}

详细

Test #1:

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

input:

10 0

output:

-3.00000 3.00000

result:

ok 2 numbers

Test #2:

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

input:

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

output:

-0.30000 -0.30000

result:

ok 2 numbers

Test #3:

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

input:

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

output:

0.00000 0.00000

result:

ok 2 numbers

Test #4:

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

input:

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

output:

3.00000 3.00000

result:

ok 2 numbers

Test #5:

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

input:

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

output:

-3.00000 -3.00000

result:

ok 2 numbers

Test #6:

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

input:

1 0

output:

-3.00000 3.00000

result:

ok 2 numbers

Test #7:

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

input:

1 1
2

output:

2.00000 2.00000

result:

ok 2 numbers

Test #8:

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

input:

9 7
1
3
2
2
1
1
2

output:

0.66667 2.00000

result:

ok 2 numbers

Test #9:

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

input:

6 4
-2
-1
-2
0

output:

-1.83333 0.16667

result:

ok 2 numbers