QOJ.ac
QOJ
The 2nd Universal Cup Finals is coming! Check out our event page, schedule, and competition rules!
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#101379 | #5253. Denormalization | DestroyXuanQuang# | WA | 0ms | 3640kb | C++23 | 679b | 2023-04-29 12:22:20 | 2023-04-29 12:22:21 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define int long long
const long double eps = 1e-3;
signed main() {
ios::sync_with_stdio(0); cin.tie(0);
int n; cin >> n;
vector<long double> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
for (int a0 = 1; a0 <= 10000; a0++) {
vector<int> r(n);
bool ok = 1;
for (int i = 0; i < n; i++) {
long double dx = a0/a[0]*a[i];
r[i] = round(dx);
if (abs(r[i] - dx) > eps) {
ok = 0; break;
}
}
if (ok) {
int g = 0;
for (int i: r) g = gcd(g, i);
if (g == 1) {
for (int i: r) {
cout << i << '\n';
}
return 0;
}
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3640kb
input:
2 0.909840249060 0.414958698174
output:
296 135
result:
wrong answer incorrect solution