QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#102412#5253. Denormalizationfz_zsl#WA 2ms3600kbC++14580b2023-05-03 12:52:252023-05-03 12:52:30

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 12:52:30]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3600kb
  • [2023-05-03 12:52:25]
  • 提交

answer

#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;

double a[10005];

int main() {
	int n;
	double mn=1.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 ((int(x*10000))%10000!=0) {
				flag=false;
				break;
			}
		}
		if (flag) {
			for (int j=1;j<=n;++j) {
				double x=a[j]*i/mx;
				printf("%d\n",int(x));
			}
			return 0;
		}
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 2ms
memory: 3600kb

input:

2
0.909840249060
0.414958698174

output:


result:

wrong output format Unexpected end of file - int32 expected