QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#90503#5253. DenormalizationSolitaryDream#WA 10ms3728kbC++17897b2023-03-23 13:31:242023-03-23 13:31:28

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:31:28]
  • 评测
  • 测评结果:WA
  • 用时:10ms
  • 内存:3728kb
  • [2023-03-23 13:31:24]
  • 提交

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

详细

Test #1:

score: 100
Accepted
time: 2ms
memory: 3728kb

input:

2
0.909840249060
0.414958698174

output:

9665
4408

result:

ok good solution

Test #2:

score: 0
Accepted
time: 3ms
memory: 3644kb

input:

3
0.005731604132
0.696198848562
0.717826101486

output:

75
9110
9393

result:

ok good solution

Test #3:

score: -100
Wrong Answer
time: 10ms
memory: 3492kb

input:

10
0.338936215010
0.390914583549
0.048893426174
0.446152513833
0.137891103101
0.017985796057
0.459132554353
0.201452557127
0.362800863500
0.358493585479

output:


result:

wrong output format Unexpected end of file - int32 expected