QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#656722#5304. Money GamemelodylineWA 0ms3856kbC++141.1kb2024-10-19 13:37:032024-10-19 13:37:04

Judging History

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

  • [2024-10-19 13:37:04]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3856kb
  • [2024-10-19 13:37:03]
  • 提交

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'