結果

問題 No.1237 EXP Multiple!
コンテスト
ユーザー r_ishida
提出日時 2021-01-04 08:33:21
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 78 ms / 2,000 ms
+ 902µs
コード長 689 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 66 ms
コンパイル使用メモリ 14,976 KB
実行使用メモリ 32,932 KB
最終ジャッジ日時 2026-10-13 11:49:03
合計ジャッジ時間 3,751 ms
ジャッジサーバーID
(参考情報)
judge5_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
import itertools
import math
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

n = I()
a = LI()

if min(a) == 0:
    print(-1)
elif max(a) >= 4:
    print(10**9+7)
elif a.count(3) >= 4:
    print(10**9+7)
elif a.count(2) >= 16:
    print(10**9+7)
else:
    ans = 1
    for i in range(n):
        if a[i] == 2:
            ans *= 2**2
        elif a[i] == 3:
            ans *= 3**6
    print((10**9+7)%ans)
0