QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#95302 | #5129. Equalising Audio | _b_ | WA | 119ms | 4092kb | C++14 | 606b | 2023-04-09 13:52:01 | 2023-04-09 13:52:03 |
Judging History
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 = 0;
if (new_xs == 0) {
ans = 0;
}
else {
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;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3648kb
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: 3524kb
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: 1ms
memory: 3568kb
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: 3600kb
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: 3584kb
input:
1 1000000 1000000
output:
1000
result:
ok found '1000.0000000', expected '1000.0000000', error '0.0000000'
Test #6:
score: 0
Accepted
time: 66ms
memory: 4092kb
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: 0
Accepted
time: 45ms
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:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 100000 numbers
Test #8:
score: 0
Accepted
time: 56ms
memory: 4012kb
input:
100000 0 237833 -321037 -658096 185552 -11691 811692 -704215 -245540 -46182 736398 477486 507460 259285 -586435 -635372 724036 81936 -697996 -849452 -781325 -131134 817989 -456886 367349 -806076 867604 -537776 440842 407590 -647627 -287763 -91717 -866636 989077 -155668 82322 -554996 754025 806686 -2...
output:
0 -0 -0 0 -0 0 -0 -0 -0 0 0 0 0 -0 -0 0 0 -0 -0 -0 -0 0 -0 0 -0 0 -0 0 0 -0 -0 -0 -0 0 -0 0 -0 0 0 -0 0 0 0 0 -0 0 -0 0 -0 0 -0 -0 0 -0 0 -0 0 0 -0 -0 -0 -0 0 -0 0 0 0 -0 0 -0 -0 -0 -0 -0 0 0 0 -0 -0 -0 0 -0 -0 0 -0 -0 0 0 0 -0 0 0 -0 -0 0 0 -0 -0 -0 -0 -0 -0 -0 -0 0 -0 -0 -0 -0 -0 0 0 -0 0 -0 0 0 -...
result:
ok 100000 numbers
Test #9:
score: 0
Accepted
time: 2ms
memory: 3568kb
input:
1 892515 -951936
output:
-944.730120193063
result:
ok found '-944.7301202', expected '-944.7301202', error '0.0000000'
Test #10:
score: 0
Accepted
time: 2ms
memory: 3592kb
input:
2 690198 -623894 854168
output:
-692.990631350694 948.76761372855
result:
ok 2 numbers
Test #11:
score: 0
Accepted
time: 0ms
memory: 3700kb
input:
3 292354 899294 -479941 -302887
output:
791.992980607213 -422.675902547561 -266.747446238023
result:
ok 3 numbers
Test #12:
score: 0
Accepted
time: 2ms
memory: 3704kb
input:
10 870604 -751017 -232735 405446 160546 646834 -290853 -709068 530938 434260 129698
output:
-1460.70404479878 -452.662131304942 788.579502391404 312.256835166534 1258.07144194256 -565.699782484097 -1379.11458147736 1032.65742870983 844.621810816955 252.258461795554
result:
ok 10 numbers
Test #13:
score: 0
Accepted
time: 1ms
memory: 3520kb
input:
77 373489 972870 -600719 71099 -124069 -420408 -66411 -560309 -288838 393091 374053 718736 -237074 -378547 125937 3551 831010 205684 -159516 -238514 349364 795588 136894 -35988 -508062 764968 203305 -164010 443722 -810928 742169 -458905 -613830 305283 403845 -950353 683949 -320944 149829 472839 7131...
output:
1142.93267915988 -705.727770506071 83.5274708394626 -145.756899247265 -493.897480424152 -78.019984330575 -658.253894690339 -339.328367801638 461.80532834154 439.439388035183 844.374749029831 -278.515754395909 -444.718962346391 147.951435253793 4.17173306165954 976.274821619176 241.638620967159 -187....
result:
ok 77 numbers
Test #14:
score: 0
Accepted
time: 3ms
memory: 3628kb
input:
655 168947 -36773 258218 983390 893060 -500292 385408 127683 -846740 -889316 -842892 -595848 691385 239546 -98245 660632 117208 -566022 859025 -509549 -674373 11605 -390721 34908 670966 291596 -38822 539151 308484 -192566 -716926 -50248 -50207 861880 -487910 366599 -102207 711633 -885171 -488674 418...
output:
-26.2535907109436 184.35128181542 702.078116260159 637.588222889492 -357.176771108134 275.156878381512 91.1575673114898 -604.518679427417 -634.915244246962 -601.771451378149 -425.397697167333 493.60505843107 171.020657559723 -70.1407015853114 471.649366071631 83.679081392551 -404.103824039097 613.28...
result:
ok 655 numbers
Test #15:
score: 0
Accepted
time: 2ms
memory: 3632kb
input:
1554 322540 203076 318359 921077 987386 -182284 437897 254027 711339 -584807 763502 571075 323762 -127677 328542 937967 663083 491060 -975995 -214206 -679787 43058 705834 938123 176791 597937 450876 -91821 -964385 -612463 853048 127440 -134728 146710 811538 -601164 953321 -348936 671063 643998 70353...
output:
196.285998357065 307.71442293012 890.280084838832 954.371992622414 -176.189194806473 423.255578318284 245.533412636896 687.554835555735 -565.253529915895 737.973725687014 551.980669856414 312.936769485711 -123.40802168762 317.556946523602 906.60535474887 640.91231188618 474.641032683431 -943.3618594...
result:
ok 1554 numbers
Test #16:
score: 0
Accepted
time: 4ms
memory: 3668kb
input:
5973 759367 -616354 268248 389294 307599 799176 936167 -280027 -143014 234827 645156 389419 -1703 -612880 -720467 149002 -271363 744499 761062 -299637 -759936 -574692 -873682 -858433 164171 -813895 769220 -865706 -98864 97084 -395167 -910889 833989 380184 -832391 427245 979919 534114 -966637 -813371...
output:
-925.615982639128 402.844203349018 584.626283508368 461.939973852385 1200.17080856392 1405.89845708688 -420.533438203511 -214.772750953433 352.653871566013 968.869683486323 584.814003548848 -2.55749783149689 -920.398867274113 -1081.96875523492 223.765291772578 -407.522186757775 1118.05905933741 1142...
result:
ok 5973 numbers
Test #17:
score: 0
Accepted
time: 15ms
memory: 3692kb
input:
12345 620455 116766 -482898 -342479 -131693 622759 -814727 -556558 -247019 -267253 861919 -541017 -404598 587746 -870744 -653366 -938477 437279 -256249 -753253 -965885 866482 354232 -898809 543331 975270 -630125 848206 845969 922692 148750 738534 -40238 970573 37005 931379 -504967 332104 419324 3030...
output:
159.098272681456 -657.967539192313 -466.641122669889 -179.436897934664 848.53365874339 -1110.09761751661 -758.332189567559 -336.57311391587 -364.142735633121 1174.39857570977 -737.156965137995 -551.280706116263 800.827067600456 -1186.42298569568 -890.236901399311 -1278.71186519427 595.809855436293 -...
result:
ok 12345 numbers
Test #18:
score: 0
Accepted
time: 45ms
memory: 3736kb
input:
34674 794833 -447740 -760016 450508 751798 -957936 -598733 132085 -434458 652768 -146490 646732 -96312 -342845 -452217 -284767 -385145 392989 293071 -696614 -553402 -345178 -267740 -394175 -606143 -998291 -692652 -649118 141870 -664208 -914901 495651 -462376 542753 709191 810830 150356 -703724 80871...
output:
-689.514900711202 -1170.41666319499 693.77759165945 1157.76102944763 -1475.21138591077 -922.04253595283 203.409513691962 -669.060760113431 1005.25586882443 -225.593062503203 995.960492175721 -148.31946915017 -527.977701644553 -696.409433722513 -438.538191206564 -593.119257681726 605.198935354435 451...
result:
ok 34674 numbers
Test #19:
score: 0
Accepted
time: 90ms
memory: 3884kb
input:
82141 696589 -296314 778365 302771 896879 537581 -845933 -684894 292270 -387801 -778631 403440 -312086 780182 166566 -306668 598646 -190970 -396114 315869 -49768 -991295 -671313 -296433 -270028 201594 -606851 -491081 -822454 -77232 340406 -651445 -674839 -238697 392436 -231079 630963 -502534 513124 ...
output:
-428.173985313331 1124.73809566342 437.504355876882 1295.99092777876 776.805008196459 -1222.3739138821 -989.672420125908 422.330401828895 -560.372779141367 -1125.12246589261 582.971147616414 -450.964538902975 1127.363662229 240.688013518431 -443.135524234658 865.043985811957 -275.951814545674 -572.3...
result:
ok 82141 numbers
Test #20:
score: 0
Accepted
time: 119ms
memory: 4084kb
input:
100000 153361 658914 676108 676604 -492278 -455152 869325 -255561 -688623 349199 591954 -827869 -332173 684142 608259 775069 -375635 -906724 184090 -899290 -640747 -58391 -692116 -581133 508209 927472 -773154 -75034 550434 -907316 -798460 454822 21829 166892 124252 823133 924442 461945 -346270 -3711...
output:
446.967741457877 458.631119905788 458.967576559862 -333.931872489279 -308.747820595761 589.697945168669 -173.357255992006 -467.120545360923 236.875659569153 401.546093157766 -561.57668095228 -225.32624224601 464.080903693767 412.606427320449 525.760327453985 -254.808256559323 -615.067183889934 124.8...
result:
ok 100000 numbers
Test #21:
score: -100
Wrong Answer
time: 42ms
memory: 3924kb
input:
100000 552438 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 ...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
wrong answer 137th numbers differ - expected: '7373.8605150', found: '0.0000000', error = '1.0000000'