結果

問題 No.1237 EXP Multiple!
ユーザー irumo8202
提出日時 2022-01-30 14:28:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 106 ms / 2,000 ms
コード長 322 bytes
コンパイル時間 198 ms
コンパイル使用メモリ 82,456 KB
実行使用メモリ 107,648 KB
最終ジャッジ日時 2024-06-11 08:16:27
合計ジャッジ時間 2,775 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10 ** 9 + 7

N = int(input())
A = list(map(int, input().split()))

ans = 1
if min(A) == 0:
    print(-1)
    exit()
for a in A:
    if a == 2:
        ans *= 4
    elif a == 3:
        ans *= 729
    elif a >= 4:
        print(MOD)
        exit()

    if ans > MOD:
        print(MOD)
        exit()
print(MOD % ans)
0