QOJ.ac
QOJ
The 2nd Universal Cup Finals is coming! Check out our event page, schedule, and competition rules!
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#131835 | #5129. Equalising Audio | PetroTarnavskyi# | WA | 45ms | 3840kb | C++17 | 771b | 2023-07-28 15:12:10 | 2023-07-28 15:12:12 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define FOR(i, a, b) for (int i = (a); i<(b); ++i)
#define RFOR(i, b, a) for (int i = (b)-1; i>=(a); --i)
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define FILL(a, b) memset(a, b, sizeof(a))
typedef long long LL;
typedef pair<int, int> PII;
typedef vector<int> VI;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int n, x;
cin >> n >> x;
VI a(n);
LL sum = 0;
FOR(i, 0, n){
cin >> a[i];
sum += 1LL * a[i] * a[i];
}
long double coef = sqrt(1.0 * x * n / sum);
cout << fixed << setprecision(8);
FOR(i, 0, n){
cout << a[i] * coef << " ";
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3592kb
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: 1ms
memory: 3732kb
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: 1ms
memory: 3664kb
input:
1 0 -1000000
output:
-0.00000000
result:
ok found '-0.0000000', expected '-0.0000000', error '-0.0000000'
Test #4:
score: 0
Accepted
time: 1ms
memory: 3740kb
input:
1 1000000 -1000000
output:
-1000.00000000
result:
ok found '-1000.0000000', expected '-1000.0000000', error '-0.0000000'
Test #5:
score: 0
Accepted
time: 1ms
memory: 3828kb
input:
1 1000000 1000000
output:
1000.00000000
result:
ok found '1000.0000000', expected '1000.0000000', error '0.0000000'
Test #6:
score: 0
Accepted
time: 45ms
memory: 3840kb
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: 23ms
memory: 3712kb
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