結果

問題 No.1237 EXP Multiple!
ユーザー titiatitia
提出日時 2020-09-25 21:41:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 344 bytes
コンパイル時間 118 ms
コンパイル使用メモリ 10,696 KB
実行使用メモリ 30,648 KB
最終ジャッジ日時 2023-09-10 15:05:06
合計ジャッジ時間 3,793 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,804 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 48 ms
11,424 KB
testcase_06 WA -
testcase_07 AC 49 ms
11,428 KB
testcase_08 WA -
testcase_09 AC 48 ms
11,484 KB
testcase_10 AC 48 ms
11,428 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 84 ms
11,364 KB
testcase_14 AC 86 ms
11,364 KB
testcase_15 AC 84 ms
11,448 KB
testcase_16 AC 83 ms
11,444 KB
testcase_17 AC 86 ms
11,424 KB
testcase_18 AC 86 ms
11,372 KB
testcase_19 AC 50 ms
11,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

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

X=[0]
Z=1
for i in range(1,4):
    Z*=i
    X.append(i**Z)
    

if 0 in A:
    print(-1)
else:
    ANS=1

    for a in A:
        if a>3 or ANS>10**9+7:
            print(10**9+7)
        else:
            ANS*=X[a]

    print((10**9+7)%ANS)
            
0