結果

問題 No.1972 Modulo Set
ユーザー ikomaikoma
提出日時 2022-06-10 21:55:03
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 332 bytes
コンパイル時間 469 ms
コンパイル使用メモリ 81,736 KB
実行使用メモリ 92,536 KB
最終ジャッジ日時 2023-10-21 05:06:42
合計ジャッジ時間 4,035 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,220 KB
testcase_01 AC 39 ms
53,220 KB
testcase_02 AC 38 ms
53,220 KB
testcase_03 AC 51 ms
64,496 KB
testcase_04 AC 52 ms
68,272 KB
testcase_05 AC 52 ms
69,376 KB
testcase_06 AC 59 ms
72,932 KB
testcase_07 AC 66 ms
82,640 KB
testcase_08 AC 53 ms
70,680 KB
testcase_09 AC 47 ms
61,956 KB
testcase_10 AC 51 ms
66,612 KB
testcase_11 AC 64 ms
81,172 KB
testcase_12 AC 48 ms
64,144 KB
testcase_13 AC 47 ms
62,324 KB
testcase_14 AC 47 ms
62,240 KB
testcase_15 AC 64 ms
79,212 KB
testcase_16 AC 65 ms
79,400 KB
testcase_17 AC 51 ms
66,328 KB
testcase_18 AC 43 ms
59,256 KB
testcase_19 AC 60 ms
75,692 KB
testcase_20 AC 63 ms
79,468 KB
testcase_21 AC 53 ms
69,616 KB
testcase_22 AC 57 ms
72,536 KB
testcase_23 AC 72 ms
87,604 KB
testcase_24 AC 57 ms
74,332 KB
testcase_25 AC 62 ms
77,928 KB
testcase_26 AC 70 ms
85,016 KB
testcase_27 AC 74 ms
89,720 KB
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 AC 78 ms
92,536 KB
testcase_34 AC 76 ms
92,536 KB
testcase_35 AC 79 ms
92,536 KB
testcase_36 AC 77 ms
92,536 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

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

cnt=[0]*M
for a in A:
    cnt[a%M]+=1
ans=0
if cnt[0]>0:
    ans = 1

for i in range(1,(M+1)//2):
    if cnt[i] > cnt[M-i]:
        ans += cnt[i]
    else:
        ans += cnt[M-i]
if M%2==0 and cnt[M//2]>0:
    ans += 1
print(ans)
0