QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#394617#1373. Rating ProblemsZuqa#AC ✓1ms3980kbC++201.2kb2024-04-20 16:53:472024-04-20 16:53:48

Judging History

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

  • [2024-04-20 16:53:48]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3980kb
  • [2024-04-20 16:53:47]
  • 提交

answer

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

#define el '\n'
#define FIO ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef unsigned uint;
typedef __int128 bint;
typedef long double ld;
typedef complex<ld> pt;
typedef unsigned long long ull;

template<typename T, typename X>
using hashTable = gp_hash_table<T, X>;
template<typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T>
using ordered_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;

// mt19937_64 for unsigned long long
mt19937 rng(std::chrono::system_clock::now().time_since_epoch().count());

void doWork()
{
    int n, k;
    cin >> n >> k;

    int s = 0;
    for(int i = 0, in; i < k; i++)
        cin >> in, s += in;

    ld mx = (ld) (s + (n - k) * 3) / (ld) n;
    ld mn = (ld) (s + (n - k) * -3) / (ld) n;

    cout << mn << ' ' << mx;


}

signed main()
{
    FIO
    int T = 1;
//    cin >> T;
    for(int i = 1; i <= T; i++)
        doWork();
}

详细

Test #1:

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

input:

10 0

output:

-3 3

result:

ok 2 numbers

Test #2:

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

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

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

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

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

input:

1 0

output:

-3 3

result:

ok 2 numbers

Test #7:

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

input:

1 1
2

output:

2 2

result:

ok 2 numbers

Test #8:

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

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

input:

6 4
-2
-1
-2
0

output:

-1.83333 0.166667

result:

ok 2 numbers