結果

問題 No.1237 EXP Multiple!
ユーザー NagisaNagisa
提出日時 2020-09-25 22:57:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 260 bytes
コンパイル時間 994 ms
コンパイル使用メモリ 10,544 KB
実行使用メモリ 30,676 KB
最終ジャッジ日時 2023-09-10 16:06:03
合計ジャッジ時間 4,771 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
15,928 KB
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 AC 48 ms
12,060 KB
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10**9 + 7
N = int(input())
A = list(map(int,input().split()))
if 0 in A:
    print(-1)
    exit(0)

fac = [1 for k in range(200010)]
for k in range(2,200010):
    fac[k] = (fac[k-1]*k)%MOD

ans = 1
for e in A:
    ans *= pow(e,fac[e],MOD)
print(MOD%ans)
0