結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
53,492 KB
testcase_01 AC 43 ms
53,492 KB
testcase_02 AC 43 ms
53,492 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 61 ms
66,572 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 62 ms
66,708 KB
testcase_14 AC 64 ms
68,712 KB
testcase_15 WA -
testcase_16 AC 104 ms
96,496 KB
testcase_17 AC 67 ms
74,576 KB
testcase_18 AC 44 ms
55,540 KB
testcase_19 AC 88 ms
89,208 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 84 ms
87,164 KB
testcase_23 AC 127 ms
107,384 KB
testcase_24 AC 80 ms
85,504 KB
testcase_25 AC 91 ms
93,812 KB
testcase_26 WA -
testcase_27 AC 126 ms
107,216 KB
testcase_28 AC 79 ms
84,564 KB
testcase_29 AC 91 ms
93,672 KB
testcase_30 AC 116 ms
104,840 KB
testcase_31 AC 56 ms
66,560 KB
testcase_32 AC 102 ms
100,508 KB
testcase_33 AC 138 ms
100,828 KB
testcase_34 AC 139 ms
100,828 KB
testcase_35 AC 142 ms
100,836 KB
testcase_36 AC 146 ms
100,824 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+=2
    else:
        ans+=max(CA[k%M],CA[M-k%M])
print(ans//2)
0