QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#103102#5253. Denormalizationaguo123WA 2ms3412kbC++111.1kb2023-05-04 14:39:102023-05-04 14:39:11

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-05-04 14:39:11]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3412kb
  • [2023-05-04 14:39:10]
  • 提交

answer

#include<iostream>
#include<algorithm>
using namespace std;
const int N=1e5+10;
typedef long long LL;
const LL mod=998244353;
const double eps=1e-7;
int n,T;
LL a[N],f[N];
LL mx=1e6;
double x[N];

LL qmi(LL a,LL b){
    LL res=1;
    while(b){
        if(b&1)res=res*a%mod;
        a=a*a%mod;
        b>>=1;
    }
    return res;
}
LL Gcd(LL a,LL b){
    return b?Gcd(b,a%b):a;
}
int main()
{
    cin>>n;
    int vis=0;
    for(int i=1;i<=n;i++)cin>>x[i];
    for(int i=1;i<=mx;i++){
        
        int flag=1;
        for(int j=1;j<=n;j++){
            int y=(int)(x[j]*(double)i+0.5);
            double t=(double)y/(double)i;
            if(abs(t-x[j])>eps)flag=0;
        }
        if(flag)vis=1;
        if(vis){
          //  cout<<i<<endl;
            for(int j=1;j<=n;j++)a[j]=(LL)(x[j]*(double)i);
            int d=Gcd(a[1],a[2]);
            for(int j=3;j<=n;j++)d=(a[j],d);
             for(int j=1;j<=n;j++)cout<<a[j]/d<<endl;
            break;
        }
      //  cout<<(int)(4.9)<<endl;
    }
    
    return 0;
} 

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 2ms
memory: 3412kb

input:

2
0.909840249060
0.414958698174

output:

13539
6175

result:

wrong answer Integer parameter [name=r_i] equals to 13539, violates the range [1, 10000]