結果

問題 No.1237 EXP Multiple!
ユーザー toyuzukotoyuzuko
提出日時 2020-09-27 00:12:55
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 102 ms / 2,000 ms
コード長 330 bytes
コンパイル時間 336 ms
コンパイル使用メモリ 10,680 KB
実行使用メモリ 30,748 KB
最終ジャッジ日時 2023-09-12 12:59:45
合計ジャッジ時間 2,680 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,876 KB
testcase_01 AC 66 ms
23,632 KB
testcase_02 AC 87 ms
29,268 KB
testcase_03 AC 82 ms
30,036 KB
testcase_04 AC 85 ms
30,748 KB
testcase_05 AC 52 ms
12,116 KB
testcase_06 AC 55 ms
12,012 KB
testcase_07 AC 53 ms
12,228 KB
testcase_08 AC 102 ms
12,104 KB
testcase_09 AC 52 ms
12,120 KB
testcase_10 AC 51 ms
12,112 KB
testcase_11 AC 56 ms
12,176 KB
testcase_12 AC 55 ms
12,236 KB
testcase_13 AC 94 ms
12,196 KB
testcase_14 AC 94 ms
12,032 KB
testcase_15 AC 94 ms
12,184 KB
testcase_16 AC 94 ms
12,072 KB
testcase_17 AC 94 ms
12,196 KB
testcase_18 AC 94 ms
12,036 KB
testcase_19 AC 52 ms
12,108 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))

if min(A) == 0:
    print(-1)
elif max(A) >= 4:
    print(1000000007)
else:
    res = 1
    p = [1, 4, 729]
    for i in range(N):
        res *= p[A[i] - 1]
        if res > 1000000007:
            print(1000000007)
            break
    else:
        print(1000000007 % res)
0