結果

問題 No.1237 EXP Multiple!
ユーザー aqua_tenhouaqua_tenhou
提出日時 2021-06-20 22:44:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 373 bytes
コンパイル時間 282 ms
コンパイル使用メモリ 87,172 KB
実行使用メモリ 105,244 KB
最終ジャッジ日時 2023-09-05 01:42:58
合計ジャッジ時間 5,118 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,572 KB
testcase_01 AC 110 ms
98,232 KB
testcase_02 AC 123 ms
100,148 KB
testcase_03 AC 123 ms
100,268 KB
testcase_04 AC 125 ms
99,548 KB
testcase_05 AC 104 ms
104,216 KB
testcase_06 AC 103 ms
104,056 KB
testcase_07 AC 101 ms
104,160 KB
testcase_08 AC 131 ms
105,232 KB
testcase_09 AC 102 ms
104,024 KB
testcase_10 AC 101 ms
104,012 KB
testcase_11 AC 103 ms
104,012 KB
testcase_12 AC 104 ms
104,008 KB
testcase_13 AC 126 ms
105,060 KB
testcase_14 AC 128 ms
104,964 KB
testcase_15 AC 129 ms
105,032 KB
testcase_16 AC 127 ms
105,244 KB
testcase_17 AC 127 ms
105,024 KB
testcase_18 AC 127 ms
105,172 KB
testcase_19 AC 103 ms
104,140 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int,input().split()))

def fact(n):
    ret = 1
    for i in range(1,n+1):
        ret *= i
    return ret

if min(a) == 0:
    print(-1)
elif max(a) >= 4:
    print(10**9 + 7)

else:
    ans = 1
    for x in a:
        ans *= x**fact(x)
        if ans >= 10**9 + 7:
            print(10**9 + 7)
            exit()
    print((10**9 + 7)%ans)

0