結果

問題 No.1237 EXP Multiple!
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2020-09-30 22:54:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 354 bytes
コンパイル時間 257 ms
コンパイル使用メモリ 87,200 KB
実行使用メモリ 104,388 KB
最終ジャッジ日時 2023-09-20 18:50:16
合計ジャッジ時間 4,869 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,240 KB
testcase_01 AC 102 ms
96,740 KB
testcase_02 AC 125 ms
99,272 KB
testcase_03 AC 119 ms
99,232 KB
testcase_04 AC 122 ms
99,060 KB
testcase_05 AC 102 ms
103,184 KB
testcase_06 AC 103 ms
103,240 KB
testcase_07 AC 102 ms
103,288 KB
testcase_08 AC 108 ms
104,048 KB
testcase_09 AC 103 ms
103,512 KB
testcase_10 AC 102 ms
103,516 KB
testcase_11 AC 102 ms
103,208 KB
testcase_12 AC 112 ms
104,292 KB
testcase_13 AC 109 ms
104,064 KB
testcase_14 AC 108 ms
104,092 KB
testcase_15 AC 109 ms
104,160 KB
testcase_16 AC 107 ms
104,016 KB
testcase_17 AC 108 ms
104,388 KB
testcase_18 AC 109 ms
104,284 KB
testcase_19 AC 103 ms
103,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin
import math
import sys
mod = 10**9+7

N = int(input())

A = list(map(int,stdin.readline().split()))

now = 1
if 0 in A:
    print (-1)
    sys.exit()

for i in A:

    if i > 10 or now > 10**9+7:
        print (10**9+7)
        sys.exit()

    now *= i ** math.factorial(i)


if now == 0:
    print (-1)
else:
    print (mod % now)
0