QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#89627#5253. DenormalizationVellyKWA 2ms3476kbC++14759b2023-03-20 19:55:202023-03-20 19:55:22

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-20 19:55:22]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3476kb
  • [2023-03-20 19:55:20]
  • 提交

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