結果

問題 No.1972 Modulo Set
ユーザー prussian_coderprussian_coder
提出日時 2022-06-10 21:55:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 157 ms / 2,000 ms
コード長 265 bytes
コンパイル時間 320 ms
コンパイル使用メモリ 82,788 KB
実行使用メモリ 109,952 KB
最終ジャッジ日時 2024-04-15 08:49:59
合計ジャッジ時間 5,217 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
54,016 KB
testcase_01 AC 44 ms
53,376 KB
testcase_02 AC 48 ms
53,760 KB
testcase_03 AC 65 ms
70,272 KB
testcase_04 AC 66 ms
71,296 KB
testcase_05 AC 65 ms
71,552 KB
testcase_06 AC 72 ms
77,568 KB
testcase_07 AC 87 ms
85,340 KB
testcase_08 AC 62 ms
69,888 KB
testcase_09 AC 60 ms
65,792 KB
testcase_10 AC 64 ms
70,916 KB
testcase_11 AC 87 ms
84,608 KB
testcase_12 AC 67 ms
68,480 KB
testcase_13 AC 57 ms
65,280 KB
testcase_14 AC 62 ms
67,072 KB
testcase_15 AC 97 ms
88,192 KB
testcase_16 AC 103 ms
89,964 KB
testcase_17 AC 73 ms
75,520 KB
testcase_18 AC 45 ms
53,888 KB
testcase_19 AC 95 ms
92,416 KB
testcase_20 AC 109 ms
91,520 KB
testcase_21 AC 74 ms
77,568 KB
testcase_22 AC 93 ms
89,856 KB
testcase_23 AC 142 ms
103,372 KB
testcase_24 AC 88 ms
86,400 KB
testcase_25 AC 103 ms
98,176 KB
testcase_26 AC 110 ms
91,776 KB
testcase_27 AC 141 ms
103,560 KB
testcase_28 AC 81 ms
85,504 KB
testcase_29 AC 97 ms
96,640 KB
testcase_30 AC 117 ms
109,952 KB
testcase_31 AC 57 ms
64,768 KB
testcase_32 AC 113 ms
104,960 KB
testcase_33 AC 154 ms
109,200 KB
testcase_34 AC 156 ms
109,008 KB
testcase_35 AC 155 ms
109,228 KB
testcase_36 AC 157 ms
109,280 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M=map(int,input().split())
from collections import Counter
A=Counter([int(x)%M for x in input().split()])
ans=0
T=set()
for a in A:
	if a*2==M or a==0:
		if A[a]>=1:
			ans+=1
	else:
		if not a in T:
			ans+=max(A[a],A[M-a])
			T.add(a)
			T.add(M-a)
print(ans)		
0