QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#90469 | #5253. Denormalization | ysghwzp# | WA | 3ms | 3452kb | C++17 | 570b | 2023-03-23 11:24:59 | 2023-03-23 11:25:03 |
Judging History
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;
}
詳細信息
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]