結果

問題 No.1972 Modulo Set
ユーザー Issei MoriIssei Mori
提出日時 2022-06-10 21:43:08
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 493 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 81,668 KB
実行使用メモリ 135,220 KB
最終ジャッジ日時 2023-10-21 05:00:13
合計ジャッジ時間 5,656 ms
ジャッジサーバーID
(参考情報)
judge12 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
53,512 KB
testcase_01 AC 47 ms
53,512 KB
testcase_02 AC 43 ms
53,512 KB
testcase_03 AC 70 ms
74,760 KB
testcase_04 AC 67 ms
78,116 KB
testcase_05 WA -
testcase_06 AC 89 ms
91,536 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 60 ms
66,528 KB
testcase_10 WA -
testcase_11 AC 102 ms
99,576 KB
testcase_12 AC 66 ms
71,544 KB
testcase_13 AC 61 ms
68,820 KB
testcase_14 AC 63 ms
68,848 KB
testcase_15 AC 110 ms
103,056 KB
testcase_16 AC 119 ms
105,168 KB
testcase_17 AC 77 ms
81,584 KB
testcase_18 AC 42 ms
55,560 KB
testcase_19 AC 108 ms
97,772 KB
testcase_20 AC 123 ms
106,944 KB
testcase_21 AC 80 ms
84,924 KB
testcase_22 AC 104 ms
95,120 KB
testcase_23 AC 166 ms
116,084 KB
testcase_24 AC 94 ms
98,644 KB
testcase_25 AC 120 ms
104,744 KB
testcase_26 WA -
testcase_27 AC 169 ms
118,256 KB
testcase_28 AC 93 ms
100,704 KB
testcase_29 AC 114 ms
115,800 KB
testcase_30 AC 144 ms
111,404 KB
testcase_31 AC 54 ms
66,508 KB
testcase_32 AC 133 ms
128,880 KB
testcase_33 AC 185 ms
135,216 KB
testcase_34 AC 187 ms
135,220 KB
testcase_35 AC 191 ms
135,216 KB
testcase_36 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict


def get_list(ty=int):
    return list(map(ty, input().split()))


def get_int():
    return int(input())


def get_str():
    return input()


N, M = get_list()
A = get_list()

cnt = defaultdict(int)
for a in set(A):
    cnt[a % M] += 1

ans = 0
if cnt[0] > 0:
    ans += 1

keys = cnt.keys()
used = {0}
for k in list(keys):
    if not k in used:
        used.add(k)
        k2 = M-k
        used.add(k2)
        ans += max(cnt[k], cnt[k2])

print(ans)


0