結果

問題 No.1237 EXP Multiple!
ユーザー komkompikomkompi
提出日時 2020-10-23 20:16:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 320 bytes
コンパイル時間 612 ms
コンパイル使用メモリ 10,740 KB
実行使用メモリ 30,128 KB
最終ジャッジ日時 2023-09-28 15:40:15
合計ジャッジ時間 3,274 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,884 KB
testcase_01 AC 61 ms
23,716 KB
testcase_02 AC 77 ms
29,220 KB
testcase_03 AC 76 ms
30,128 KB
testcase_04 AC 81 ms
29,844 KB
testcase_05 AC 80 ms
12,020 KB
testcase_06 AC 48 ms
12,056 KB
testcase_07 AC 81 ms
12,056 KB
testcase_08 AC 79 ms
12,056 KB
testcase_09 AC 78 ms
12,164 KB
testcase_10 WA -
testcase_11 AC 49 ms
12,120 KB
testcase_12 AC 76 ms
12,160 KB
testcase_13 WA -
testcase_14 AC 80 ms
12,120 KB
testcase_15 AC 79 ms
12,056 KB
testcase_16 AC 80 ms
12,204 KB
testcase_17 AC 81 ms
12,064 KB
testcase_18 AC 82 ms
12,184 KB
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!
N=int(input())
A=list(map(int,input().split()))

ans=1
mod=(10**9+7)
for a in A:
    if a>=4:
        ans*=(mod+1)
    elif a==3:
        ans*=3**6
    elif a==2:
        ans*=2**2
    
    if ans>mod:
        print(mod)
        exit()

if ans==1:
    print(-1)
else:
    print(mod%ans)
0