結果

問題 No.1237 EXP Multiple!
ユーザー tonyu0tonyu0
提出日時 2020-09-25 23:47:57
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 301 bytes
コンパイル時間 431 ms
コンパイル使用メモリ 10,756 KB
実行使用メモリ 29,952 KB
最終ジャッジ日時 2023-09-10 17:31:17
合計ジャッジ時間 2,681 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,868 KB
testcase_01 AC 63 ms
23,668 KB
testcase_02 AC 81 ms
29,128 KB
testcase_03 AC 82 ms
29,868 KB
testcase_04 AC 84 ms
29,952 KB
testcase_05 AC 55 ms
11,924 KB
testcase_06 AC 54 ms
11,736 KB
testcase_07 AC 56 ms
11,792 KB
testcase_08 AC 91 ms
11,752 KB
testcase_09 AC 56 ms
11,912 KB
testcase_10 AC 56 ms
11,896 KB
testcase_11 AC 55 ms
11,896 KB
testcase_12 AC 55 ms
11,920 KB
testcase_13 AC 86 ms
11,876 KB
testcase_14 AC 89 ms
11,736 KB
testcase_15 AC 86 ms
11,808 KB
testcase_16 AC 87 ms
11,912 KB
testcase_17 AC 88 ms
11,820 KB
testcase_18 AC 91 ms
11,920 KB
testcase_19 AC 55 ms
11,756 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

mod = 10 ** 9 + 7

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