結果

問題 No.1237 EXP Multiple!
ユーザー uni_python
提出日時 2020-09-25 22:24:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 110 ms / 2,000 ms
コード長 619 bytes
コンパイル時間 208 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 105,344 KB
最終ジャッジ日時 2024-06-28 08:35:29
合計ジャッジ時間 2,882 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=sys.stdin.readline
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N=I()
    A=LI()
    
    if min(A)==0:
        print(-1)
        exit()
        
    inf=10**10
    res=1
    for i in range(N):
        a=A[i]
        if a>=4:
            res=inf
            break
        else:
            temp=1
            for j in range(1,a+1):
                temp*=j
            res*=pow(a,temp)
        if res>=mod:
            break
        
    print(mod%res)
        
    
        
    
    


main()
0