QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#671620#5304. Money Gameji_114514WA 39ms3996kbC++20632b2024-10-24 13:44:312024-10-24 13:44:31

Judging History

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

  • [2024-10-24 13:44:31]
  • 评测
  • 测评结果:WA
  • 用时:39ms
  • 内存:3996kb
  • [2024-10-24 13:44:31]
  • 提交

answer

#include<bits/stdc++.h>
#define ll long long

using namespace std;

void solve()
{
    int n;cin>>n;
    vector<double>a(n);
    for (int i = 0; i < n; i++)
    {
        int x; cin >> x;
        a[i] = x;
    }
    for (int j = 0; j < 10000; j++)
    {
        for (int i = 0; i < n; i++)
        {
            int k = (i + 1) % n;
            a[k] += a[i] / 2;
            a[i] /= 2;
        }
    }
    for (int i = 0; i < n; i++)printf("%.10lf ",a[i]);
    cout << '\n';
}

int main()
{
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int t = 1;
    while (t--)solve();
    return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3872kb

input:

2
4 2

output:


4.0000000000 2.0000000000 

result:

ok 2 numbers

Test #2:

score: 0
Accepted
time: 0ms
memory: 3724kb

input:

2
2 3

output:


3.3333333333 1.6666666667 

result:

ok 2 numbers

Test #3:

score: 0
Accepted
time: 0ms
memory: 3728kb

input:

2
851648 722281

output:


1049286.0000000000 524643.0000000000 

result:

ok 2 numbers

Test #4:

score: 0
Accepted
time: 0ms
memory: 3728kb

input:

3
450762 114467 367746

output:


466487.5000000000 233243.7500000000 233243.7500000000 

result:

ok 3 numbers

Test #5:

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

input:

4
2 3 5 1

output:


4.4000000000 2.2000000000 2.2000000000 2.2000000000 

result:

ok 4 numbers

Test #6:

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

input:

5
616288 155735 783782 648639 349827

output:


851423.6666666670 425711.8333333334 425711.8333333334 425711.8333333334 425711.8333333335 

result:

ok 5 numbers

Test #7:

score: 0
Accepted
time: 0ms
memory: 3728kb

input:

6
1 2 5 5 1 2

output:


4.5714285714 2.2857142857 2.2857142857 2.2857142857 2.2857142857 2.2857142857 

result:

ok 6 numbers

Test #8:

score: 0
Accepted
time: 4ms
memory: 3944kb

input:

100
283397 377774 494372 487546 143741 314831 934818 229251 78798 395137 407818 18761 516178 734330 838264 433107 858247 174903 905002 445936 58127 253493 844807 215023 37167 11961 885588 176935 156947 82314 21120 373809 226377 712113 302554 613417 368577 604224 811349 182256 179860 424904 544075 16...

output:


848873.9009900747 424436.9504950373 424436.9504950373 424436.9504950373 424436.9504950374 424436.9504950375 424436.9504950377 424436.9504950378 424436.9504950381 424436.9504950384 424436.9504950386 424436.9504950390 424436.9504950394 424436.9504950398 424436.9504950403 424436.9504950408 424436.9504...

result:

ok 100 numbers

Test #9:

score: 0
Accepted
time: 4ms
memory: 3684kb

input:

100
5 3 4 3 3 5 1 4 1 5 5 4 2 5 2 4 2 2 5 2 3 4 3 3 1 3 1 5 4 5 4 2 3 1 4 2 2 3 4 5 2 5 2 2 1 2 1 4 2 2 3 4 4 2 1 2 5 3 2 2 1 5 4 2 3 1 3 1 4 5 4 1 1 5 3 3 2 3 5 4 2 4 3 3 2 3 5 2 3 5 5 4 4 1 5 4 5 4 2 1

output:


6.0792079208 3.0396039604 3.0396039604 3.0396039604 3.0396039604 3.0396039604 3.0396039604 3.0396039604 3.0396039604 3.0396039604 3.0396039604 3.0396039604 3.0396039604 3.0396039604 3.0396039604 3.0396039604 3.0396039604 3.0396039604 3.0396039604 3.0396039604 3.0396039604 3.0396039604 3.0396039604 ...

result:

ok 100 numbers

Test #10:

score: -100
Wrong Answer
time: 39ms
memory: 3996kb

input:

1000
752085 536931 226066 866464 865683 685497 869505 833061 583665 542381 226489 183898 682629 584879 968426 414809 258683 315749 204443 89329 66644 255718 884710 690597 216353 59071 257910 665131 979147 688114 99343 929069 829135 674291 849479 242572 654330 268521 645445 96088 960241 507763 482377...

output:

1029916.2563307404 514893.5926520802 514860.5003193420 514827.0013809254 514793.0987866083 514758.7955409826 514724.0947036888 514688.9993896369 514653.5127692147 514617.6380684818 514581.3785693501 514544.7376097504 514507.7185837835 514470.3249418573 514432.5601908088 514394.4278940103 514355.9316...

result:

wrong answer 1st numbers differ - expected: '1019649.5684316', found: '1029916.2563307', error = '0.0100688'