結果

問題 No.1237 EXP Multiple!
ユーザー tonyu0
提出日時 2020-09-25 23:47:57
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 121 ms / 2,000 ms
コード長 301 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 32,540 KB
最終ジャッジ日時 2024-06-28 08:40:48
合計ジャッジ時間 2,851 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

n, *a = map(int, open(0).read().split())
mx = max(a)
mn = min(a)

mod = 10 ** 9 + 7

if mn == 0:
    print(-1)
elif mx > 3:
    print(mod)
else:
    b = [0, 1, 4, 729]
    ans = 1
    for c in a:
        ans *= b[c]
        if ans > mod:
            print(mod)
            exit()
    print(mod % ans)
0