結果

問題 No.1237 EXP Multiple!
ユーザー wolgnikwolgnik
提出日時 2020-09-25 22:26:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 156 ms / 2,000 ms
コード長 345 bytes
コンパイル時間 304 ms
コンパイル使用メモリ 86,788 KB
実行使用メモリ 104,332 KB
最終ジャッジ日時 2023-09-10 17:26:50
合計ジャッジ時間 3,782 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,284 KB
testcase_01 AC 130 ms
98,396 KB
testcase_02 AC 154 ms
100,812 KB
testcase_03 AC 156 ms
100,780 KB
testcase_04 AC 124 ms
99,224 KB
testcase_05 AC 104 ms
103,328 KB
testcase_06 AC 105 ms
103,564 KB
testcase_07 AC 111 ms
104,008 KB
testcase_08 AC 108 ms
103,704 KB
testcase_09 AC 106 ms
103,416 KB
testcase_10 AC 112 ms
104,332 KB
testcase_11 AC 108 ms
103,632 KB
testcase_12 AC 109 ms
103,972 KB
testcase_13 AC 107 ms
103,652 KB
testcase_14 AC 108 ms
103,692 KB
testcase_15 AC 108 ms
103,908 KB
testcase_16 AC 109 ms
103,592 KB
testcase_17 AC 108 ms
103,780 KB
testcase_18 AC 106 ms
103,792 KB
testcase_19 AC 107 ms
103,464 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
  t = x
  for i in range(1, x + 1):
    t = pow(t, i)
    if q * t > mod:
      print(mod)
      exit(0)
  q *= t
if q > 0: print(mod % q)
else: print(-1)
0