結果

問題 No.442 和と積
ユーザー RyuRyu
提出日時 2018-01-04 00:00:36
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 266 bytes
コンパイル時間 794 ms
コンパイル使用メモリ 65,588 KB
実行使用メモリ 4,508 KB
最終ジャッジ日時 2023-08-24 18:06:55
合計ジャッジ時間 1,841 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 2 ms
4,384 KB
testcase_03 AC 2 ms
4,384 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 2 ms
4,380 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 2 ms
4,384 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>

using namespace std;
using ll = long long int;

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

int main()
{
    ll A, B;
    cin >> A >> B;
    ll d = gcd(A, B);
    cout << d * gcd(A / d * B / d, d) << endl;
}
0