結果
問題 | No.1237 EXP Multiple! |
ユーザー |
![]() |
提出日時 | 2020-09-25 22:48:39 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 108 ms / 2,000 ms |
コード長 | 367 bytes |
コンパイル時間 | 163 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 105,472 KB |
最終ジャッジ日時 | 2024-06-28 08:37:41 |
合計ジャッジ時間 | 2,752 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 19 |
ソースコード
P = 10 ** 9 + 7 n = int(input()) a = list(map(int, input().split())) if 0 in a: print(-1) exit() now = 1 for x in a: x0 = x t = 1 while x: t *= x if t > P: print(P) exit() x -= 1 while t: now *= x0 if now > P: print(P) exit() t -= 1 print(P % now)