結果
| 問題 | No.442 和と積 |
| コンテスト | |
| ユーザー |
kurenai3110
|
| 提出日時 | 2016-11-11 22:36:10 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 336 bytes |
| 記録 | |
| コンパイル時間 | 330 ms |
| コンパイル使用メモリ | 73,216 KB |
| 実行使用メモリ | 6,144 KB |
| 最終ジャッジ日時 | 2026-03-26 04:54:45 |
| 合計ジャッジ時間 | 946 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 |
ソースコード
#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);
c /= d;
e = gcd(c, b);
ll ans = d*e;
cout << ans << endl;
return 0;
}
kurenai3110