結果

問題 No.1237 EXP Multiple!
ユーザー lloyz
提出日時 2022-02-06 00:10:53
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 315 bytes
コンパイル時間 106 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 32,748 KB
最終ジャッジ日時 2024-06-11 13:41:31
合計ジャッジ時間 4,791 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 5 TLE * 1 -- * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int, input().split()))
mod = 10**9 + 7

if min(A) == 0:
    print(-1)
elif max(A) >= 4:
    print(mod)
else:
    ans = 1
    for i in range(n):
        cnt = 1
        for j in range(1, A[i] + 1):
            cnt *= j
        ans *= pow(A[i], cnt)
    print(mod % ans)
0