結果

問題 No.1237 EXP Multiple!
ユーザー NatsubiSoganNatsubiSogan
提出日時 2020-09-25 21:38:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 136 ms / 2,000 ms
コード長 323 bytes
コンパイル時間 315 ms
コンパイル使用メモリ 10,524 KB
実行使用メモリ 30,812 KB
最終ジャッジ日時 2023-09-10 17:22:26
合計ジャッジ時間 3,314 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,948 KB
testcase_01 AC 93 ms
23,780 KB
testcase_02 AC 128 ms
29,404 KB
testcase_03 AC 125 ms
30,272 KB
testcase_04 AC 79 ms
30,812 KB
testcase_05 AC 49 ms
12,188 KB
testcase_06 AC 51 ms
12,176 KB
testcase_07 AC 55 ms
12,232 KB
testcase_08 AC 136 ms
12,312 KB
testcase_09 AC 49 ms
12,256 KB
testcase_10 AC 53 ms
12,268 KB
testcase_11 AC 52 ms
12,168 KB
testcase_12 AC 135 ms
12,268 KB
testcase_13 AC 133 ms
12,268 KB
testcase_14 AC 135 ms
12,212 KB
testcase_15 AC 135 ms
12,272 KB
testcase_16 AC 135 ms
12,296 KB
testcase_17 AC 134 ms
12,168 KB
testcase_18 AC 133 ms
12,348 KB
testcase_19 AC 48 ms
12,268 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import factorial
n = int(input())
a = list(map(int, input().split()))
a.sort()
if 0 in a:
    exit(print(-1))
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