結果

問題 No.1237 EXP Multiple!
ユーザー ibyiby
提出日時 2020-11-27 02:18:35
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 333 bytes
コンパイル時間 167 ms
コンパイル使用メモリ 10,580 KB
実行使用メモリ 30,748 KB
最終ジャッジ日時 2023-10-01 03:50:40
合計ジャッジ時間 4,528 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
20,636 KB
testcase_01 AC 73 ms
23,896 KB
testcase_02 AC 88 ms
29,220 KB
testcase_03 AC 88 ms
30,348 KB
testcase_04 AC 92 ms
30,748 KB
testcase_05 AC 48 ms
12,148 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 #

import math
MOD = 10**9 + 7
n = int(input())
a = list(map(int, input().split()))
if any(v == 0 for v in a):
    print(-1)
    exit()
if max(a) > 3:
    print(MOD)
    exit()
else:
    ans = 1
    for v in a:
        ans *= pow(v, math.factorial(v))
    if ans > MOD:
        print(MOD)
        exit()
    print(MOD % ans)
    exit()
0