結果

問題 No.1237 EXP Multiple!
ユーザー persimmon-persimmonpersimmon-persimmon
提出日時 2021-03-03 10:06:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 110 ms / 2,000 ms
コード長 332 bytes
コンパイル時間 239 ms
コンパイル使用メモリ 82,464 KB
実行使用メモリ 107,308 KB
最終ジャッジ日時 2024-04-14 05:52:51
合計ジャッジ時間 3,907 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
52,612 KB
testcase_01 AC 83 ms
93,308 KB
testcase_02 AC 102 ms
107,308 KB
testcase_03 AC 108 ms
101,804 KB
testcase_04 AC 110 ms
102,180 KB
testcase_05 AC 84 ms
96,532 KB
testcase_06 AC 87 ms
96,888 KB
testcase_07 AC 85 ms
96,944 KB
testcase_08 AC 89 ms
98,004 KB
testcase_09 AC 89 ms
98,364 KB
testcase_10 AC 87 ms
98,256 KB
testcase_11 AC 86 ms
97,456 KB
testcase_12 AC 83 ms
96,796 KB
testcase_13 AC 90 ms
98,228 KB
testcase_14 AC 90 ms
97,704 KB
testcase_15 AC 92 ms
98,208 KB
testcase_16 AC 91 ms
98,576 KB
testcase_17 AC 89 ms
97,712 KB
testcase_18 AC 90 ms
98,260 KB
testcase_19 AC 85 ms
96,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main(n,a):
  mod=10**9+7
  if max(a)>=4:return mod
  if min(a)==0:return -1
  ary=[1,1]
  for i in range(2,max(a)+1):
    ary.append(ary[-1]*i)
  ret=1
  for x in a:
    ret*=pow(x,ary[x])
    if ret>mod:return mod
  return mod%ret
if __name__=='__main__':
  n=int(input())
  a=list(map(int,input().split()))
  print(main(n,a))
0