結果
問題 |
No.1237 EXP Multiple!
|
ユーザー |
|
提出日時 | 2020-09-25 21:40:12 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 313 bytes |
コンパイル時間 | 157 ms |
コンパイル使用メモリ | 82,564 KB |
実行使用メモリ | 205,812 KB |
最終ジャッジ日時 | 2024-06-28 06:15:27 |
合計ジャッジ時間 | 3,821 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | TLE * 1 -- * 18 |
ソースコード
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)