結果

問題 No.1237 EXP Multiple!
ユーザー mesame3993mesame3993
提出日時 2021-11-18 19:37:05
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 351 bytes
コンパイル時間 321 ms
コンパイル使用メモリ 87,264 KB
実行使用メモリ 104,984 KB
最終ジャッジ日時 2023-08-27 07:43:35
合計ジャッジ時間 4,576 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 106 ms
96,672 KB
testcase_02 AC 121 ms
99,416 KB
testcase_03 AC 121 ms
99,680 KB
testcase_04 AC 123 ms
99,304 KB
testcase_05 AC 104 ms
103,516 KB
testcase_06 WA -
testcase_07 AC 104 ms
103,456 KB
testcase_08 RE -
testcase_09 AC 105 ms
103,664 KB
testcase_10 AC 103 ms
103,624 KB
testcase_11 WA -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 AC 140 ms
104,968 KB
権限があれば一括ダウンロードができます

ソースコード

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))
    ans = mod % ans
  print(mod % ans)
main()
0