QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#95299#5129. Equalising Audio_b_WA 74ms4084kbC++14544b2023-04-09 13:49:422023-04-09 13:49:47

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-09 13:49:47]
  • 评测
  • 测评结果:WA
  • 用时:74ms
  • 内存:4084kb
  • [2023-04-09 13:49:42]
  • 提交

answer

#include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;
#define ll long long
const int MAXN = 1e5 + 50;
double n; int x;
int a[MAXN];
int main() {
	cin >> n >> x;
	ll xs = 0;
	for (int i = 1; i <= n; i++) {
		cin >> a[i];
		xs += 1LL * a[i] * a[i];
	}
	long long wbbb = xs / n;
	long double new_xs = (long double)wbbb;
	long double ans = sqrt((long double)x / new_xs);
	for (int i = 1; i <= n; i++) {
		long double tmp = ans * (long double)a[i];
		cout << setprecision(15) << tmp << " ";
	}
	return 0;
}

详细

Test #1:

score: 100
Accepted
time: 2ms
memory: 3588kb

input:

5 6
0 1 -2 3 -4

output:

0 1 -2 3 -4 

result:

ok 5 numbers

Test #2:

score: 0
Accepted
time: 1ms
memory: 3588kb

input:

4 1
1 3 3 7

output:

0.242535625036333 0.727606875108999 0.727606875108999 1.69774937525433 

result:

ok 4 numbers

Test #3:

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

input:

1 0
-1000000

output:

-0 

result:

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

Test #4:

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

input:

1 1000000
-1000000

output:

-1000 

result:

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

Test #5:

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

input:

1 1000000
1000000

output:

1000 

result:

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

Test #6:

score: 0
Accepted
time: 74ms
memory: 4084kb

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 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 ...

result:

ok 100000 numbers

Test #7:

score: -100
Wrong Answer
time: 40ms
memory: 4020kb

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