結果

問題 No.1237 EXP Multiple!
ユーザー ygd.ygd.
提出日時 2020-09-25 23:26:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 288 bytes
コンパイル時間 1,767 ms
コンパイル使用メモリ 86,736 KB
実行使用メモリ 104,892 KB
最終ジャッジ日時 2023-09-10 17:30:18
合計ジャッジ時間 5,170 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,184 KB
testcase_01 AC 110 ms
98,188 KB
testcase_02 AC 122 ms
100,020 KB
testcase_03 AC 122 ms
100,120 KB
testcase_04 AC 122 ms
99,468 KB
testcase_05 AC 102 ms
103,776 KB
testcase_06 AC 103 ms
104,004 KB
testcase_07 AC 102 ms
103,852 KB
testcase_08 AC 115 ms
104,892 KB
testcase_09 AC 104 ms
103,980 KB
testcase_10 AC 105 ms
103,780 KB
testcase_11 AC 109 ms
104,116 KB
testcase_12 AC 113 ms
104,664 KB
testcase_13 AC 115 ms
104,680 KB
testcase_14 AC 113 ms
104,544 KB
testcase_15 AC 110 ms
104,736 KB
testcase_16 AC 114 ms
104,504 KB
testcase_17 AC 107 ms
104,792 KB
testcase_18 AC 107 ms
104,680 KB
testcase_19 AC 102 ms
103,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
N = int(input()); MOD = pow(10,9)+7
A = list(map(int,input().split()))
if 0 in A:
  print(-1);exit()
if min(A) >= 4:
  print(MOD);exit()
ans = 1
for x in A:
  kata = math.factorial(x)
  temp = pow(x,kata)
  ans = ans*temp
  if ans >= MOD:
    print(MOD);exit()
print(MOD%ans)
0