結果

問題 No.1972 Modulo Set
ユーザー minimumminimum
提出日時 2022-06-10 21:29:53
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 328 bytes
コンパイル時間 808 ms
コンパイル使用メモリ 81,284 KB
実行使用メモリ 899,448 KB
最終ジャッジ日時 2023-10-21 04:52:40
合計ジャッジ時間 8,272 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 MLE -
testcase_01 AC 43 ms
53,272 KB
testcase_02 AC 43 ms
53,272 KB
testcase_03 AC 64 ms
69,020 KB
testcase_04 AC 62 ms
70,900 KB
testcase_05 AC 62 ms
72,232 KB
testcase_06 AC 69 ms
79,964 KB
testcase_07 AC 81 ms
87,484 KB
testcase_08 AC 61 ms
73,564 KB
testcase_09 AC 58 ms
66,284 KB
testcase_10 AC 60 ms
71,440 KB
testcase_11 AC 78 ms
85,824 KB
testcase_12 AC 60 ms
68,616 KB
testcase_13 AC 65 ms
73,356 KB
testcase_14 AC 63 ms
70,832 KB
testcase_15 AC 95 ms
91,740 KB
testcase_16 AC 102 ms
94,380 KB
testcase_17 AC 71 ms
76,660 KB
testcase_18 AC 47 ms
61,816 KB
testcase_19 AC 99 ms
89,364 KB
testcase_20 AC 105 ms
95,100 KB
testcase_21 AC 74 ms
77,976 KB
testcase_22 AC 93 ms
91,100 KB
testcase_23 AC 210 ms
170,956 KB
testcase_24 AC 173 ms
175,584 KB
testcase_25 AC 202 ms
200,544 KB
testcase_26 AC 104 ms
96,308 KB
testcase_27 AC 238 ms
219,536 KB
testcase_28 MLE -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict


N, M = map(int, input().split())
A = list(map(int, input().split()))

r = defaultdict(int)
for i in range(N):
    r[A[i] % M] += 1

ans = 0
if 0 in r:
    ans += 1
if M % 2 == 0 and (M // 2 in r):
    ans += 1

for i in range(1, (M - 1) // 2 + 1):
    ans += max(r[i], r[M - i])

print(ans)
0