QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#671616 | #5304. Money Game | ji_114514 | WA | 1ms | 4052kb | C++20 | 630b | 2024-10-24 13:42:48 | 2024-10-24 13:42:49 |
Judging History
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 < 300; 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;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3856kb
input:
2 4 2
output:
4.0000000000 2.0000000000
result:
ok 2 numbers
Test #2:
score: 0
Accepted
time: 0ms
memory: 4052kb
input:
2 2 3
output:
3.3333333333 1.6666666667
result:
ok 2 numbers
Test #3:
score: 0
Accepted
time: 0ms
memory: 3672kb
input:
2 851648 722281
output:
1049286.0000000000 524643.0000000000
result:
ok 2 numbers
Test #4:
score: 0
Accepted
time: 0ms
memory: 3720kb
input:
3 450762 114467 367746
output:
466487.5000000000 233243.7500000000 233243.7500000000
result:
ok 3 numbers
Test #5:
score: 0
Accepted
time: 0ms
memory: 3924kb
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: 3928kb
input:
5 616288 155735 783782 648639 349827
output:
851423.6666666669 425711.8333333335 425711.8333333334 425711.8333333334 425711.8333333334
result:
ok 5 numbers
Test #7:
score: 0
Accepted
time: 0ms
memory: 3856kb
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: 3716kb
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:
849507.1319170827 422232.5931319194 420984.1392510301 419750.5179342803 418536.0025759824 417344.7801627329 416180.9428593742 415048.4799870471 413951.2703092474 412893.0745432604 411877.5280176299 410908.1334013084 409988.2534367079 409121.1036168769 408309.7447563109 407557.0754152951 406865.8241...
result:
wrong answer 1st numbers differ - expected: '848873.9009901', found: '849507.1319171', error = '0.0007460'