QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#394627#1373. Rating ProblemsOmar_Alaa03#AC ✓1ms3968kbC++14765b2024-04-20 17:01:092024-04-20 17:01:09

Judging History

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

  • [2024-04-20 17:01:09]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3968kb
  • [2024-04-20 17:01:09]
  • 提交

answer

#include <bits/stdc++.h>

#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long
#define ull unsigned long long
#define  ld long double
#define no "NO"
#define yes "YES"
#define forr(n) for(int i = 0;i < n; i++)
#define d(n) cout<<"value of "<<#n<<" is "<<n<<endl
#define endl '\n'
using namespace std;
const int N = 1e6 + 5, mode = 1e9 + 7;




void Code() {
    double n,k;
    cin >> n >> k;
    double sum=0;
    for(int i=0;i<k;i++){
        double x;
        cin >> x;
        sum+=x;
    }
    double mn = sum,mx=sum;
    mn+=-3*(n-k);
    mx+=3*(n-k);
    cout << mn/n << " " << mx/n;
}


int main() {
    fast
    int tc = 1;
//    cin >> tc;

    while (tc--)
        Code();
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3968kb

input:

10 0

output:

-3 3

result:

ok 2 numbers

Test #2:

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

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

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

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: 1ms
memory: 3968kb

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: 1ms
memory: 3712kb

input:

1 0

output:

-3 3

result:

ok 2 numbers

Test #7:

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

input:

1 1
2

output:

2 2

result:

ok 2 numbers

Test #8:

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

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

input:

6 4
-2
-1
-2
0

output:

-1.83333 0.166667

result:

ok 2 numbers