用户输出
1 35
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#47074 | #106. zxh的同值猜想 | Accepted | 100 | 43 ms | 360 K | C++ / 627 B | 大泽啧啧啧 | 2021-01-22 18:28:55 |
#include <iostream>
// #include <vector>
// #include <string>
// #include <math.h>
using namespace std;
int MaxYIN_1(int m, int n) {
int z = n;
while (m % n != 0) {
z = m % n;
m = n;
n = z;
}
return z;
}
int MaxYIN_2(int m, int n) {
while (m != n) {
if (m > n) {
m = m - n;
} else {
n = n - m;
}
}
return m;
}
int main() {
long long a, b;
cin >> a >> b;
long long result = a * b / MaxYIN_2(a, b);
cout << MaxYIN_2(a, b) << ' ';
cout << result;
return 0;
}
用户输出
7 14057750781710727
系统信息
Exited with return code 0
用户输出
2 28974979732195296
系统信息
Exited with return code 0
用户输出
3 19260972967518327
系统信息
Exited with return code 0