結果

問題 No.1237 EXP Multiple!
ユーザー H3PO4
提出日時 2020-09-25 22:36:17
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 335 bytes
コンパイル時間 145 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 32,744 KB
最終ジャッジ日時 2024-06-28 07:01:20
合計ジャッジ時間 3,343 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 17 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = tuple(map(int, input().split()))
DIV = 10 ** 9 + 7

if 0 in A:
    print(-1)
    exit()

ans = 1
for a in A:
    if a >= 4:
        # 10e9+7を答で割る?
        print(DIV)
        exit()
    for i in range(1, a + 1):
        ans *= a ** i
    if ans > DIV:
        print(DIV)
        exit()
print(DIV % ans)
0