結果
問題 |
No.442 和と積
|
ユーザー |
|
提出日時 | 2017-08-25 21:44:14 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 655 bytes |
コンパイル時間 | 811 ms |
コンパイル使用メモリ | 102,364 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-04 23:07:43 |
合計ジャッジ時間 | 1,538 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
ソースコード
#include "iostream" #include "climits" #include "list" #include "queue" #include "stack" #include "set" #include "functional" #include "algorithm" #include "string" #include "map" #include "iomanip" #include "random" using namespace std; const long long int MOD = 1000000007; const long double EPS = 0.00000001; long long int N, M, K, W, H, L, R; long long int LCM(long long int a, long long int b) { if (a < b)swap(a, b); while (b) { a %= b; swap(a, b); } return a; } int main() { ios::sync_with_stdio(false); cin.tie(0); cin >> N >> M; K = N + M; long long int box = LCM(N, K); K /= box; cout << LCM(K, M)*box << endl; return 0; }