結果

問題 No.1237 EXP Multiple!
ユーザー FromBooskaFromBooska
提出日時 2023-02-15 15:22:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 178 ms / 2,000 ms
コード長 374 bytes
コンパイル時間 403 ms
コンパイル使用メモリ 87,220 KB
実行使用メモリ 111,212 KB
最終ジャッジ日時 2023-09-25 00:22:03
合計ジャッジ時間 4,354 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
71,916 KB
testcase_01 AC 157 ms
100,896 KB
testcase_02 AC 178 ms
111,108 KB
testcase_03 AC 176 ms
111,212 KB
testcase_04 AC 144 ms
110,552 KB
testcase_05 AC 124 ms
105,080 KB
testcase_06 AC 125 ms
105,356 KB
testcase_07 AC 128 ms
105,596 KB
testcase_08 AC 131 ms
105,564 KB
testcase_09 AC 125 ms
104,948 KB
testcase_10 AC 130 ms
105,684 KB
testcase_11 AC 129 ms
105,384 KB
testcase_12 AC 124 ms
105,352 KB
testcase_13 AC 128 ms
105,792 KB
testcase_14 AC 128 ms
105,620 KB
testcase_15 AC 128 ms
105,628 KB
testcase_16 AC 128 ms
105,880 KB
testcase_17 AC 131 ms
106,004 KB
testcase_18 AC 128 ms
105,664 KB
testcase_19 AC 123 ms
104,952 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import factorial
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
A.sort()
if 0 in A:
    ans = -1
elif max(A) >= 4:
    ans = 10**9+7
else:
    product = 1
    for a in A:
        product *= pow(a, factorial(a))
        if product > 10**9+7:
            print(10**9+7)
            exit()
    ans = (10**9+7)%product
print(ans)
0