結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,796 KB
testcase_01 AC 61 ms
23,628 KB
testcase_02 AC 79 ms
29,272 KB
testcase_03 AC 79 ms
30,152 KB
testcase_04 AC 78 ms
30,580 KB
testcase_05 AC 97 ms
12,196 KB
testcase_06 AC 50 ms
12,128 KB
testcase_07 AC 93 ms
12,040 KB
testcase_08 AC 87 ms
12,232 KB
testcase_09 AC 89 ms
12,216 KB
testcase_10 AC 89 ms
12,056 KB
testcase_11 AC 50 ms
11,996 KB
testcase_12 AC 80 ms
11,996 KB
testcase_13 AC 84 ms
12,128 KB
testcase_14 AC 87 ms
12,128 KB
testcase_15 AC 87 ms
12,064 KB
testcase_16 AC 85 ms
12,068 KB
testcase_17 AC 85 ms
12,116 KB
testcase_18 AC 87 ms
12,028 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
    elif a==0:
        ans*=0
    
    if ans>mod:
        print(mod)
        exit()

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