結果
問題 |
No.442 和と積
|
ユーザー |
|
提出日時 | 2022-08-02 00:07:29 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 447 bytes |
コンパイル時間 | 2,087 ms |
コンパイル使用メモリ | 191,404 KB |
最終ジャッジ日時 | 2025-01-30 17:11:38 |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<(int)(n);i++) template<class T> inline bool chmax(T&a,T b){if(a<b){a=b;return 1;}return 0;} template<class T> inline bool chmin(T&a,T b){if(a>b){a=b;return 1;}return 0;} using ll = long long; ll a,b; int main () { ios::sync_with_stdio(false); cin.tie(0); cin >> a >> b; ll g=gcd(a,b); a/=g, b/=g; cout << g*gcd(a+b,g) << '\n'; return 0; }