結果

問題 No.442 和と積
ユーザー Ginatia
提出日時 2024-05-30 18:13:16
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 246 bytes
コンパイル時間 1,792 ms
コンパイル使用メモリ 192,796 KB
最終ジャッジ日時 2025-02-21 17:09:16
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using i64 = long long;
void solve()
{
  i64 a,b;
  std::cin>>a>>b;
  i64 g=std::gcd(a,b);
  a/=g,b/=g;
  std::cout<<g*std::gcd(a+b,g)<<'\n';
}
int main()
{
    std::cin.tie(nullptr)->sync_with_stdio(false);
    solve();
}
0