結果

問題 No.442 和と積
ユーザー kurenai3110
提出日時 2016-11-11 22:31:59
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 334 bytes
コンパイル時間 375 ms
コンパイル使用メモリ 58,028 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-25 08:29:49
合計ジャッジ時間 983 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
using namespace std;
typedef long long ll;

ll gcd(ll a, ll b) {
	while (a) {
		b %= a;
		swap(a, b);
	}
	return b;
}

int main()
{
	ll a, b; cin >> a >> b;
	ll c = a + b;

	ll d, e;
	d = gcd(c, a);
	e = gcd(d, b);


	ll ans = gcd(d, e);

	cout << ans << endl;

    return 0;
}
0