結果

問題 No.1237 EXP Multiple!
コンテスト
ユーザー ygd.
提出日時 2020-09-25 23:25:05
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
TLE  
実行時間 -
コード長 249 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 197 ms
コンパイル使用メモリ 85,540 KB
実行使用メモリ 205,856 KB
最終ジャッジ日時 2026-03-16 18:51:10
合計ジャッジ時間 16,568 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 17 TLE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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