結果
問題 |
No.1237 EXP Multiple!
|
ユーザー |
|
提出日時 | 2022-02-06 00:11:19 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 299 bytes |
コンパイル時間 | 280 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 264,492 KB |
最終ジャッジ日時 | 2024-06-11 13:41:36 |
合計ジャッジ時間 | 4,537 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 5 TLE * 1 -- * 13 |
ソースコード
n = int(input()) A = list(map(int, input().split())) mod = 10**9 + 7 if min(A) == 0: print(-1) elif max(A) >= 4: print(mod) else: ans = 1 for i in range(n): cnt = 1 for j in range(1, A[i] + 1): cnt *= j ans *= pow(A[i], cnt) print(mod % ans)