結果

問題 No.1972 Modulo Set
ユーザー Issei MoriIssei Mori
提出日時 2022-06-10 21:37:53
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 488 bytes
コンパイル時間 186 ms
コンパイル使用メモリ 81,388 KB
実行使用メモリ 124,908 KB
最終ジャッジ日時 2023-10-21 04:56:59
合計ジャッジ時間 4,972 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
53,256 KB
testcase_01 AC 42 ms
53,256 KB
testcase_02 AC 43 ms
53,256 KB
testcase_03 AC 68 ms
71,076 KB
testcase_04 AC 65 ms
72,940 KB
testcase_05 WA -
testcase_06 AC 72 ms
80,756 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 59 ms
66,268 KB
testcase_10 WA -
testcase_11 AC 86 ms
87,968 KB
testcase_12 AC 62 ms
70,652 KB
testcase_13 AC 59 ms
66,508 KB
testcase_14 AC 61 ms
68,588 KB
testcase_15 AC 98 ms
91,448 KB
testcase_16 AC 107 ms
93,824 KB
testcase_17 AC 72 ms
77,708 KB
testcase_18 AC 43 ms
55,304 KB
testcase_19 AC 101 ms
89,864 KB
testcase_20 AC 111 ms
95,600 KB
testcase_21 AC 75 ms
79,624 KB
testcase_22 AC 92 ms
96,084 KB
testcase_23 AC 151 ms
114,932 KB
testcase_24 AC 90 ms
94,408 KB
testcase_25 AC 108 ms
108,588 KB
testcase_26 WA -
testcase_27 AC 151 ms
115,020 KB
testcase_28 AC 86 ms
94,512 KB
testcase_29 AC 104 ms
108,096 KB
testcase_30 AC 130 ms
124,908 KB
testcase_31 AC 55 ms
66,244 KB
testcase_32 AC 123 ms
118,396 KB
testcase_33 AC 164 ms
123,556 KB
testcase_34 AC 164 ms
123,556 KB
testcase_35 AC 162 ms
123,560 KB
testcase_36 AC 166 ms
123,568 KB
権限があれば一括ダウンロードができます

ソースコード

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 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