結果
問題 | No.1972 Modulo Set |
ユーザー |
|
提出日時 | 2023-04-01 00:53:14 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 460 bytes |
コンパイル時間 | 145 ms |
コンパイル使用メモリ | 82,300 KB |
実行使用メモリ | 112,972 KB |
最終ジャッジ日時 | 2024-09-23 03:05:00 |
合計ジャッジ時間 | 4,305 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 WA * 13 |
ソースコード
n, m = map(int, input().split())a = list(map(int, input().split()))if m == 1:print("1")exit()cnt = {}for i in range(n):x = a[i] % mcnt[x] = cnt.get(x, 0) + 1ans = 0used = {}for x in cnt.keys():y = m - xif not used.get(x, None) is None or not used.get(y, None) is None:continueused[x] = Trueused[y] = Trueif x == y:ans += 1else:ans += max(cnt.get(x, 0), cnt.get(y, 0))if ans == 0:ans += 1print(ans)