QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#394635#1373. Rating ProblemsWisdomCasual#AC ✓0ms3980kbC++20766b2024-04-20 17:06:442024-04-20 17:06:45

Judging History

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

  • [2024-04-20 17:06:45]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3980kb
  • [2024-04-20 17:06:44]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define ERROR ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); fileIO();
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
void fileIO(){
    #ifndef ONLINE_JUDGE
    freopen("io\\input.txt", "r", stdin);
    freopen("io\\output.txt", "w", stdout);
    #endif
}

const ll mod = 1e9 + 7, N = 2e5 + 5;

void TestCase(){
    
    int n, k, x, sum = 0;
    cin >> n >> k;

    for(int i = 0; i < k; i++)
        cin >> x, sum += x;
    
    cout << fixed << setprecision(8) << ld(sum - 3 * (n-k)) / ld(n) << ' ' << ld(sum + 3 * (n-k)) / ld(n) << '\n';
    
}

int main() {
    
    ERROR;

    int t = 1;
    //cin >> t;

    while(t--)
        TestCase();

}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

10 0

output:

-3.00000000 3.00000000

result:

ok 2 numbers

Test #2:

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

input:

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

output:

-0.30000000 -0.30000000

result:

ok 2 numbers

Test #3:

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

input:

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

output:

0.00000000 0.00000000

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.00000000 3.00000000

result:

ok 2 numbers

Test #5:

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

input:

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

output:

-3.00000000 -3.00000000

result:

ok 2 numbers

Test #6:

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

input:

1 0

output:

-3.00000000 3.00000000

result:

ok 2 numbers

Test #7:

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

input:

1 1
2

output:

2.00000000 2.00000000

result:

ok 2 numbers

Test #8:

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

input:

9 7
1
3
2
2
1
1
2

output:

0.66666667 2.00000000

result:

ok 2 numbers

Test #9:

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

input:

6 4
-2
-1
-2
0

output:

-1.83333333 0.16666667

result:

ok 2 numbers