結果

問題 No.1237 EXP Multiple!
ユーザー brthyyjpbrthyyjp
提出日時 2020-09-28 04:13:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 155 ms / 2,000 ms
コード長 313 bytes
コンパイル時間 263 ms
コンパイル使用メモリ 87,284 KB
実行使用メモリ 104,980 KB
最終ジャッジ日時 2023-09-13 15:53:20
合計ジャッジ時間 4,854 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,596 KB
testcase_01 AC 128 ms
99,824 KB
testcase_02 AC 154 ms
101,256 KB
testcase_03 AC 155 ms
101,364 KB
testcase_04 AC 123 ms
99,460 KB
testcase_05 AC 104 ms
103,964 KB
testcase_06 AC 106 ms
104,032 KB
testcase_07 AC 109 ms
104,548 KB
testcase_08 AC 110 ms
104,808 KB
testcase_09 AC 104 ms
103,756 KB
testcase_10 AC 108 ms
104,376 KB
testcase_11 AC 106 ms
104,104 KB
testcase_12 AC 105 ms
104,132 KB
testcase_13 AC 109 ms
104,656 KB
testcase_14 AC 109 ms
104,980 KB
testcase_15 AC 116 ms
104,804 KB
testcase_16 AC 108 ms
104,540 KB
testcase_17 AC 108 ms
104,900 KB
testcase_18 AC 109 ms
104,588 KB
testcase_19 AC 102 ms
103,908 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int, input().split()))
import math
A.sort()
if A[0] == 0:
    print(-1)
elif max(A) >= 4:
    print(10**9+7)
else:
    t = 1
    for a in A:
        t *= a**math.factorial(a)
        if t >= 10**9+7:
            print(10**9+7)
            exit()
    else:
        print((10**9+7)%t)
0