結果

問題 No.2537 多重含意
ユーザー rlangevinrlangevin
提出日時 2023-11-10 22:28:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 332 bytes
コンパイル時間 308 ms
コンパイル使用メモリ 82,576 KB
実行使用メモリ 90,504 KB
最終ジャッジ日時 2024-09-26 01:52:11
合計ジャッジ時間 2,806 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *

N, B = map(int, input().split())
A = list(map(int, input().split()))
S = set()
ans1 = pow(2, N, B)
nokori = N
cnt = 0
for i, a in enumerate(A):
    if a in S:
        print(ans1)
    else:
        nokori -= 1
        cnt += 1
        print( (pow(2, cnt, B) - 1) * pow(2, nokori, B) % B )
    S.add(a)
    
0