QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#89627 | #5253. Denormalization | VellyK | WA | 2ms | 3476kb | C++14 | 759b | 2023-03-20 19:55:20 | 2023-03-20 19:55:22 |
Judging History
answer
#include <bits/stdc++.h>
#define x first
#define y second
using namespace std;
using LL = long long;
using PLL = pair<LL, LL>;
using PII = pair<int, int>;
constexpr int N = 400000 + 9;
int gcd(int a, int b)
{
return b ? gcd(b, a%b) : a;
}
void solve()
{
int n;
scanf("%d", &n);
vector<int> v;
for(int i=0;i<n;i++)
{
double t;
scanf("%lf", &t);
v.push_back(t*10000+0.5);
}
int g = 0;
for(int i : v)
g = gcd(g, i);
for(int i : v)
cout << i/g << '\n';
}
int main()
{
// ios::sync_with_stdio(false);
// cin.tie(nullptr);
// cout.tie(nullptr);
int T = 1;
// cin >> T;
while (T--)
{
solve();
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 3476kb
input:
2 0.909840249060 0.414958698174
output:
4549 2075
result:
wrong answer incorrect solution