結果
問題 |
No.442 和と積
|
ユーザー |
![]() |
提出日時 | 2022-06-09 20:02:15 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 659 bytes |
コンパイル時間 | 1,898 ms |
コンパイル使用メモリ | 192,480 KB |
最終ジャッジ日時 | 2025-01-29 19:20:38 |
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i,n) for(ll i=0;i<ll(n);i++) #define REPD(i,n) for(ll i=n-1;i>=0;i--) #define FOR(i,a,b) for(ll i=a;i<=ll(b);i++) #define FORD(i,a,b) for(ll i=a;i>=ll(b);i--) #define ALL(x) x.begin(),x.end() 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; } const long long INF = 1LL << 60; const ll MOD = 1000000007; //10^9+7:合同式の法 int main(){ ll A, B; cin >> A >> B; ll g = gcd(A, B); cout << g * gcd((A + B) / g, g) << endl; return 0; }