結果

問題 No.1237 EXP Multiple!
ユーザー mesame3993mesame3993
提出日時 2021-11-18 19:38:04
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 371 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 87,204 KB
実行使用メモリ 104,928 KB
最終ジャッジ日時 2023-08-27 07:45:30
合計ジャッジ時間 3,868 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,220 KB
testcase_01 AC 97 ms
96,456 KB
testcase_02 AC 119 ms
99,268 KB
testcase_03 AC 122 ms
99,432 KB
testcase_04 AC 123 ms
99,172 KB
testcase_05 AC 103 ms
103,396 KB
testcase_06 WA -
testcase_07 AC 107 ms
103,416 KB
testcase_08 WA -
testcase_09 AC 103 ms
103,452 KB
testcase_10 AC 105 ms
103,204 KB
testcase_11 WA -
testcase_12 AC 110 ms
104,144 KB
testcase_13 AC 111 ms
103,988 KB
testcase_14 AC 111 ms
104,180 KB
testcase_15 AC 109 ms
104,040 KB
testcase_16 AC 104 ms
104,388 KB
testcase_17 AC 106 ms
104,400 KB
testcase_18 AC 106 ms
103,952 KB
testcase_19 AC 134 ms
104,700 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))
    if ans > mod:
      ans = mod % ans
  print(mod % ans)
main()
0