QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#102432#5253. Denormalizationfz_zsl#WA 2ms3644kbC++14600b2023-05-03 13:07:252023-05-03 13:07:26

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 13:07:26]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3644kb
  • [2023-05-03 13:07:25]
  • 提交

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*1000000))%1000000!=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: 0
Wrong Answer
time: 2ms
memory: 3644kb

input:

2
0.909840249060
0.414958698174

output:


result:

wrong output format Unexpected end of file - int32 expected