結果

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

ソースコード

diff #

from math import factorial
n = int(input())
a = list(map(int, input().split()))
a.sort()
if 0 in a:
    exit(print(0))
ans = 1
for i in range(n):
    if a[i] >= 18:
        exit(print(10 ** 9 + 7))
    ans *= pow(a[i], factorial(a[i]))
    if ans >= 10 ** 9 + 7:
        exit(print(10 ** 9 + 7))
print((10 ** 9 + 7) % ans)
0