結果

問題 No.1237 EXP Multiple!
コンテスト
ユーザー Kude
提出日時 2020-09-25 22:48:39
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 90 ms / 2,000 ms
+ 260µs
コード長 367 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 221 ms
コンパイル使用メモリ 95,788 KB
実行使用メモリ 115,840 KB
最終ジャッジ日時 2026-07-31 19:18:30
合計ジャッジ時間 3,211 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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)
0