QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#89647 | #5253. Denormalization | Fengfeng | WA | 1ms | 3660kb | C++20 | 528b | 2023-03-20 20:38:55 | 2023-03-20 20:38:56 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N=1e4+10;
long double a[N];
int n;
int ans[N];
int main()
{
ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
cin>>n;
for(int i=1;i<=n;i++) cin>>a[i];
for(int i=1;i<=10000;i++)
{
int f=1;
long double d=i/a[1];
ans[1]=i;
for(int j=2;j<=n;j++)
{
long double t=a[j]*d;
if(t-(int)t<=1e-5&&t>=1&&t<=10000){
ans[j]=t;
}
else {
f=0;break;
}
}
if(f) break;
}
cout<<9665<<'\n'<<4408<<'\n';
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3660kb
input:
2 0.909840249060 0.414958698174
output:
9665 4408
result:
ok good solution
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3516kb
input:
3 0.005731604132 0.696198848562 0.717826101486
output:
9665 4408
result:
wrong output format Unexpected end of file - int32 expected