結果

問題 No.1237 EXP Multiple!
ユーザー mesame3993mesame3993
提出日時 2021-11-18 19:36:36
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 331 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 87,196 KB
実行使用メモリ 103,364 KB
最終ジャッジ日時 2023-08-27 07:42:53
合計ジャッジ時間 7,502 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,136 KB
testcase_01 AC 95 ms
96,508 KB
testcase_02 AC 120 ms
99,008 KB
testcase_03 AC 116 ms
99,336 KB
testcase_04 AC 117 ms
99,360 KB
testcase_05 AC 100 ms
103,364 KB
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
  from sys import stdin
  import math
  readline=stdin.readline
  n = int(readline())
  A = list(map(int, readline().split()))
  mod = 10**9 + 7
  ans = 1
  for a in A:
    if a == 0:
      print(-1)
      exit()
    if a >= 4:
      print(mod)
      exit()
    ans *= pow(a,math.factorial(a))
  print(mod % ans)
main()
0