QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#198529 | #5253. Denormalization | PHarr# | WA | 1ms | 3976kb | C++20 | 828b | 2023-10-03 14:37:18 | 2023-10-03 14:37:19 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using ldb = long double;
#define int long long
constexpr ldb eps = 1E-11;
int32_t main() {
int n;
cin >> n;
vector<ldb> a(n);
for (auto &i: a)
cin >> i;
for (int i = 1; i < n; i++) a[i] /= a[0];
vector<int> b(n);
for (b[0] = 1; b[0] <= 10000; b[0]++) {
int d = b[0];
for (int i = 1; i < n; i++) {
ldb x = (ldb) b[0] * a[i];
if (x - floor(x) < eps) b[i] = floor(x);
else if (ceil(x) - x < eps) b[i] = ceil(x);
else {
d = -1;
break;
}
d = gcd(d, b[i]);
}
if (d != 1) continue;
for (auto i: b)
cout << i << "\n";
return 0;
}
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3976kb
input:
2 0.909840249060 0.414958698174
output:
result:
wrong output format Unexpected end of file - int32 expected