結果

問題 No.1237 EXP Multiple!
ユーザー lloyzlloyz
提出日時 2022-02-06 00:10:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 315 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 10,572 KB
実行使用メモリ 30,752 KB
最終ジャッジ日時 2023-09-02 06:53:01
合計ジャッジ時間 5,456 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,964 KB
testcase_01 AC 65 ms
23,824 KB
testcase_02 AC 81 ms
29,212 KB
testcase_03 AC 79 ms
30,156 KB
testcase_04 AC 83 ms
30,752 KB
testcase_05 AC 51 ms
12,168 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 #

n = int(input())
A = list(map(int, input().split()))
mod = 10**9 + 7

if min(A) == 0:
    print(-1)
elif max(A) >= 4:
    print(mod)
else:
    ans = 1
    for i in range(n):
        cnt = 1
        for j in range(1, A[i] + 1):
            cnt *= j
        ans *= pow(A[i], cnt)
    print(mod % ans)
0