結果

問題 No.1237 EXP Multiple!
ユーザー NagisaNagisa
提出日時 2020-09-25 23:36:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 116 ms / 2,000 ms
コード長 338 bytes
コンパイル時間 249 ms
コンパイル使用メモリ 10,596 KB
実行使用メモリ 30,356 KB
最終ジャッジ日時 2023-09-10 17:30:29
合計ジャッジ時間 3,099 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,932 KB
testcase_01 AC 60 ms
23,740 KB
testcase_02 AC 77 ms
29,404 KB
testcase_03 AC 76 ms
30,356 KB
testcase_04 AC 81 ms
30,012 KB
testcase_05 AC 48 ms
12,272 KB
testcase_06 AC 51 ms
12,248 KB
testcase_07 AC 49 ms
12,144 KB
testcase_08 AC 116 ms
12,168 KB
testcase_09 AC 49 ms
12,176 KB
testcase_10 AC 48 ms
12,216 KB
testcase_11 AC 51 ms
12,240 KB
testcase_12 AC 104 ms
12,212 KB
testcase_13 AC 110 ms
12,292 KB
testcase_14 AC 111 ms
12,144 KB
testcase_15 AC 109 ms
12,140 KB
testcase_16 AC 116 ms
12,324 KB
testcase_17 AC 110 ms
12,200 KB
testcase_18 AC 112 ms
12,204 KB
testcase_19 AC 50 ms
12,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import factorial
MOD = 10**9 + 7
N = int(input())
A = list(map(int,input().split()))
if 0 in A:
    print(-1)
    exit(0)
ans = 1
for e in A:
    if e > 10:
        print(MOD)
        exit(0)
    ans *= pow(e,factorial(e))
    if ans > MOD:
        print(MOD)
        exit(0)
if ans == 0:
    print(-1)
else:
    print(MOD%ans)
0