結果

問題 No.1237 EXP Multiple!
ユーザー googol_S0
提出日時 2020-09-25 21:23:50
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 234 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 82,440 KB
実行使用メモリ 106,212 KB
最終ジャッジ日時 2024-06-28 06:04:44
合計ジャッジ時間 2,830 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 14 WA * 1 RE * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))
F=[1,1,2,6]
P=1
for i in range(N):
  if A[i]>3:
    print(10**9+7)
    exit()
  P*=pow(A[i],F[A[i]])
  if P>10**9+7:
    print(10**9+7)
    exit()
if P==0:
  print(-1)
print((10**9+7)%P)
0