QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#102539#5253. DenormalizationguduWA 2ms3564kbC++14896b2023-05-03 14:31:392023-05-03 14:31:42

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-05-03 14:31:42]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3564kb
  • [2023-05-03 14:31:39]
  • 提交

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