結果

問題 No.1237 EXP Multiple!
ユーザー ShirotsumeShirotsume
提出日時 2023-02-17 19:57:02
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 488 bytes
コンパイル時間 283 ms
コンパイル使用メモリ 86,864 KB
実行使用メモリ 110,272 KB
最終ジャッジ日時 2023-09-26 17:21:44
合計ジャッジ時間 4,269 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 95 ms
71,384 KB
testcase_01 AC 127 ms
99,160 KB
testcase_02 AC 143 ms
109,128 KB
testcase_03 AC 140 ms
109,340 KB
testcase_04 AC 142 ms
110,272 KB
testcase_05 AC 131 ms
105,488 KB
testcase_06 AC 134 ms
104,756 KB
testcase_07 AC 130 ms
105,492 KB
testcase_08 AC 136 ms
105,392 KB
testcase_09 AC 134 ms
105,496 KB
testcase_10 AC 134 ms
105,428 KB
testcase_11 AC 133 ms
104,824 KB
testcase_12 AC 137 ms
105,556 KB
testcase_13 AC 135 ms
105,588 KB
testcase_14 AC 135 ms
105,500 KB
testcase_15 AC 133 ms
105,328 KB
testcase_16 AC 134 ms
105,448 KB
testcase_17 AC 134 ms
105,440 KB
testcase_18 AC 134 ms
105,400 KB
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import deque, Counter
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())

n = ii()

a = li()
ans = 1
p = [0, 1, 4, 729]
for i in range(n):
    if a[i] >= 4:
        print(10 ** 9 + 7)
        exit()
    else:
        ans *= p[a[i]]
        if ans > 10 ** 9 + 7:
            print(10 ** 9 + 7)
            exit()

if ans == 0:
    print(-1)
else:
    print((10 ** 9 + 7) % ans)
0