結果

問題 No.1237 EXP Multiple!
ユーザー uni_pythonuni_python
提出日時 2020-09-25 22:24:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 619 bytes
コンパイル時間 523 ms
コンパイル使用メモリ 86,984 KB
実行使用メモリ 104,264 KB
最終ジャッジ日時 2023-09-10 17:26:46
合計ジャッジ時間 3,826 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,172 KB
testcase_01 AC 120 ms
96,700 KB
testcase_02 AC 122 ms
99,176 KB
testcase_03 AC 121 ms
99,664 KB
testcase_04 AC 122 ms
99,668 KB
testcase_05 AC 103 ms
103,480 KB
testcase_06 AC 105 ms
103,416 KB
testcase_07 AC 104 ms
103,564 KB
testcase_08 AC 109 ms
104,000 KB
testcase_09 AC 104 ms
103,420 KB
testcase_10 AC 104 ms
103,628 KB
testcase_11 AC 105 ms
103,476 KB
testcase_12 AC 108 ms
104,172 KB
testcase_13 AC 108 ms
104,188 KB
testcase_14 AC 113 ms
104,264 KB
testcase_15 AC 113 ms
104,264 KB
testcase_16 AC 113 ms
104,120 KB
testcase_17 AC 114 ms
103,956 KB
testcase_18 AC 113 ms
104,132 KB
testcase_19 AC 103 ms
103,792 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=sys.stdin.readline
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N=I()
    A=LI()
    
    if min(A)==0:
        print(-1)
        exit()
        
    inf=10**10
    res=1
    for i in range(N):
        a=A[i]
        if a>=4:
            res=inf
            break
        else:
            temp=1
            for j in range(1,a+1):
                temp*=j
            res*=pow(a,temp)
        if res>=mod:
            break
        
    print(mod%res)
        
    
        
    
    


main()
0