結果

問題 No.1237 EXP Multiple!
ユーザー itm_techitm_tech
提出日時 2020-09-25 23:41:14
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 262 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 10,744 KB
実行使用メモリ 30,884 KB
最終ジャッジ日時 2023-09-10 17:12:24
合計ジャッジ時間 3,106 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,868 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 RE -
testcase_06 WA -
testcase_07 RE -
testcase_08 WA -
testcase_09 RE -
testcase_10 RE -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 116 ms
12,280 KB
testcase_14 AC 112 ms
12,152 KB
testcase_15 AC 114 ms
12,308 KB
testcase_16 AC 113 ms
12,152 KB
testcase_17 AC 114 ms
12,276 KB
testcase_18 AC 113 ms
12,156 KB
testcase_19 AC 56 ms
12,300 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import factorial
n = int(input())
a = [int(i) for i in input().split()]
if max(a) >= 4:
    print(-1)
    exit()
ans = 1
mod = 10 ** 9 + 7

for i in a:
    ans *= pow(i, factorial(i))
    if ans >= mod:
        print(-1)
        exit()
print(mod % ans)
0