結果

問題 No.1237 EXP Multiple!
ユーザー Nagisa
提出日時 2020-09-25 23:23:44
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 311 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 32,788 KB
最終ジャッジ日時 2024-06-28 07:27:05
合計ジャッジ時間 3,261 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 15 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import factorial
MOD = 10**9 + 7
N = int(input())
A = list(map(int,input().split()))

ans = 1
for e in A:
    if e > 10:
        print(MOD)
        exit(0)
    elif e != 0:
        ans *= pow(e,factorial(e),MOD)
    if ans > MOD:
        print(MOD)
        exit(0)

print(-1 if ans == 1 else MOD%ans)
0