結果

問題 No.1972 Modulo Set
ユーザー mkawa2mkawa2
提出日時 2022-06-10 22:28:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 146 ms / 2,000 ms
コード長 303 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 81,944 KB
実行使用メモリ 99,888 KB
最終ジャッジ日時 2024-04-15 08:52:37
合計ジャッジ時間 5,357 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
54,252 KB
testcase_01 AC 52 ms
53,624 KB
testcase_02 AC 47 ms
54,404 KB
testcase_03 AC 78 ms
70,384 KB
testcase_04 AC 75 ms
71,656 KB
testcase_05 AC 76 ms
73,156 KB
testcase_06 AC 86 ms
78,344 KB
testcase_07 AC 104 ms
84,100 KB
testcase_08 AC 73 ms
72,916 KB
testcase_09 AC 67 ms
65,784 KB
testcase_10 AC 78 ms
71,972 KB
testcase_11 AC 104 ms
83,784 KB
testcase_12 AC 75 ms
70,124 KB
testcase_13 AC 67 ms
65,628 KB
testcase_14 AC 61 ms
66,160 KB
testcase_15 AC 111 ms
86,992 KB
testcase_16 AC 126 ms
89,288 KB
testcase_17 AC 80 ms
76,120 KB
testcase_18 AC 50 ms
54,868 KB
testcase_19 AC 110 ms
86,072 KB
testcase_20 AC 120 ms
91,044 KB
testcase_21 AC 92 ms
77,800 KB
testcase_22 AC 104 ms
82,372 KB
testcase_23 AC 132 ms
99,888 KB
testcase_24 AC 87 ms
78,528 KB
testcase_25 AC 93 ms
84,528 KB
testcase_26 AC 131 ms
92,368 KB
testcase_27 AC 135 ms
98,444 KB
testcase_28 AC 80 ms
76,504 KB
testcase_29 AC 88 ms
82,956 KB
testcase_30 AC 101 ms
90,584 KB
testcase_31 AC 63 ms
64,944 KB
testcase_32 AC 97 ms
87,356 KB
testcase_33 AC 146 ms
97,740 KB
testcase_34 AC 141 ms
97,716 KB
testcase_35 AC 139 ms
98,084 KB
testcase_36 AC 142 ms
97,736 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
n,m=map(int,input().split())
ac=Counter(int(a)%m for a in input().split())
ans=0
for a,c in ac.items():
    if a==0 or a*2==m:continue
    b=-a%m
    if c<ac[b]:continue
    if c==ac[b] and a<b:continue
    ans+=c
if ac[0]:ans+=1
if m%2==0 and ac[m//2]:ans+=1
print(ans)
0