結果

問題 No.1237 EXP Multiple!
ユーザー wolgnik
提出日時 2020-09-25 21:59:54
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 330 bytes
コンパイル時間 231 ms
コンパイル使用メモリ 82,180 KB
実行使用メモリ 105,216 KB
最終ジャッジ日時 2024-06-28 06:35:02
合計ジャッジ時間 2,811 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 16 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
N = int(input())
a = list(map(int, input().split()))
a.sort()
mod = 10 ** 9 + 7
q = 1
for x in a:
  if x == 1: continue
  if x == 0:
    q = 0
    break
  for i in range(x, 0, -1):
    q *= pow(x, i, mod)
    if q > mod:
      print(mod)
      exit(0)
if q > 0: print(mod % q)
else: print(-1)
0