結果
| 問題 |
No.1972 Modulo Set
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-06-10 22:28:20 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 429 bytes |
| コンパイル時間 | 177 ms |
| コンパイル使用メモリ | 82,404 KB |
| 実行使用メモリ | 107,584 KB |
| 最終ジャッジ日時 | 2024-09-21 06:33:58 |
| 合計ジャッジ時間 | 4,340 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 WA * 13 |
ソースコード
n,m = map(int,input().split())
dic = {}
A = list(map(int,input().split()))
for a in A:
dic[a%m] = dic.get(a%m,0) + 1
ans = 0
done = set()
for key,value in dic.items():
if key in done:
continue
if m-key in dic:
if m-key == key:
ans += 1
else:
val2 = dic[m-key]
ans += max(value,val2)
done.add(m-key)
else:
ans += value
print(ans)