QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#90502#5253. DenormalizationSolitaryDream#WA 3ms3648kbC++17799b2023-03-23 13:27:022023-03-23 13:27:06

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-23 13:27:06]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:3648kb
  • [2023-03-23 13:27:02]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;

#define double long double

const int N=1e4+1e2+7;

const double eps=1e-8;

int n,a[N];

double x[N];

int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
        scanf("%Lf",&x[i]);
    for(int w=1;w<=10000;w++)
    {
        a[1]=w;
        bool ok=1;
        double s=w*w;
        for(int i=2;i<=n;i++)
        {
            double r=w*x[i]/x[1];
            long long x=floorl(r+0.5);
            if(x>10000||fabs(1.0*x-r)>eps)
                ok=0;
            a[i]=x;
            s+=x*x;
        }   
        if(!ok)
            continue;
        // if(fabs(w/sqrt(s)-x[1])<eps)
        {
            for(int i=1;i<=n;i++)
                printf("%d\n",a[i]);
            return 0;
        }
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 3ms
memory: 3648kb

input:

2
0.909840249060
0.414958698174

output:

9665
4408

result:

ok good solution

Test #2:

score: -100
Wrong Answer
time: 3ms
memory: 3552kb

input:

3
0.005731604132
0.696198848562
0.717826101486

output:


result:

wrong output format Unexpected end of file - int32 expected