結果

問題 No.1237 EXP Multiple!
ユーザー yakeshibayakeshiba
提出日時 2021-03-07 04:53:25
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 318 bytes
コンパイル時間 156 ms
コンパイル使用メモリ 82,164 KB
実行使用メモリ 105,600 KB
最終ジャッジ日時 2024-04-17 08:15:04
合計ジャッジ時間 2,668 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
51,968 KB
testcase_01 AC 73 ms
92,544 KB
testcase_02 AC 92 ms
105,600 KB
testcase_03 AC 96 ms
101,632 KB
testcase_04 AC 101 ms
101,956 KB
testcase_05 AC 73 ms
95,104 KB
testcase_06 AC 73 ms
95,616 KB
testcase_07 AC 74 ms
95,360 KB
testcase_08 AC 77 ms
96,256 KB
testcase_09 AC 73 ms
95,744 KB
testcase_10 AC 74 ms
95,872 KB
testcase_11 AC 74 ms
95,104 KB
testcase_12 AC 76 ms
96,768 KB
testcase_13 WA -
testcase_14 AC 77 ms
96,896 KB
testcase_15 AC 76 ms
96,128 KB
testcase_16 AC 75 ms
96,896 KB
testcase_17 AC 76 ms
96,128 KB
testcase_18 AC 75 ms
96,128 KB
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 10**9+7
n = int(input())
A = list(map(int,input().split()))

prod = [1,4,3**6]

ans = 1
for a in A:
    if a == 0:
        print(-1)
        exit()
    if a >= 4:
        print(mod)
        exit()
    ans *= prod[a-1]
    if ans > mod:
        print(mod)
        exit()
    
print(mod%ans if mod%ans > 0 else -1)
0