結果

問題 No.1237 EXP Multiple!
ユーザー tonyu0tonyu0
提出日時 2020-09-25 23:36:12
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 302 bytes
コンパイル時間 146 ms
コンパイル使用メモリ 10,484 KB
実行使用メモリ 29,780 KB
最終ジャッジ日時 2023-09-10 17:09:56
合計ジャッジ時間 2,912 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,832 KB
testcase_01 AC 61 ms
23,784 KB
testcase_02 AC 81 ms
29,072 KB
testcase_03 AC 79 ms
29,748 KB
testcase_04 AC 81 ms
29,780 KB
testcase_05 AC 54 ms
11,748 KB
testcase_06 AC 53 ms
11,692 KB
testcase_07 AC 55 ms
11,844 KB
testcase_08 AC 93 ms
11,840 KB
testcase_09 AC 53 ms
11,776 KB
testcase_10 AC 52 ms
11,744 KB
testcase_11 AC 54 ms
11,700 KB
testcase_12 AC 54 ms
11,772 KB
testcase_13 AC 90 ms
11,840 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 92 ms
11,844 KB
testcase_17 AC 92 ms
11,844 KB
testcase_18 AC 87 ms
11,700 KB
testcase_19 AC 54 ms
11,832 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, *a = map(int, open(0).read().split())
mx = max(a)
mn = min(a)

mod = 10 ** 9 + 7

if mx > 3:
    print(mod)
elif mn == 0:
    print(-1)
else:
    b = [0, 1, 16, 729]
    ans = 1
    for c in a:
        ans *= b[c]
        if ans > mod:
            print(mod)
            exit()
    print(mod % ans)
0