結果

問題 No.1237 EXP Multiple!
ユーザー etale.K3etale.K3
提出日時 2021-04-17 10:39:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 95 ms / 2,000 ms
コード長 281 bytes
コンパイル時間 105 ms
コンパイル使用メモリ 10,676 KB
実行使用メモリ 30,620 KB
最終ジャッジ日時 2023-09-16 17:26:59
合計ジャッジ時間 3,850 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,780 KB
testcase_01 AC 64 ms
23,740 KB
testcase_02 AC 82 ms
29,032 KB
testcase_03 AC 81 ms
30,056 KB
testcase_04 AC 85 ms
30,620 KB
testcase_05 AC 52 ms
12,028 KB
testcase_06 AC 55 ms
12,128 KB
testcase_07 AC 53 ms
12,028 KB
testcase_08 AC 95 ms
12,112 KB
testcase_09 AC 53 ms
12,044 KB
testcase_10 AC 51 ms
12,176 KB
testcase_11 AC 55 ms
12,044 KB
testcase_12 AC 55 ms
12,048 KB
testcase_13 AC 90 ms
12,024 KB
testcase_14 AC 92 ms
12,144 KB
testcase_15 AC 88 ms
12,064 KB
testcase_16 AC 87 ms
12,200 KB
testcase_17 AC 87 ms
12,040 KB
testcase_18 AC 86 ms
12,132 KB
testcase_19 AC 52 ms
11,952 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 10**9 + 7

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

if min(A) == 0:
    print(-1)
    exit()
if max(A) > 3:
    print(mod)
    exit()

ans = 1
B = [0, 1, 2**2, 3**6]

for a in A:
    ans *= B[a]
    if ans > mod:
        print(mod)
        exit()

print(mod%ans)
0