QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#285486#5253. Denormalizationlight_ink_dots#WA 1ms3692kbC++14780b2023-12-16 19:38:242023-12-16 19:38:25

Judging History

你现在查看的是最新测评结果

  • [2023-12-16 19:38:25]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3692kb
  • [2023-12-16 19:38:24]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

int main() {
    static const int maxn = 10010;
    int n;
    scanf("%d", &n);
    static double x[maxn];
    for (int i = 1; i <= n; i++) scanf("%lf", x + i);
    for (int a = 1; a <= 10000; a++) {
        double s = a / x[1];
        if (s * s - (int)(s * s) >= 1e-2)
            continue;
        static int ans[maxn];
        ans[1] = a;
        bool flag = true;
        for (int i = 2; i <= n; i++) {
            ans[i] = x[i] * s;
            if (ans[i] - (int)ans[i] >= 1e-2) {
                flag = false;
                break;
            }
        }
        if (flag) {
            for (int i = 1; i <= n; i++) printf("%d\n", ans[i]);
            return 0;
        }
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3692kb

input:

2
0.909840249060
0.414958698174

output:

25
11

result:

wrong answer incorrect solution