結果

問題 No.2537 多重含意
ユーザー ニックネームニックネーム
提出日時 2023-11-10 23:43:12
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 191 ms / 2,000 ms
コード長 222 bytes
コンパイル時間 79 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 21,564 KB
最終ジャッジ日時 2023-11-10 23:43:15
合計ジャッジ時間 2,903 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
9,984 KB
testcase_01 AC 27 ms
9,984 KB
testcase_02 AC 27 ms
9,984 KB
testcase_03 AC 29 ms
9,984 KB
testcase_04 AC 29 ms
9,984 KB
testcase_05 AC 29 ms
9,984 KB
testcase_06 AC 27 ms
9,984 KB
testcase_07 AC 27 ms
9,984 KB
testcase_08 AC 27 ms
9,984 KB
testcase_09 AC 27 ms
9,984 KB
testcase_10 AC 27 ms
9,984 KB
testcase_11 AC 28 ms
9,984 KB
testcase_12 AC 28 ms
9,984 KB
testcase_13 AC 27 ms
9,984 KB
testcase_14 AC 28 ms
9,984 KB
testcase_15 AC 27 ms
9,984 KB
testcase_16 AC 29 ms
10,240 KB
testcase_17 AC 43 ms
11,904 KB
testcase_18 AC 191 ms
21,564 KB
testcase_19 AC 185 ms
21,560 KB
testcase_20 AC 168 ms
21,564 KB
testcase_21 AC 171 ms
21,564 KB
testcase_22 AC 168 ms
21,564 KB
testcase_23 AC 171 ms
21,560 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,b = map(int,input().split())
a = list(map(int,input().split()))
s = set(); c = n; r = [1]*(n+1)
for i in range(n): r[i+1] = r[i]*2%b
for v in a:
    if v in s: print(r[n])
    else: s.add(v); c -= 1; print((r[n]-r[c])%b)
0