結果

問題 No.1237 EXP Multiple!
ユーザー ygd.
提出日時 2020-09-25 23:26:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,745 ms / 2,000 ms
コード長 288 bytes
コンパイル時間 272 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 107,696 KB
最終ジャッジ日時 2024-06-28 08:39:22
合計ジャッジ時間 15,911 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

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
  if ans >= MOD:
    print(MOD);exit()
print(MOD%ans)
0