포럼
문제 ICPC00342

E. Equalising Audio

스페셜 저지 — 출력을 사용자 정의 프로그램으로 검사하므로 여러 정답이 인정될 수 있습니다.
설명

As a radio engineer at the Balanced Audio Podcast your job is to deliver an equal listening experience at all times. You did a poll among the listeners and they are especially concerned about fluctuations in loudness. To resolve this you bought a transformer to equalise the audio, but alas, its software got corrupted during transport.

Your job is to rewrite the equalising software. As input the transformer gets \(n\) amplitudes \(a_1, \ldots, a_n\), with an average perceived loudness of \(\frac{1}{n}\sum_{i=1}^n a_i^2\). The output should contain the same amplitudes, but renormalised by some constant positive factor, such that the average perceived loudness is \(x\). There is one exception: total silence should always be preserved.

제약
입력 형식

The input consists of:
- One line with a two integers \(n\) and \(x\) (\(1\leq n\leq 10^5\), \(0 \leq x \leq 10^6)\), the number of amplitudes and the average perceived loudness to achieve.
- One line with \(n\) integers \(a_1, \ldots, a_n\) (\(\left| a_i \right| \leq 10^6\)), the amplitudes.

출력 형식

Output one line containing \(n\) numbers, the renormalised amplitudes with an average perceived loudness of \(x\).

Your answers should have an absolute or relative error of at most \(10^{-6}\).

예제 1
입력
5 6
0 1 -2 3 -4
출력
0 1 -2 3 -4
예제 2
입력
4 1
1 3 3 7
출력
0.242535625 0.7276068751 0.7276068751 1.697749375
문제 정보

생성자가 기록되지 않았습니다.

출처 ICPC BAPC 2022

평가 및 의견

E. Equalising Audio

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 1 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

E. Equalising Audio

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8