結果

問題 No.1237 EXP Multiple!
ユーザー itm_tech
提出日時 2020-09-25 23:41:14
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 262 bytes
コンパイル時間 130 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 33,404 KB
最終ジャッジ日時 2024-06-28 08:22:35
合計ジャッジ時間 3,563 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 7 WA * 8 RE * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import factorial
n = int(input())
a = [int(i) for i in input().split()]
if max(a) >= 4:
    print(-1)
    exit()
ans = 1
mod = 10 ** 9 + 7

for i in a:
    ans *= pow(i, factorial(i))
    if ans >= mod:
        print(-1)
        exit()
print(mod % ans)
0