結果

問題 No.442 和と積
ユーザー stone_725
提出日時 2018-07-03 14:52:55
言語 C++17(clang)
(17.0.6 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 480 bytes
コンパイル時間 1,988 ms
コンパイル使用メモリ 161,624 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-30 12:34:51
合計ジャッジ時間 2,945 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

unsigned long long gcd(unsigned long long a, unsigned long long b) {
	return b ? gcd(b, a % b) : a;
}

void hawawa()
{
	unsigned long long a, b;
	cin >> a >> b;
	unsigned long long score1 = gcd(a + b, a);
	unsigned long long score2 = gcd(a + b, b);
	unsigned long long score3 = gcd(a + b, a / gcd(score1, score2));
	cout << score2 * score3 << "\n";
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	hawawa();
	return 0;
}
0