結果
| 問題 | No.1972 Modulo Set |
| コンテスト | |
| ユーザー |
shobonvip
|
| 提出日時 | 2022-06-11 15:26:28 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 87 ms / 2,000 ms |
| + 106µs | |
| コード長 | 326 bytes |
| 記録 | |
| コンパイル時間 | 81 ms |
| コンパイル使用メモリ | 64,520 KB |
| 実行使用メモリ | 90,760 KB |
| 最終ジャッジ日時 | 2026-10-15 22:33:04 |
| 合計ジャッジ時間 | 5,059 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 33 |
ソースコード
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