QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#740741#9622. 有限小数toviWA 0ms3584kbC++14578b2024-11-13 11:19:592024-11-13 11:20:00

Judging History

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

  • [2024-11-13 11:20:00]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3584kb
  • [2024-11-13 11:19:59]
  • 提交

answer

#include <iostream>
using namespace std;

// 将一个数分解质因数,只保留2和5,返回其余部分
int reduceToTwoAndFive(int n) {
    while (n % 2 == 0) n /= 2;
    while (n % 5 == 0) n /= 5;
    return n;
}

int main() {
    int T;
    cin >> T;
    while (T--) {
        int a, b;
        cin >> a >> b;

        // 通过分解b来决定d
        int reduced_b = reduceToTwoAndFive(b);

        // 选择d为reduced_b,c为a
        int c = a;
        int d = reduced_b;

        cout << c << " " << d << endl;
    }
    return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3584kb

input:

4
1 2
2 3
3 7
19 79

output:

1 1
2 3
3 7
19 79

result:

wrong answer Jury found better answer than participant's 0 < 1 (Testcase 1)