QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#397571#5129. Equalising Audioucup-team1001#WA 46ms4020kbC++23905b2024-04-24 13:17:172024-04-24 13:17:18

Judging History

This is the latest submission verdict.

  • [2024-04-24 13:17:18]
  • Judged
  • Verdict: WA
  • Time: 46ms
  • Memory: 4020kb
  • [2024-04-24 13:17:17]
  • Submitted

answer

/*

Author: Haze

2024/4/24

*/

#include <bits/stdc++.h>

#define IOS ios::sync_with_stdio(false), cin.tie(nullptr);
using namespace std;
using ll = long long;
#define int ll

#define debugs(x) cerr<<#x<<" "<<x<<endl;
//const int mod = 1000000000 + 7;
//const int itinf = 1000000999;
//const ll llinf = 2e18;
//const int N = 500099;

void solve() {
    int n, x;
    cin >> n >> x;
    int sums = 0;
    vector<int> arr(n + 1);
    for (int i = 1; i <= n; i++) {
        cin >> arr[i];
        sums += arr[i] * arr[i];
//        debugs(sums);
    }
    long double t = sums * 1.0 / (1.0 * (x * n));
//    printf("%lld\n", sums);

    t = sqrt(t);
//    printf("%.8Lf", t);
    for (int i = 1; i <= n; i++) {
        printf("%.8Lf ", (1.0*arr[i])/t);
    }
}

signed main() {
//    IOS
    int T = 1;
    while (T--) {
        solve();
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

5 6
0 1 -2 3 -4

output:

0.00000000 1.00000000 -2.00000000 3.00000000 -4.00000000 

result:

ok 5 numbers

Test #2:

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

input:

4 1
1 3 3 7

output:

0.24253563 0.72760688 0.72760688 1.69774938 

result:

ok 4 numbers

Test #3:

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

input:

1 0
-1000000

output:

-0.00000000 

result:

ok found '-0.0000000', expected '-0.0000000', error '-0.0000000'

Test #4:

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

input:

1 1000000
-1000000

output:

-1000.00000000 

result:

ok found '-1000.0000000', expected '-1000.0000000', error '-0.0000000'

Test #5:

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

input:

1 1000000
1000000

output:

1000.00000000 

result:

ok found '1000.0000000', expected '1000.0000000', error '0.0000000'

Test #6:

score: 0
Accepted
time: 46ms
memory: 3944kb

input:

100000 1000000
1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 10000...

output:

1000.00000000 1000.00000000 1000.00000000 1000.00000000 1000.00000000 1000.00000000 1000.00000000 1000.00000000 1000.00000000 1000.00000000 1000.00000000 1000.00000000 1000.00000000 1000.00000000 1000.00000000 1000.00000000 1000.00000000 1000.00000000 1000.00000000 1000.00000000 1000.00000000 1000.0...

result:

ok 100000 numbers

Test #7:

score: -100
Wrong Answer
time: 26ms
memory: 4012kb

input:

100000 1000000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

-nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan ...

result:

wrong output format Expected double, but "-nan" found