結果
| 問題 | No.1972 Modulo Set |
| コンテスト | |
| ユーザー |
shobonvip
|
| 提出日時 | 2022-06-11 15:26:28 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 92 ms / 2,000 ms |
| コード長 | 326 bytes |
| 記録 | |
| コンパイル時間 | 129 ms |
| コンパイル使用メモリ | 85,120 KB |
| 実行使用メモリ | 117,632 KB |
| 最終ジャッジ日時 | 2026-04-20 17:38:01 |
| 合計ジャッジ時間 | 3,339 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 34 |
ソースコード
from collections import defaultdict n,m = map(int,input().split()) a = list(map(int,input().split())) ac = defaultdict(int) for i in a: ac[i%m] += 1 ans = 0 for i, j in list(ac.items()): if i == (m-i)%m and j >= 1: ans += 1 elif j > ac[(m-i)%m]: ans += j elif j == ac[(m-i)%m] and i > (m-i)%m: ans += j print(ans)
shobonvip