結果

問題 No.1237 EXP Multiple!
ユーザー ayaoniayaoni
提出日時 2020-10-17 09:49:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 132 ms / 2,000 ms
コード長 448 bytes
コンパイル時間 921 ms
コンパイル使用メモリ 87,268 KB
実行使用メモリ 104,724 KB
最終ジャッジ日時 2023-09-28 07:27:05
合計ジャッジ時間 4,914 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,504 KB
testcase_01 AC 132 ms
98,392 KB
testcase_02 AC 120 ms
100,228 KB
testcase_03 AC 121 ms
100,276 KB
testcase_04 AC 123 ms
99,520 KB
testcase_05 AC 102 ms
104,096 KB
testcase_06 AC 102 ms
104,032 KB
testcase_07 AC 101 ms
104,092 KB
testcase_08 AC 106 ms
104,724 KB
testcase_09 AC 105 ms
104,376 KB
testcase_10 AC 106 ms
104,028 KB
testcase_11 AC 103 ms
104,132 KB
testcase_12 AC 104 ms
104,196 KB
testcase_13 AC 107 ms
104,584 KB
testcase_14 AC 104 ms
104,632 KB
testcase_15 AC 106 ms
104,380 KB
testcase_16 AC 103 ms
104,624 KB
testcase_17 AC 103 ms
104,428 KB
testcase_18 AC 107 ms
104,628 KB
testcase_19 AC 104 ms
104,176 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり


N = I()
A = LI()
m = 10**9+7

if min(A) == 0:
    print(-1)
    exit()

if max(A) >= 4:
    print(m)
else:
    x = 1
    for a in A:
        if a == 2:
            x *= 4
        if a == 3:
            x *= 729
        if x > m:
            print(m)
            break
    else:
        print(m % x)
0