結果
| 問題 | No.442 和と積 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2023-06-08 11:01:08 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 3 ms / 1,000 ms | 
| コード長 | 468 bytes | 
| コンパイル時間 | 1,066 ms | 
| コンパイル使用メモリ | 81,612 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-12-30 18:12:51 | 
| 合計ジャッジ時間 | 1,866 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 18 | 
ソースコード
#include<iostream>
#include<set>
#include<algorithm>
#include<vector>
#include<string>
#include<set>
#include<map>
#include<stack>
#include<numeric>
#include<queue>
#include<cmath>
#include<deque>
#include<cassert>
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;
const ll INF=1LL<<60;
ll gcd(ll x,ll y){
    return y==0?x:gcd(y,x%y);
}
int main(){
    ll A,B;
    cin>>A>>B;
    ll g=gcd(A,B);
    ll ans=g*gcd(A/g+B/g,g);
    cout<<ans<<endl;
    
}
            
            
            
        