QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#690278#5304. Money GameGodwang#WA 1ms3936kbC++23656b2024-10-30 21:24:052024-10-30 21:24:05

Judging History

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

  • [2024-10-30 21:24:05]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3936kb
  • [2024-10-30 21:24:05]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for(int i=a;i<=n;i++)


const int N=1e5+10;

int n;
double a[N];

void _(int x,int y)
{
    double temp=a[x]/2;
    a[x]-=temp;
    a[y]+=temp;
}

int main()
{
    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
   // freopen("ain.txt","r",stdin);freopen("aout.txt","w",stdout);

    cin>>n;
    rep(i,1,n)
    {
        cin>>a[i];
    }

    rep(ii,1,1000)
    {
        rep(i,1,n-1)
        {
            _(i,i+1);
        }
        _(n,1);
    }


    rep(i,1,n)
    {
        cout<<fixed<<setprecision(10)<<a[i]<<" ";
    }

    return 0;
}

详细

Test #1:

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

input:

2
4 2

output:

4.0000000000 2.0000000000 

result:

ok 2 numbers

Test #2:

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

input:

2
2 3

output:

3.3333333333 1.6666666667 

result:

ok 2 numbers

Test #3:

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

input:

2
851648 722281

output:

1049286.0000000000 524643.0000000000 

result:

ok 2 numbers

Test #4:

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

input:

3
450762 114467 367746

output:

466487.5000000000 233243.7500000000 233243.7500000000 

result:

ok 3 numbers

Test #5:

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

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: 0ms
memory: 3864kb

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: 3804kb

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: -100
Wrong Answer
time: 1ms
memory: 3820kb

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:

847315.0284646057 423509.9800398553 423442.8259895021 423379.5231753623 423320.3162227995 423265.4338934063 423215.0882010623 423169.4735928318 423128.7661978686 423093.1231472292 423062.6819672235 423037.5600486479 423017.8541939501 423003.6402440746 422994.9727864314 422991.8849451125 422994.38825...

result:

wrong answer 1st numbers differ - expected: '848873.9009901', found: '847315.0284646', error = '0.0018364'