結果

問題 No.1972 Modulo Set
ユーザー 👑 H20H20
提出日時 2022-06-10 21:34:00
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 278 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 81,832 KB
実行使用メモリ 107,396 KB
最終ジャッジ日時 2023-10-21 04:54:14
合計ジャッジ時間 4,724 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
53,492 KB
testcase_01 AC 45 ms
53,492 KB
testcase_02 AC 41 ms
53,492 KB
testcase_03 AC 62 ms
71,372 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 53 ms
66,572 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 54 ms
66,708 KB
testcase_14 AC 61 ms
68,712 KB
testcase_15 WA -
testcase_16 AC 96 ms
96,508 KB
testcase_17 WA -
testcase_18 AC 40 ms
55,540 KB
testcase_19 AC 80 ms
89,208 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 113 ms
107,396 KB
testcase_24 AC 71 ms
85,504 KB
testcase_25 AC 84 ms
93,812 KB
testcase_26 WA -
testcase_27 AC 114 ms
107,228 KB
testcase_28 AC 69 ms
84,564 KB
testcase_29 AC 82 ms
93,672 KB
testcase_30 AC 97 ms
104,840 KB
testcase_31 AC 50 ms
66,560 KB
testcase_32 AC 94 ms
100,520 KB
testcase_33 AC 120 ms
100,828 KB
testcase_34 AC 118 ms
100,836 KB
testcase_35 AC 115 ms
100,836 KB
testcase_36 AC 122 ms
100,832 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections
N,M = map(int, input().split())
A = list(map(int, input().split()))
CA = collections.Counter()
for a in A:
    CA[a%M]+=1
    CA[M-a%M]+=0
ans = 0
for k,v in CA.items():
    if k*2==M:
        ans+=1
    else:
        ans+=max(CA[k%M],CA[M-k%M])
print(ans//2)
0