QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#656722 | #5304. Money Game | melodyline | WA | 0ms | 3856kb | C++14 | 1.1kb | 2024-10-19 13:37:03 | 2024-10-19 13:37:04 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N = 2e5 + 9, mod = 998244353, inf = 1e18;
const double pai = 3.14159265358;
int find(int l){
int cnt=0;
int r=l;
while(r!=1){
cnt++;
r/=2;
}
int x=pow(2,cnt+1)-1,mul=1,sum=cnt*(cnt-1)/2+1;
for(int i=1;i<=cnt;i++){
if(x-mul<=l){
sum++;
}
mul*=2;
}
return sum;
}
void slove()
{
int n;cin>>n;
vector<double> a(n+1);
vector<int> b(n+1);
for(int i=0;i<n;i++){
cin>>b[i];a[i]=b[i]*1.0;
}
int mul=b[0];
for(int i=1;i<n;i++){
mul=mul*b[i]/__gcd(mul,b[i]);
}
int cnt=2022%mul;
//cout<<mul<<" "<<cnt<<"\n";
while(cnt--){
for(int i=1;i<n;i++){
a[i]=a[i-1]*1.0/2+a[i];
a[i-1]=a[i-1]*1.0/2;
}
a[n-1]=a[n-1]*1.0/2;
a[0]+=a[n-1];
}
for(int i=0;i<n;i++){
cout<<a[i]<<" \n"[i==n-1];
}
return;
}
signed main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cout<<fixed<<setprecision(10);
int T = 1;
//cin >> T;
while (T--)
{
slove();
}
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3804kb
input:
2 4 2
output:
4.0000000000 2.0000000000
result:
ok 2 numbers
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3856kb
input:
2 2 3
output:
2.0000000000 3.0000000000
result:
wrong answer 1st numbers differ - expected: '3.3333333', found: '2.0000000', error = '0.4000000'