結果

問題 No.1237 EXP Multiple!
ユーザー 👑 Kazun
提出日時 2020-09-25 21:37:48
言語 PyPy3
(7.3.15)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 221 bytes
コンパイル時間 163 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 107,392 KB
最終ジャッジ日時 2024-06-28 08:31:17
合計ジャッジ時間 2,949 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 18 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

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

if max(A)>=4:
    print(10**9+7)
    exit()

T=[0,1,4,729]
X=1
for a in A:
    X*=T[a]
    if X>=10**9+8:
        break

if X==0:
    print(-1)
else:
    print((10**9+7)%X)
0