結果

問題 No.1237 EXP Multiple!
ユーザー IHIH
提出日時 2020-09-26 21:27:03
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 325 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 87,124 KB
実行使用メモリ 104,888 KB
最終ジャッジ日時 2023-09-12 08:38:44
合計ジャッジ時間 3,674 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 104 ms
98,292 KB
testcase_02 AC 121 ms
100,168 KB
testcase_03 AC 122 ms
100,220 KB
testcase_04 AC 124 ms
99,296 KB
testcase_05 AC 105 ms
103,996 KB
testcase_06 AC 104 ms
103,996 KB
testcase_07 AC 105 ms
104,024 KB
testcase_08 WA -
testcase_09 AC 101 ms
104,100 KB
testcase_10 AC 104 ms
103,796 KB
testcase_11 AC 102 ms
103,908 KB
testcase_12 AC 103 ms
103,996 KB
testcase_13 AC 108 ms
104,528 KB
testcase_14 AC 108 ms
104,472 KB
testcase_15 AC 109 ms
104,764 KB
testcase_16 AC 107 ms
104,760 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 101 ms
103,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
n = int(input())
a = list(map(int,input().split()))

if min(a) == 0:
  print(-1)
  exit()
elif max(a) >= 4:
  print(((10)**9)+7)
  exit()
else:
  ans = 1
  for i in range(n):
    tmp = math.factorial(a[i])
    ans *= a[i]*tmp
    if ans >= ((10)**9)+7:
      print((10**9)+7)
      exit()
  print(((10**9)+7)%ans)
0