結果

問題 No.2537 多重含意
ユーザー flygonflygon
提出日時 2023-11-10 22:33:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 535 bytes
コンパイル時間 280 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 105,896 KB
最終ジャッジ日時 2023-11-10 22:33:12
合計ジャッジ時間 3,040 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
55,720 KB
testcase_01 AC 41 ms
55,720 KB
testcase_02 AC 41 ms
55,720 KB
testcase_03 AC 42 ms
55,720 KB
testcase_04 AC 45 ms
55,720 KB
testcase_05 AC 41 ms
55,720 KB
testcase_06 AC 41 ms
55,720 KB
testcase_07 AC 42 ms
55,720 KB
testcase_08 AC 41 ms
55,720 KB
testcase_09 AC 41 ms
55,720 KB
testcase_10 AC 41 ms
55,720 KB
testcase_11 AC 40 ms
55,720 KB
testcase_12 AC 45 ms
55,720 KB
testcase_13 AC 40 ms
55,720 KB
testcase_14 AC 40 ms
55,720 KB
testcase_15 AC 40 ms
55,720 KB
testcase_16 AC 46 ms
61,256 KB
testcase_17 AC 60 ms
72,956 KB
testcase_18 AC 124 ms
105,896 KB
testcase_19 AC 104 ms
98,856 KB
testcase_20 AC 103 ms
98,856 KB
testcase_21 AC 103 ms
98,856 KB
testcase_22 AC 102 ms
98,856 KB
testcase_23 AC 108 ms
98,856 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(5*10**5)
input = sys.stdin.readline
from collections import defaultdict, deque, Counter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right
from math import gcd

n,b = map(int,input().split())
a = list(map(int,input().split()))

s = set([a[0]])
ans = [pow(2, n-1, b)]
all = pow(2, n, b)

for i in range(1,n):
    if a[i] in s:
        ans.append(all)
    else:
        s.add(a[i])
        tmp = all - (pow(2, n-len(s), b))
        ans.append(tmp%b)
print(*ans, sep = "\n")
0