結果

問題 No.1972 Modulo Set
ユーザー ああいいああいい
提出日時 2022-06-12 07:01:22
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 315 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 82,568 KB
実行使用メモリ 108,544 KB
最終ジャッジ日時 2024-09-22 16:56:51
合計ジャッジ時間 4,358 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 6 WA * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
A = list(map(int,input().split()))

from collections import defaultdict
d = defaultdict(int)
for a in A:
    d[a % M] += 1
ans = N
tmp = 0
for a,v in d.items():
    if a == 0:
        ans -= v - 1
    elif M - a in d:
        u = min(v,d[M - a])
        tmp += v
print(ans - tmp // 2)
0