QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#59653#1373. Rating Problemsziad#AC ✓2ms3836kbC++231.0kb2022-10-31 18:02:422022-10-31 18:02:45

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-31 18:02:45]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:3836kb
  • [2022-10-31 18:02:42]
  • 提交

answer

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
#include <array>
#include <climits>
// #pragma GCC optimize ("O3")
// #pragma GCC optimize ("unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
typedef long long ll;
typedef long double ld;
using namespace std;
const int N = 4e5 + 5;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    // cout.tie(nullptr);

    int n, k, sum = 0;
    cin >> n >> k;

    for (int i = 0; i < k; ++i) {
        int r;
        cin >> r;
        sum += r;
    }

    cout << (1.0l * (sum - 3 * (n - k)) / n) << ' ' <<  (1.0l * (sum + 3 * (n - k)) / n) << '\n';
    return 0;
}


詳細信息

Test #1:

score: 100
Accepted
time: 2ms
memory: 3636kb

input:

10 0

output:

-3 3

result:

ok 2 numbers

Test #2:

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

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: 2ms
memory: 3760kb

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: 2ms
memory: 3784kb

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: 2ms
memory: 3644kb

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: 2ms
memory: 3632kb

input:

1 0

output:

-3 3

result:

ok 2 numbers

Test #7:

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

input:

1 1
2

output:

2 2

result:

ok 2 numbers

Test #8:

score: 0
Accepted
time: 2ms
memory: 3636kb

input:

9 7
1
3
2
2
1
1
2

output:

0.666667 2

result:

ok 2 numbers

Test #9:

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

input:

6 4
-2
-1
-2
0

output:

-1.83333 0.166667

result:

ok 2 numbers