結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,000 KB
testcase_01 AC 66 ms
23,736 KB
testcase_02 AC 83 ms
29,360 KB
testcase_03 AC 83 ms
30,168 KB
testcase_04 AC 85 ms
30,732 KB
testcase_05 AC 116 ms
12,200 KB
testcase_06 AC 56 ms
12,200 KB
testcase_07 AC 113 ms
12,228 KB
testcase_08 AC 115 ms
12,324 KB
testcase_09 AC 110 ms
12,156 KB
testcase_10 AC 115 ms
12,140 KB
testcase_11 AC 57 ms
12,284 KB
testcase_12 AC 57 ms
12,240 KB
testcase_13 AC 115 ms
12,148 KB
testcase_14 AC 120 ms
12,228 KB
testcase_15 AC 115 ms
12,324 KB
testcase_16 AC 111 ms
12,196 KB
testcase_17 AC 110 ms
12,280 KB
testcase_18 AC 121 ms
12,232 KB
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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