結果

問題 No.1237 EXP Multiple!
ユーザー tamato
提出日時 2020-09-25 21:29:02
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 652 bytes
コンパイル時間 286 ms
コンパイル使用メモリ 82,688 KB
実行使用メモリ 104,960 KB
最終ジャッジ日時 2024-06-28 06:06:59
合計ジャッジ時間 3,012 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 14 RE * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    N = int(input())
    A = list(map(int, input().split()))
    if 0 in A:
        print(-1)
    else:
        f = 1
        B = []
        for i in range(1, 10**5):
            f *= i
            new = i ** f
            if new > mod:
                break
            B.append(new)
        ans = 1
        for a in A:
            if a > len(B):
                print(mod)
                exit()
            ans *= B[a-1]
            if ans > mod:
                print(mod)
                exit()
    print(mod % ans)


if __name__ == '__main__':
    main()
0