結果

問題 No.1237 EXP Multiple!
ユーザー 👑 SPD_9X2
提出日時 2020-09-30 22:54:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,616 ms / 2,000 ms
コード長 354 bytes
コンパイル時間 165 ms
コンパイル使用メモリ 82,192 KB
実行使用メモリ 104,108 KB
最終ジャッジ日時 2024-07-06 13:43:35
合計ジャッジ時間 14,191 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin
import math
import sys
mod = 10**9+7

N = int(input())

A = list(map(int,stdin.readline().split()))

now = 1
if 0 in A:
    print (-1)
    sys.exit()

for i in A:

    if i > 10 or now > 10**9+7:
        print (10**9+7)
        sys.exit()

    now *= i ** math.factorial(i)


if now == 0:
    print (-1)
else:
    print (mod % now)
0