91分求调
查看原帖
91分求调
1409635
_5k_kudang_inserter楼主2024/9/4 17:36

RT。WA on #1

#include<bits/stdc++.h>

using namespace std;

int main()
{
    double p;
    cin>>p;
    long long ans=p*1e9;
    long long num=1e9;
    while(!(ans%2)&&!(num%2)){num/=2;ans/=2;}
    while(!(ans%5)&&!(num%5)){num/=5;ans/=5;}
    ans-=floor(p)*num;
    //cout<<ans<<' '<<num<<'\n';
    for(int i=1;i<=5;i++)
    {
        if(i<floor(p))cout<<"0 ";
        else if(i>ceil(p))cout<<"0 ";
        else
        {
            if(i<p)cout<<num-ans<<' ';
            else cout<<ans<<' ';
        }
    }
    return 0;
}
```改用`scanf`无果。开`long double`并用`scanf`变为72分(WA on #1,#9,#11)
2024/9/4 17:36
加载中...