結果

問題 No.1972 Modulo Set
ユーザー Omura ShunsukeOmura Shunsuke
提出日時 2022-06-11 17:11:11
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 350 bytes
コンパイル時間 199 ms
コンパイル使用メモリ 81,692 KB
実行使用メモリ 832,816 KB
最終ジャッジ日時 2023-10-22 02:50:13
合計ジャッジ時間 7,792 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,444 KB
testcase_01 AC 33 ms
53,444 KB
testcase_02 AC 33 ms
53,444 KB
testcase_03 AC 52 ms
67,088 KB
testcase_04 AC 47 ms
68,960 KB
testcase_05 AC 46 ms
70,292 KB
testcase_06 AC 54 ms
78,024 KB
testcase_07 AC 62 ms
86,208 KB
testcase_08 AC 47 ms
71,512 KB
testcase_09 AC 42 ms
62,288 KB
testcase_10 AC 46 ms
69,504 KB
testcase_11 AC 60 ms
84,852 KB
testcase_12 AC 43 ms
64,616 KB
testcase_13 AC 48 ms
71,420 KB
testcase_14 AC 49 ms
68,888 KB
testcase_15 AC 65 ms
88,228 KB
testcase_16 AC 70 ms
93,284 KB
testcase_17 AC 50 ms
72,648 KB
testcase_18 AC 38 ms
59,792 KB
testcase_19 AC 66 ms
88,340 KB
testcase_20 AC 73 ms
95,600 KB
testcase_21 AC 51 ms
73,964 KB
testcase_22 AC 65 ms
88,336 KB
testcase_23 AC 173 ms
187,248 KB
testcase_24 AC 150 ms
172,328 KB
testcase_25 AC 160 ms
196,920 KB
testcase_26 AC 73 ms
94,700 KB
testcase_27 AC 204 ms
236,080 KB
testcase_28 MLE -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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


D = {}
for i in range(M):
    D[i] = 0

for i in range(N):
    D[A[i] % M] += 1
        
ans = 0


for i in range(1,M//2+1):
    if i == M-i:
        if D[i]:
            ans += 1
    else:
        ans += max(D[i],D[M-i])
    #print(i,ans)
if D[0]:
    ans += 1
print(ans)
#print(D)
0