QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#142321#1373. Rating ProblemsKhaled_Ramadan#AC ✓1ms3740kbC++20760b2023-08-18 23:15:142023-08-18 23:15:18

Judging History

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

  • [2023-08-18 23:15:18]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3740kb
  • [2023-08-18 23:15:14]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define IO ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
typedef long long ll;
const long long N = 3e5 + 7, Mod = 1e9 + 7, INF = 2e18;
ll inv(ll a, ll b = Mod) { return 1 < a ? b - inv(b % a, a) * b / a : 1; }
const int dx[9] = {0, 0, 1, -1, 1, 1, -1, -1, 0};
const int dy[9] = {1, -1, 0, 0, -1, 1, 1, -1, 0};
void solve()
{
    int n, k;
    cin >> n >> k;
    ll sm = 0;
    for (int i = 1; i <= k; i++)
    {
        int x;
        cin >> x;
        sm += x;
    }
    cout << fixed << setprecision(10) << (sm - 3 * (n - k)) * 1.0 / n << " " << (sm + 3 * (n - k)) * 1.0 / n << '\n';
}
int main()
{
    IO;
    int TC = 1;
    // cin >> TC;
    while (TC--)
        solve();
}

详细

Test #1:

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

input:

10 0

output:

-3.0000000000 3.0000000000

result:

ok 2 numbers

Test #2:

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

input:

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

output:

-0.3000000000 -0.3000000000

result:

ok 2 numbers

Test #3:

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

input:

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

output:

0.0000000000 0.0000000000

result:

ok 2 numbers

Test #4:

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

input:

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

output:

3.0000000000 3.0000000000

result:

ok 2 numbers

Test #5:

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

input:

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

output:

-3.0000000000 -3.0000000000

result:

ok 2 numbers

Test #6:

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

input:

1 0

output:

-3.0000000000 3.0000000000

result:

ok 2 numbers

Test #7:

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

input:

1 1
2

output:

2.0000000000 2.0000000000

result:

ok 2 numbers

Test #8:

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

input:

9 7
1
3
2
2
1
1
2

output:

0.6666666667 2.0000000000

result:

ok 2 numbers

Test #9:

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

input:

6 4
-2
-1
-2
0

output:

-1.8333333333 0.1666666667

result:

ok 2 numbers