結果

問題 No.1237 EXP Multiple!
ユーザー ygd.
提出日時 2020-09-25 23:25:05
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 249 bytes
コンパイル時間 163 ms
コンパイル使用メモリ 81,984 KB
実行使用メモリ 110,524 KB
最終ジャッジ日時 2024-06-28 07:27:20
合計ジャッジ時間 4,326 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 5 TLE * 1 -- * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
N = int(input()); MOD = pow(10,9)+7
A = list(map(int,input().split()))
if 0 in A:
  print(-1);exit()
if min(A) >= 4:
  print(MOD);exit()
ans = 1
for x in A:
  kata = math.factorial(x)
  temp = pow(x,kata)
  ans = ans*temp
print(MOD%ans)
0