結果

問題 No.1237 EXP Multiple!
ユーザー marroncastlemarroncastle
提出日時 2020-09-25 21:47:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 130 ms / 2,000 ms
コード長 271 bytes
コンパイル時間 379 ms
コンパイル使用メモリ 87,064 KB
実行使用メモリ 104,904 KB
最終ジャッジ日時 2023-09-10 17:23:20
合計ジャッジ時間 3,774 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,288 KB
testcase_01 AC 106 ms
97,864 KB
testcase_02 AC 124 ms
100,108 KB
testcase_03 AC 127 ms
100,248 KB
testcase_04 AC 130 ms
99,172 KB
testcase_05 AC 106 ms
103,876 KB
testcase_06 AC 106 ms
103,672 KB
testcase_07 AC 106 ms
103,768 KB
testcase_08 AC 112 ms
104,560 KB
testcase_09 AC 106 ms
103,832 KB
testcase_10 AC 106 ms
103,764 KB
testcase_11 AC 108 ms
103,816 KB
testcase_12 AC 111 ms
104,904 KB
testcase_13 AC 110 ms
104,460 KB
testcase_14 AC 111 ms
104,524 KB
testcase_15 AC 110 ms
104,688 KB
testcase_16 AC 111 ms
104,832 KB
testcase_17 AC 110 ms
104,712 KB
testcase_18 AC 109 ms
104,700 KB
testcase_19 AC 106 ms
103,736 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
print(mod%ans)
0