結果
| 問題 | No.442 和と積 | 
| コンテスト | |
| ユーザー |  lanlonow | 
| 提出日時 | 2016-11-12 11:01:32 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 1,000 ms | 
| コード長 | 468 bytes | 
| コンパイル時間 | 5,807 ms | 
| コンパイル使用メモリ | 299,052 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-25 19:47:45 | 
| 合計ジャッジ時間 | 6,500 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 18 | 
ソースコード
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define all(c) begin(c), end(c)
namespace mp = boost::multiprecision;
inline mp::cpp_int gcd(mp::cpp_int a, mp::cpp_int b) { return b ? gcd(b, a%b) : a; }
int main() {
	mp::cpp_int A, B;
	cin >> A >> B;
	cout << gcd(A + B, A*B) << endl;
	return 0;
}
            
            
            
        