結果
| 問題 | No.442 和と積 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2019-04-09 22:31:33 | 
| 言語 | Nim (2.2.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 1,000 ms | 
| コード長 | 318 bytes | 
| コンパイル時間 | 3,220 ms | 
| コンパイル使用メモリ | 66,024 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-07-01 23:03:48 | 
| 合計ジャッジ時間 | 3,880 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 18 | 
ソースコード
import seqUtils, strutils
proc gcd(a, b:int64): int64 =
  var
    big = max(a, b)
    small = min(a, b)
  while small > 0:
    (big, small) = (small, big mod small)
  return big
let
  tmp: seq[int64] = stdin.readLine.split.map parseBiggestInt
  (a, b) = (tmp[0], tmp[1])
  g = gcd(a, b)
echo g * gcd((a+b) div g, g)
            
            
            
        