結果

問題 No.1237 EXP Multiple!
ユーザー Mine
提出日時 2021-01-28 19:02:32
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 156 ms / 2,000 ms
コード長 452 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 33,136 KB
最終ジャッジ日時 2024-06-26 03:33:33
合計ジャッジ時間 3,170 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
moddehanai = 10**9 + 7
a.sort(reverse=True)
if a[0] >= 4:
    print(moddehanai)
elif a[-1] == 0:
    print(-1)
else:
    s = 1
    end = False
    for i in range(n):
        if a[i] == 3:
            s *= 3**6
        elif a[i] == 2:
            s *= 2**2
        if s > moddehanai:
            end = True
            print(moddehanai)
            break
    if not end:
        print(moddehanai % s)
0