結果

問題 No.1237 EXP Multiple!
ユーザー irumo8202irumo8202
提出日時 2022-01-30 14:28:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 115 ms / 2,000 ms
コード長 322 bytes
コンパイル時間 251 ms
コンパイル使用メモリ 86,992 KB
実行使用メモリ 104,772 KB
最終ジャッジ日時 2023-09-02 01:37:22
合計ジャッジ時間 3,353 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,484 KB
testcase_01 AC 96 ms
98,404 KB
testcase_02 AC 112 ms
100,192 KB
testcase_03 AC 115 ms
100,280 KB
testcase_04 AC 115 ms
99,572 KB
testcase_05 AC 96 ms
104,308 KB
testcase_06 AC 96 ms
104,124 KB
testcase_07 AC 96 ms
103,996 KB
testcase_08 AC 97 ms
104,584 KB
testcase_09 AC 96 ms
104,080 KB
testcase_10 AC 96 ms
104,200 KB
testcase_11 AC 95 ms
104,100 KB
testcase_12 AC 100 ms
104,632 KB
testcase_13 AC 98 ms
104,484 KB
testcase_14 AC 98 ms
104,476 KB
testcase_15 AC 97 ms
104,556 KB
testcase_16 AC 98 ms
104,528 KB
testcase_17 AC 99 ms
104,772 KB
testcase_18 AC 97 ms
104,520 KB
testcase_19 AC 97 ms
103,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10 ** 9 + 7

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

ans = 1
if min(A) == 0:
    print(-1)
    exit()
for a in A:
    if a == 2:
        ans *= 4
    elif a == 3:
        ans *= 729
    elif a >= 4:
        print(MOD)
        exit()

    if ans > MOD:
        print(MOD)
        exit()
print(MOD % ans)
0