結果

問題 No.1972 Modulo Set
ユーザー 河野竜也河野竜也
提出日時 2022-06-23 13:13:01
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 303 bytes
コンパイル時間 336 ms
コンパイル使用メモリ 82,364 KB
実行使用メモリ 695,312 KB
最終ジャッジ日時 2024-04-24 18:45:30
合計ジャッジ時間 7,895 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
58,752 KB
testcase_01 AC 42 ms
53,760 KB
testcase_02 AC 42 ms
53,504 KB
testcase_03 AC 59 ms
69,376 KB
testcase_04 AC 62 ms
71,936 KB
testcase_05 AC 64 ms
73,088 KB
testcase_06 AC 70 ms
79,744 KB
testcase_07 AC 85 ms
90,112 KB
testcase_08 AC 61 ms
73,088 KB
testcase_09 AC 60 ms
66,816 KB
testcase_10 AC 63 ms
72,448 KB
testcase_11 AC 82 ms
86,784 KB
testcase_12 AC 62 ms
68,224 KB
testcase_13 AC 73 ms
74,368 KB
testcase_14 AC 70 ms
71,808 KB
testcase_15 AC 101 ms
91,904 KB
testcase_16 AC 108 ms
93,952 KB
testcase_17 AC 82 ms
76,928 KB
testcase_18 AC 56 ms
63,104 KB
testcase_19 AC 111 ms
90,112 KB
testcase_20 AC 113 ms
95,744 KB
testcase_21 AC 81 ms
78,976 KB
testcase_22 AC 101 ms
89,472 KB
testcase_23 AC 256 ms
171,360 KB
testcase_24 AC 214 ms
176,384 KB
testcase_25 AC 253 ms
201,216 KB
testcase_26 AC 111 ms
97,152 KB
testcase_27 AC 316 ms
220,316 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()))
d=defaultdict(int)
for i in range(n):
  d[a[i]%m]+=1
ans=0
if d[0]:
  ans+=1
for i in range(1,m):
  if i*2==m:
    if d[i]:
      ans+=1
  else:
    ans+=max(d[i],d[m-i])
    d[i]=0
    d[m-i]=0
print(ans)
0