結果

問題 No.1972 Modulo Set
ユーザー 👑 H20H20
提出日時 2022-06-10 21:36:55
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 282 bytes
コンパイル時間 217 ms
コンパイル使用メモリ 81,760 KB
実行使用メモリ 107,384 KB
最終ジャッジ日時 2023-10-21 04:56:23
合計ジャッジ時間 4,570 ms
ジャッジサーバーID
(参考情報)
judge13 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,524 KB
testcase_01 AC 41 ms
53,524 KB
testcase_02 AC 45 ms
53,524 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 54 ms
66,572 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 54 ms
66,708 KB
testcase_14 AC 53 ms
68,712 KB
testcase_15 WA -
testcase_16 AC 91 ms
96,496 KB
testcase_17 AC 60 ms
74,576 KB
testcase_18 AC 39 ms
55,572 KB
testcase_19 AC 80 ms
89,148 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 74 ms
87,164 KB
testcase_23 AC 113 ms
107,384 KB
testcase_24 AC 74 ms
85,504 KB
testcase_25 AC 85 ms
93,752 KB
testcase_26 WA -
testcase_27 AC 112 ms
107,216 KB
testcase_28 AC 71 ms
84,560 KB
testcase_29 AC 85 ms
93,668 KB
testcase_30 AC 103 ms
104,780 KB
testcase_31 AC 52 ms
66,556 KB
testcase_32 AC 92 ms
100,452 KB
testcase_33 AC 127 ms
100,892 KB
testcase_34 AC 124 ms
100,844 KB
testcase_35 AC 123 ms
100,848 KB
testcase_36 AC 122 ms
100,840 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 or k==0:
        ans+=2
    else:
        ans+=max(CA[k],CA[M-k])
print(ans//2)
0