QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#102539 | #5253. Denormalization | gudu | WA | 2ms | 3564kb | C++14 | 896b | 2023-05-03 14:31:39 | 2023-05-03 14:31:42 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define M (998244353)
#define N (10010)
double mi,a[N],b[N];
int n,nn;
int main(){
scanf("%d",&n); mi=1;
for (int i=1;i<=n;++i){
scanf("%lf",&a[i]);
if (a[i]<mi) mi=a[i];
}
for (int i=1;i<=n;++i) a[i]/=mi;
// b[++nn]=1;
// for (int i=1;i<=n;++i){
// bool flag=true;
// for (int j=1;j<=nn;++j){
// bool t1=abs((a[i]/b[j])-round(a[i]/b[j]))<1e-6;
//// bool t2=1-((a[i]/b[j])-(int)(a[i]/b[j]))<1e-6;
// if (t1) flag=false;
// }
// if (flag) b[++nn]=a[i];
// }
for (int i=1;i<=10000;++i){
bool flag=true;
for (int j=1;j<=n;++j){
bool t1=abs((a[j]*i)-round(a[j]*i))<1e-2;
// bool t2=1-((a[i]*i)-(int)(a[i]*i))<1e-6;
if (!t1){
flag=false;
break;
}
}
if (flag){
for (int j=1;j<=n;++j) printf("%d\n",(int)round(a[j]*i));
return 0;
}
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 3564kb
input:
2 0.909840249060 0.414958698174
output:
57 26
result:
wrong answer incorrect solution