結果

問題 No.1237 EXP Multiple!
ユーザー Kiri8128Kiri8128
提出日時 2020-09-25 22:21:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 104 ms / 2,000 ms
コード長 314 bytes
コンパイル時間 105 ms
コンパイル使用メモリ 10,668 KB
実行使用メモリ 29,816 KB
最終ジャッジ日時 2023-09-10 17:26:32
合計ジャッジ時間 2,901 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,776 KB
testcase_01 AC 66 ms
23,652 KB
testcase_02 AC 88 ms
29,116 KB
testcase_03 AC 89 ms
29,608 KB
testcase_04 AC 90 ms
29,816 KB
testcase_05 AC 58 ms
11,276 KB
testcase_06 AC 58 ms
11,276 KB
testcase_07 AC 59 ms
11,464 KB
testcase_08 AC 102 ms
11,372 KB
testcase_09 AC 59 ms
11,276 KB
testcase_10 AC 58 ms
11,460 KB
testcase_11 AC 57 ms
11,268 KB
testcase_12 AC 93 ms
11,268 KB
testcase_13 AC 98 ms
11,476 KB
testcase_14 AC 95 ms
11,372 KB
testcase_15 AC 101 ms
11,268 KB
testcase_16 AC 104 ms
11,316 KB
testcase_17 AC 95 ms
11,420 KB
testcase_18 AC 99 ms
11,268 KB
testcase_19 AC 58 ms
11,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = [int(a) for a in input().split()]
X = [0, 1, 4, 729]
P = 10 ** 9 + 7
if min(A) == 0:
    print(-1)
else:
    s = 1
    for a in A:
        if a > 3:
            print(P)
            break
        s *= X[a]
        if s > P:
            print(P)
            break
    else:
        print(P % s)
0