QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#700599#5253. DenormalizationAshbourneWA 1ms3868kbC++23662b2024-11-02 13:12:312024-11-02 13:12:31

Judging History

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

  • [2024-11-02 13:12:31]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3868kb
  • [2024-11-02 13:12:31]
  • 提交

answer

#include<bits/stdc++.h>
#define double long double
const double eps = 1e-3;
using namespace std;
signed main(){
	ios::sync_with_stdio(0);
	int n;
	cin >> n;
	vector<double>a(n + 1);
	for(int i = 1; i <= n; ++ i) cin >> a[i];
	double mx = 0.0;
	for(int i = 1; i <= n; ++ i) mx = max(mx, a[i]);
	for(int i = 1; i <= 10000; ++ i){
		double t = i / mx;
		bool flag = 1;
		if(fabs(round(t * t) - t * t) >= eps) continue;
		for(int j = 1; j <= n; ++ j){
			double tt = a[j] * t;
			if(fabs(round(tt) - tt) >= eps){
				flag = 0; break;	
			}
		}
		if(flag){
			for(int j = 1; j <= n; ++ j) cout << round(a[j] * t) << endl;
			break;
		}
	}
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3868kb

input:

2
0.909840249060
0.414958698174

output:

7946
3624

result:

wrong answer the greatest common divisor is 2, but expected 1.