結果

問題 No.442 和と積
ユーザー stone_725stone_725
提出日時 2018-07-03 14:52:55
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 480 bytes
コンパイル時間 1,935 ms
コンパイル使用メモリ 133,092 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-20 10:51:13
合計ジャッジ時間 2,804 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 WA -
testcase_05 AC 2 ms
4,380 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 2 ms
4,380 KB
testcase_10 WA -
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 WA -
testcase_17 AC 2 ms
4,376 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

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