QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#90469#5253. Denormalizationysghwzp#WA 3ms3452kbC++17570b2023-03-23 11:24:592023-03-23 11:25:03

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-23 11:25:03]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:3452kb
  • [2023-03-23 11:24:59]
  • 提交

answer

#include <bits/stdc++.h>

using i64 = long long;

double gcd(double a, double b) {
	if (b < 1E-9) {
		return a;
	}
	return gcd(b, a - b * std::floor(a / b));
}

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(nullptr);

	int N;
	std::cin >> N;

	std::vector<double> x(N);
	for (int i = 0; i < N; i++) {
		std::cin >> x[i];
	}

	double g = 0;
	for (int i = 0; i < N; i++) {
		g = gcd(g, x[i]);
	}

	std::vector<int> r(N);
	for (int i = 0; i < N; i++) {
		r[i] = x[i] / g + .5;
		std::cout << r[i] << "\n";
	}

	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 3ms
memory: 3452kb

input:

2
0.909840249060
0.414958698174

output:

459078511
209375900

result:

wrong answer Integer parameter [name=r_i] equals to 459078511, violates the range [1, 10000]