結果
| 問題 |
No.368 LCM of K-products
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-06-02 17:59:25 |
| 言語 | Ruby (3.4.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 228 bytes |
| コンパイル時間 | 127 ms |
| コンパイル使用メモリ | 7,296 KB |
| 実行使用メモリ | 39,424 KB |
| 最終ジャッジ日時 | 2024-10-08 05:48:55 |
| 合計ジャッジ時間 | 6,748 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 1 -- * 34 |
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n Syntax OK
ソースコード
n, k = gets.split.map(&:to_i) arr = gets.split.map(&:to_i) arr2 = Array.new arr.combination(k) do |item| arr2.push(item.inject(:*)) end ans = arr2[0] (1..(arr2.size-1)).each do |i| ans = ans.lcm(arr2[i]) end p ans % (10**9+7)