【Codeforces 664A】 Complicated GCD

【题目链接】

          点击打开链接

【算法】

          gcd(a,a+1) = 1

          所以当a = b时,答案为a,否则为1

【代码】

          

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

string a,b;

int main() {
        
        cin >> a >> b;
        if (a == b) cout<< a << endl;
        else cout<< 1 << endl;
        
        return 0;
    
}
原文地址:https://www.cnblogs.com/evenbao/p/9196407.html