結果

問題 No.1237 EXP Multiple!
ユーザー titiatitia
提出日時 2020-09-25 21:42:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 88 ms / 2,000 ms
コード長 375 bytes
コンパイル時間 169 ms
コンパイル使用メモリ 10,568 KB
実行使用メモリ 30,440 KB
最終ジャッジ日時 2023-09-10 17:22:46
合計ジャッジ時間 2,636 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,820 KB
testcase_01 AC 60 ms
23,616 KB
testcase_02 AC 76 ms
29,288 KB
testcase_03 AC 76 ms
30,160 KB
testcase_04 AC 79 ms
30,440 KB
testcase_05 AC 48 ms
11,360 KB
testcase_06 AC 50 ms
11,416 KB
testcase_07 AC 48 ms
11,412 KB
testcase_08 AC 87 ms
11,392 KB
testcase_09 AC 47 ms
11,484 KB
testcase_10 AC 47 ms
11,520 KB
testcase_11 AC 50 ms
11,344 KB
testcase_12 AC 80 ms
11,332 KB
testcase_13 AC 84 ms
11,432 KB
testcase_14 AC 85 ms
11,456 KB
testcase_15 AC 88 ms
11,468 KB
testcase_16 AC 84 ms
11,432 KB
testcase_17 AC 87 ms
11,336 KB
testcase_18 AC 84 ms
11,324 KB
testcase_19 AC 50 ms
11,408 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)
            break
        else:
            ANS*=X[a]
    else:
        print((10**9+7)%ANS)
            
0