QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#90500 | #5253. Denormalization | SolitaryDream# | WA | 2ms | 3684kb | C++17 | 769b | 2023-03-23 13:24:16 | 2023-03-23 13:24:17 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N=1e4+1e2+7;
const double eps=1e-9;
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: 0
Wrong Answer
time: 2ms
memory: 3684kb
input:
2 0.909840249060 0.414958698174
output:
result:
wrong output format Unexpected end of file - int32 expected