結果

問題 No.2537 多重含意
ユーザー rlangevinrlangevin
提出日時 2023-11-10 22:28:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 142 ms / 2,000 ms
コード長 332 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 89,840 KB
最終ジャッジ日時 2023-11-10 22:28:45
合計ジャッジ時間 2,854 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,460 KB
testcase_01 AC 40 ms
53,460 KB
testcase_02 AC 40 ms
53,460 KB
testcase_03 AC 40 ms
53,460 KB
testcase_04 AC 40 ms
53,460 KB
testcase_05 AC 40 ms
53,460 KB
testcase_06 AC 40 ms
53,460 KB
testcase_07 AC 40 ms
53,460 KB
testcase_08 AC 39 ms
53,460 KB
testcase_09 AC 41 ms
53,460 KB
testcase_10 AC 39 ms
53,460 KB
testcase_11 AC 40 ms
53,460 KB
testcase_12 AC 39 ms
53,460 KB
testcase_13 AC 39 ms
53,460 KB
testcase_14 AC 39 ms
53,460 KB
testcase_15 AC 42 ms
55,608 KB
testcase_16 AC 49 ms
61,140 KB
testcase_17 AC 68 ms
72,824 KB
testcase_18 AC 142 ms
89,840 KB
testcase_19 AC 106 ms
89,840 KB
testcase_20 AC 106 ms
89,840 KB
testcase_21 AC 106 ms
89,840 KB
testcase_22 AC 107 ms
89,840 KB
testcase_23 AC 106 ms
89,840 KB
権限があれば一括ダウンロードができます

ソースコード

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