結果

問題 No.1972 Modulo Set
ユーザー minimum
提出日時 2022-06-10 21:26:16
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 248 bytes
コンパイル時間 160 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 691,896 KB
最終ジャッジ日時 2024-09-21 05:57:50
合計ジャッジ時間 7,023 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12 WA * 13 MLE * 1 -- * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict


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

r = defaultdict(int)
for i in range(N):
    r[A[i] % M] += 1

ans = 0
for i in range(M // 2 + 1):
    ans += max(r[i], r[M - i])

print(ans)
0