結果
| 問題 |
No.442 和と積
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-04-14 18:06:14 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 1,000 ms |
| コード長 | 336 bytes |
| コンパイル時間 | 849 ms |
| コンパイル使用メモリ | 67,200 KB |
| 最終ジャッジ日時 | 2025-01-09 18:47:36 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 |
ソースコード
#include <iostream>
#include <numeric>
using lint = long long;
void solve() {
lint a, b;
std::cin >> a >> b;
auto g = std::gcd(a, b);
a /= g, b /= g;
std::cout << g * std::gcd(g, a + b) << std::endl;
}
int main() {
std::cin.tie(nullptr);
std::ios::sync_with_stdio(false);
solve();
return 0;
}