結果

問題 No.1237 EXP Multiple!
ユーザー yakeshibayakeshiba
提出日時 2021-03-07 04:57:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 130 ms / 2,000 ms
コード長 305 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 82,376 KB
実行使用メモリ 107,472 KB
最終ジャッジ日時 2024-04-17 08:15:14
合計ジャッジ時間 2,692 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,368 KB
testcase_01 AC 95 ms
95,032 KB
testcase_02 AC 121 ms
107,472 KB
testcase_03 AC 130 ms
101,812 KB
testcase_04 AC 96 ms
102,380 KB
testcase_05 AC 73 ms
96,376 KB
testcase_06 AC 76 ms
96,420 KB
testcase_07 AC 78 ms
97,088 KB
testcase_08 AC 73 ms
97,276 KB
testcase_09 AC 74 ms
97,180 KB
testcase_10 AC 79 ms
97,476 KB
testcase_11 AC 73 ms
97,464 KB
testcase_12 AC 74 ms
97,088 KB
testcase_13 AC 74 ms
97,016 KB
testcase_14 AC 73 ms
96,900 KB
testcase_15 AC 75 ms
97,520 KB
testcase_16 AC 75 ms
97,236 KB
testcase_17 AC 74 ms
97,460 KB
testcase_18 AC 75 ms
97,296 KB
testcase_19 AC 74 ms
95,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 10**9+7
n = int(input())
A = list(map(int,input().split()))

prod = [1,4,3**6]

A.sort()

ans = 1
for a in A:
    if a == 0:
        print(-1)
        exit()
    if a >= 4:
        print(mod)
        exit()
    ans *= prod[a-1]
    if ans > mod:
        print(mod)
        exit()
    
print(mod%ans)
0