結果

問題 No.1972 Modulo Set
ユーザー roarisroaris
提出日時 2022-06-10 22:20:22
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 337 bytes
コンパイル時間 1,156 ms
コンパイル使用メモリ 81,720 KB
実行使用メモリ 683,128 KB
最終ジャッジ日時 2023-10-21 05:22:10
合計ジャッジ時間 8,027 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
60,548 KB
testcase_01 AC 38 ms
53,520 KB
testcase_02 AC 37 ms
53,520 KB
testcase_03 AC 61 ms
69,080 KB
testcase_04 AC 53 ms
70,808 KB
testcase_05 AC 52 ms
72,048 KB
testcase_06 AC 62 ms
79,564 KB
testcase_07 AC 70 ms
86,668 KB
testcase_08 AC 53 ms
73,316 KB
testcase_09 AC 51 ms
66,548 KB
testcase_10 AC 53 ms
71,328 KB
testcase_11 AC 67 ms
85,056 KB
testcase_12 AC 53 ms
68,736 KB
testcase_13 AC 56 ms
73,620 KB
testcase_14 AC 55 ms
71,096 KB
testcase_15 AC 83 ms
91,068 KB
testcase_16 AC 94 ms
93,708 KB
testcase_17 AC 69 ms
76,584 KB
testcase_18 AC 47 ms
62,084 KB
testcase_19 AC 93 ms
88,676 KB
testcase_20 AC 91 ms
94,452 KB
testcase_21 AC 67 ms
77,812 KB
testcase_22 AC 79 ms
90,736 KB
testcase_23 AC 189 ms
171,244 KB
testcase_24 AC 141 ms
175,428 KB
testcase_25 AC 164 ms
200,168 KB
testcase_26 AC 89 ms
95,332 KB
testcase_27 AC 210 ms
219,804 KB
testcase_28 MLE -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from collections import *

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

for Ai in A:
    cnt[Ai%M] += 1

ans = 0

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

ans += min(1, cnt[0])

if M%2==0:
    ans += min(1, cnt[M//2])

print(ans)
0