結果

問題 No.1237 EXP Multiple!
ユーザー r_ishidar_ishida
提出日時 2021-01-04 08:33:21
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 689 bytes
コンパイル時間 466 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 33,340 KB
最終ジャッジ日時 2024-04-22 09:00:39
合計ジャッジ時間 3,456 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,752 KB
testcase_01 AC 90 ms
26,196 KB
testcase_02 AC 110 ms
31,992 KB
testcase_03 AC 110 ms
32,824 KB
testcase_04 AC 110 ms
33,340 KB
testcase_05 AC 74 ms
14,836 KB
testcase_06 AC 78 ms
14,808 KB
testcase_07 AC 76 ms
14,808 KB
testcase_08 AC 82 ms
14,808 KB
testcase_09 AC 74 ms
14,804 KB
testcase_10 AC 74 ms
14,808 KB
testcase_11 AC 81 ms
14,804 KB
testcase_12 AC 78 ms
14,812 KB
testcase_13 AC 124 ms
14,804 KB
testcase_14 AC 122 ms
14,804 KB
testcase_15 AC 120 ms
14,928 KB
testcase_16 AC 123 ms
14,804 KB
testcase_17 AC 121 ms
14,808 KB
testcase_18 AC 125 ms
14,800 KB
testcase_19 AC 74 ms
14,804 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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