結果
問題 | No.442 和と積 |
ユーザー |
![]() |
提出日時 | 2016-11-19 01:12:02 |
言語 | C++11 (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 366 bytes |
コンパイル時間 | 684 ms |
コンパイル使用メモリ | 58,636 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-26 10:35:44 |
合計ジャッジ時間 | 1,347 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 WA * 7 |
ソースコード
#include <iostream> #include <sstream> #include <algorithm> #include <cstdio> using namespace std; typedef long long LL; LL gcd(LL a, LL b) { return b ? gcd(b, a % b) : a; } int main(int argc, char *argv[]) { LL a, b; cin >> a >> b; LL ab = a + b, ga = gcd(a, ab), gb = gcd(b, ab), g = gcd(ga, gb); LL ans = (ga / g) * gb; cout << ans << endl; return 0; }