結果

問題 No.1237 EXP Multiple!
ユーザー daikisuyama
提出日時 2020-09-26 11:07:34
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 272 bytes
コンパイル時間 220 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 110,508 KB
最終ジャッジ日時 2024-06-28 21:07:49
合計ジャッジ時間 4,231 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 4 WA * 1 TLE * 1 -- * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a=list(map(int,input().split()))
#ギャグ
mod=10**9+7
if max(a)>3:
    print(mod)
    exit()
if min(a)==0:
    print(0)
    exit()
ans=1
for i in a:
    sub=1
    for j in range(i):
        sub*=(j+1)
    ans*=(i**sub)
print(mod%ans if mod%ans!=0 else -1)
0