結果

問題 No.1237 EXP Multiple!
ユーザー Kiri8128Kiri8128
提出日時 2020-09-25 22:20:55
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 296 bytes
コンパイル時間 307 ms
コンパイル使用メモリ 10,660 KB
実行使用メモリ 29,836 KB
最終ジャッジ日時 2023-09-10 15:36:12
合計ジャッジ時間 4,695 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
15,076 KB
testcase_01 AC 68 ms
23,688 KB
testcase_02 AC 85 ms
29,212 KB
testcase_03 AC 90 ms
29,776 KB
testcase_04 AC 90 ms
29,836 KB
testcase_05 AC 58 ms
11,436 KB
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

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)
    else:
        print(P % s)
0