結果

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

ソースコード

diff #

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

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