题解 | 复杂的最大公约数

复杂的最大公约数

https://www.nowcoder.com/practice/992a24ff72be4991bf099ae681bec68b

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

using ll=long long;
using ull=unsigned long long;
using i128=__int128_t;
using u128=__uint128_t;
using ld=long double;

void solve()
{
	string a,b;//注意到区间中每个数只相差1 所以如果只有一个数 gcd就是本身 如果一个数以上 gcd只能是1 另外输入的数可能极大 我们需要将其当成字符串输入
	cin >> a >> b;
	if(a==b) cout << a;
	else cout << 1;
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	
	int t=1;
	//cin >> t;
	
	while(t--)
	{
		solve();
	}
	return 0;
}

全部评论

相关推荐

评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务