結果
| 問題 | No.1237 EXP Multiple! |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-09-25 21:40:12 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 313 bytes |
| 記録 | |
| コンパイル時間 | 308 ms |
| コンパイル使用メモリ | 85,120 KB |
| 実行使用メモリ | 347,472 KB |
| 最終ジャッジ日時 | 2026-03-16 17:37:25 |
| 合計ジャッジ時間 | 14,026 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 14 WA * 1 TLE * 4 |
ソースコード
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(A[i],0,-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)