QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#59650#1373. Rating Problemsabdelrahman001#AC ✓2ms3856kbC++20607b2022-10-31 17:54:142022-10-31 17:54:15

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 17:54:15]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:3856kb
  • [2022-10-31 17:54:14]
  • 提交

answer

#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;
const int N = 1e5 + 5;
int n, k;
int main() {
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin >> n >> k;
	int sum = 0;
	for(int i = 0;i < k;i++) {
		int x;
		cin >> x;
		sum += x;
	}
	ld mn = (sum + (n - k) * -3) / (ld)n;
	ld mx = (sum + (n - k) * 3) / (ld)n;
	cout << fixed << setprecision(9) << mn << " " << mx;
    return 0;
}


詳細信息

Test #1:

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

input:

10 0

output:

-3.000000000 3.000000000

result:

ok 2 numbers

Test #2:

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

input:

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

output:

-0.300000000 -0.300000000

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.000000000 0.000000000

result:

ok 2 numbers

Test #4:

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

input:

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

output:

3.000000000 3.000000000

result:

ok 2 numbers

Test #5:

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

input:

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

output:

-3.000000000 -3.000000000

result:

ok 2 numbers

Test #6:

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

input:

1 0

output:

-3.000000000 3.000000000

result:

ok 2 numbers

Test #7:

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

input:

1 1
2

output:

2.000000000 2.000000000

result:

ok 2 numbers

Test #8:

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

input:

9 7
1
3
2
2
1
1
2

output:

0.666666667 2.000000000

result:

ok 2 numbers

Test #9:

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

input:

6 4
-2
-1
-2
0

output:

-1.833333333 0.166666667

result:

ok 2 numbers