結果

問題 No.1237 EXP Multiple!
ユーザー 👑 KazunKazun
提出日時 2020-09-26 01:04:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 223 bytes
コンパイル時間 300 ms
コンパイル使用メモリ 86,968 KB
実行使用メモリ 104,660 KB
最終ジャッジ日時 2023-09-10 17:52:15
合計ジャッジ時間 3,748 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,124 KB
testcase_01 AC 112 ms
98,160 KB
testcase_02 AC 119 ms
99,976 KB
testcase_03 AC 121 ms
100,108 KB
testcase_04 AC 123 ms
99,184 KB
testcase_05 AC 119 ms
104,264 KB
testcase_06 AC 103 ms
103,916 KB
testcase_07 AC 104 ms
104,660 KB
testcase_08 AC 105 ms
104,464 KB
testcase_09 AC 105 ms
104,476 KB
testcase_10 AC 105 ms
104,660 KB
testcase_11 AC 103 ms
103,704 KB
testcase_12 AC 102 ms
103,980 KB
testcase_13 AC 103 ms
104,480 KB
testcase_14 AC 106 ms
104,276 KB
testcase_15 AC 105 ms
104,300 KB
testcase_16 AC 105 ms
104,332 KB
testcase_17 AC 105 ms
104,524 KB
testcase_18 AC 105 ms
104,240 KB
testcase_19 AC 104 ms
103,920 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

if max(A)>=4:
    print(10**9+7)
    exit()

T=[0,1,4,729]
X=1
for a in A:
    X*=T[a]
    if X>=10**9+8:
        break

if 0 in A:
    print(-1)
else:
    print((10**9+7)%X)
0