結果
問題 |
No.1237 EXP Multiple!
|
ユーザー |
|
提出日時 | 2020-10-09 06:17:17 |
言語 | Ruby (3.4.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 281 bytes |
コンパイル時間 | 97 ms |
コンパイル使用メモリ | 7,296 KB |
実行使用メモリ | 97,580 KB |
最終ジャッジ日時 | 2024-07-20 06:38:21 |
合計ジャッジ時間 | 5,649 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 5 TLE * 1 -- * 13 |
コンパイルメッセージ
Syntax OK
ソースコード
# frozen_string_literal: true L = 10**9 + 7 class Integer def fact (1..self).reduce(:*) end end def solve if A.any?(&:zero?) -1 elsif A.max >= 4 L else L % A.map { _1**_1.fact }.reduce(:*) end end N = gets.to_i A = gets.split.map(&:to_i) puts solve