QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#90502 | #5253. Denormalization | SolitaryDream# | WA | 3ms | 3648kb | C++17 | 799b | 2023-03-23 13:27:02 | 2023-03-23 13:27:06 |
Judging History
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;
}
}
}
詳細信息
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