結果

問題 No.1237 EXP Multiple!
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2020-09-25 23:37:52
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 323 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 87,172 KB
実行使用メモリ 105,064 KB
最終ジャッジ日時 2023-09-10 17:11:17
合計ジャッジ時間 4,011 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,052 KB
testcase_01 AC 107 ms
96,876 KB
testcase_02 AC 120 ms
99,344 KB
testcase_03 AC 120 ms
99,192 KB
testcase_04 AC 122 ms
99,188 KB
testcase_05 RE -
testcase_06 AC 105 ms
103,464 KB
testcase_07 RE -
testcase_08 AC 108 ms
104,496 KB
testcase_09 RE -
testcase_10 RE -
testcase_11 AC 106 ms
103,472 KB
testcase_12 AC 109 ms
104,344 KB
testcase_13 AC 109 ms
104,176 KB
testcase_14 AC 109 ms
104,160 KB
testcase_15 AC 113 ms
104,092 KB
testcase_16 AC 114 ms
104,380 KB
testcase_17 AC 113 ms
104,360 KB
testcase_18 AC 114 ms
104,388 KB
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

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

for i in A:

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

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

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