QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#102434 | #5253. Denormalization | fz_zsl# | WA | 2ms | 3780kb | C++14 | 594b | 2023-05-03 13:09:28 | 2023-05-03 13:09:32 |
Judging History
answer
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
double a[10005];
int main() {
int n;
double mn=10000.0,mx=0.0;
scanf("%d",&n);
for (int i=1;i<=n;++i) {
cin>>a[i];
mx=max(mx,a[i]);
mn=min(mn,a[i]);
}
for (int i=(int)(mx/mn);i<=10000;++i) {
bool flag=true;
for (int j=1;j<=n;++j) {
double x=a[j]*i/mx;
if (((long long)(x*1000))%1000!=0) {
flag=false;
break;
}
}
if (flag) {
for (int j=1;j<=n;++j) {
double x=a[j]*i/mx;
printf("%d\n",int(x+0.5));
}
return 0;
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3688kb
input:
2 0.909840249060 0.414958698174
output:
1127 514
result:
ok good solution
Test #2:
score: 0
Accepted
time: 2ms
memory: 3780kb
input:
3 0.005731604132 0.696198848562 0.717826101486
output:
75 9110 9393
result:
ok good solution
Test #3:
score: -100
Wrong Answer
time: 1ms
memory: 3652kb
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