QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#131828 | #5129. Equalising Audio | mshcherba# | WA | 52ms | 3836kb | C++17 | 784b | 2023-07-28 14:41:35 | 2023-07-28 14:41:36 |
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);
cout << fixed << setprecision(10);
int n, x;
cin >> n >> x;
double s = 0;
vector<double> a(n);
for (double& ai : a) {
cin >> ai;
s += ai * ai;
}
double k = s < 1e-3 ? 0 : sqrt(n * x / s);
for (double ai : a) {
cout << k * ai << " ";
}
cout << "\n";
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3720kb
input:
5 6 0 1 -2 3 -4
output:
0.0000000000 1.0000000000 -2.0000000000 3.0000000000 -4.0000000000
result:
ok 5 numbers
Test #2:
score: 0
Accepted
time: 1ms
memory: 3828kb
input:
4 1 1 3 3 7
output:
0.2425356250 0.7276068751 0.7276068751 1.6977493753
result:
ok 4 numbers
Test #3:
score: 0
Accepted
time: 1ms
memory: 3724kb
input:
1 0 -1000000
output:
-0.0000000000
result:
ok found '-0.0000000', expected '-0.0000000', error '-0.0000000'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
1 1000000 -1000000
output:
-1000.0000000000
result:
ok found '-1000.0000000', expected '-1000.0000000', error '-0.0000000'
Test #5:
score: 0
Accepted
time: 1ms
memory: 3648kb
input:
1 1000000 1000000
output:
1000.0000000000
result:
ok found '1000.0000000', expected '1000.0000000', error '0.0000000'
Test #6:
score: -100
Wrong Answer
time: 52ms
memory: 3836kb
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:
110.2611532680 110.2611532680 110.2611532680 110.2611532680 110.2611532680 110.2611532680 110.2611532680 110.2611532680 110.2611532680 110.2611532680 110.2611532680 110.2611532680 110.2611532680 110.2611532680 110.2611532680 110.2611532680 110.2611532680 110.2611532680 110.2611532680 110.2611532680 ...
result:
wrong answer 1st numbers differ - expected: '1000.0000000', found: '110.2611533', error = '0.8897388'