QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#102434#5253. Denormalizationfz_zsl#WA 2ms3780kbC++14594b2023-05-03 13:09:282023-05-03 13:09:32

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:09:32]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3780kb
  • [2023-05-03 13:09:28]
  • 提交

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;
}

詳細信息

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