QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#740741 | #9622. 有限小数 | tovi | WA | 0ms | 3584kb | C++14 | 578b | 2024-11-13 11:19:59 | 2024-11-13 11:20:00 |
Judging History
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)