結果

問題 No.1237 EXP Multiple!
ユーザー wolgnikwolgnik
提出日時 2020-09-25 21:59:54
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 330 bytes
コンパイル時間 300 ms
コンパイル使用メモリ 86,736 KB
実行使用メモリ 104,168 KB
最終ジャッジ日時 2023-09-10 15:27:09
合計ジャッジ時間 3,918 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,408 KB
testcase_01 AC 132 ms
97,964 KB
testcase_02 AC 162 ms
100,772 KB
testcase_03 AC 164 ms
100,804 KB
testcase_04 AC 131 ms
99,100 KB
testcase_05 AC 110 ms
103,252 KB
testcase_06 AC 112 ms
103,480 KB
testcase_07 AC 116 ms
103,780 KB
testcase_08 AC 111 ms
103,496 KB
testcase_09 AC 111 ms
103,384 KB
testcase_10 AC 118 ms
104,168 KB
testcase_11 AC 112 ms
103,252 KB
testcase_12 WA -
testcase_13 AC 112 ms
103,684 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 111 ms
103,600 KB
testcase_17 AC 110 ms
103,596 KB
testcase_18 AC 111 ms
103,552 KB
testcase_19 AC 109 ms
103,384 KB
権限があれば一括ダウンロードができます

ソースコード

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