結果

問題 No.1237 EXP Multiple!
ユーザー marroncastlemarroncastle
提出日時 2020-09-25 21:43:29
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 312 bytes
コンパイル時間 601 ms
コンパイル使用メモリ 86,680 KB
実行使用メモリ 104,672 KB
最終ジャッジ日時 2023-09-10 15:07:01
合計ジャッジ時間 3,934 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,464 KB
testcase_01 AC 102 ms
97,908 KB
testcase_02 AC 121 ms
99,944 KB
testcase_03 AC 122 ms
99,980 KB
testcase_04 AC 122 ms
99,268 KB
testcase_05 AC 101 ms
103,804 KB
testcase_06 AC 102 ms
103,716 KB
testcase_07 AC 103 ms
103,788 KB
testcase_08 AC 106 ms
104,532 KB
testcase_09 AC 102 ms
103,664 KB
testcase_10 AC 102 ms
103,784 KB
testcase_11 AC 103 ms
103,788 KB
testcase_12 AC 107 ms
104,588 KB
testcase_13 WA -
testcase_14 AC 106 ms
104,504 KB
testcase_15 AC 107 ms
104,508 KB
testcase_16 AC 106 ms
104,620 KB
testcase_17 AC 106 ms
104,580 KB
testcase_18 AC 105 ms
104,548 KB
testcase_19 AC 103 ms
103,748 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 10**9+7
N = int(input())
A = list(map(int, input().split()))
if 0 in A:
  print(-1)
  exit()
ans = 1
for i in range(N):
  prod = A[i]
  for j in range(2,A[i]+1):
    prod = pow(prod,j)
    if ans*prod>mod:
      print(mod)
      exit()
  ans *= prod
ans = mod%ans
if ans==0:
  print(-1)
else:
  print(ans)
0