結果

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

ソースコード

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
    Fact = [1, 1, 2, 6]
    for i in range(n):
        ans *= pow(A[i], Fact[A[i]])
        if ans > mod:
            break
    print(mod % ans)
0