結果

問題 No.1972 Modulo Set
ユーザー 👑 Kazun
提出日時 2021-08-20 23:22:14
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 242 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 82,584 KB
実行使用メモリ 108,008 KB
最終ジャッジ日時 2024-09-21 07:13:50
合計ジャッジ時間 4,504 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21 WA * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

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

A=list(map(int,input().split()))
D=defaultdict(int)

for a in A:
    D[a%M]+=1

X=0
K=list(D.keys())
for a in K:
    b=(M-a)%M
    X+=max(D[a],D[b])
    D[a]=D[b]=0

print(X)
0