結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,268 KB
testcase_01 AC 99 ms
96,696 KB
testcase_02 AC 117 ms
99,180 KB
testcase_03 AC 123 ms
99,500 KB
testcase_04 AC 119 ms
99,260 KB
testcase_05 AC 102 ms
103,432 KB
testcase_06 WA -
testcase_07 AC 101 ms
103,376 KB
testcase_08 WA -
testcase_09 AC 100 ms
103,632 KB
testcase_10 AC 101 ms
103,308 KB
testcase_11 WA -
testcase_12 AC 106 ms
104,188 KB
testcase_13 AC 107 ms
104,348 KB
testcase_14 AC 108 ms
104,200 KB
testcase_15 AC 107 ms
104,356 KB
testcase_16 AC 106 ms
104,308 KB
testcase_17 AC 106 ms
104,392 KB
testcase_18 AC 105 ms
104,516 KB
testcase_19 AC 136 ms
104,696 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 > 10*mod:
      ans = mod % ans
  print(mod % ans)
main()
0