結果

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

ソースコード

diff #

g = [1,1,2,6]

N = int(input())
A = list(map(int,input().split()))

if 0 in A:
    print(-1)
else:
    res = 1
    for i in range(N):
        if A[i]>=4:
            exit(print(10**9+7))
        else:
            res *= pow(A[i],g[A[i]])
            if res >= 10**9+7:
                exit(print(10**9+7))
    print((10**9+7)%res)
0