結果

問題 No.1972 Modulo Set
ユーザー 8nd5t8nd5t
提出日時 2022-06-10 21:39:13
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 914 bytes
コンパイル時間 200 ms
コンパイル使用メモリ 81,728 KB
実行使用メモリ 141,996 KB
最終ジャッジ日時 2023-10-21 04:57:54
合計ジャッジ時間 8,571 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 148 ms
84,136 KB
testcase_01 AC 140 ms
84,136 KB
testcase_02 AC 143 ms
84,136 KB
testcase_03 WA -
testcase_04 AC 155 ms
86,728 KB
testcase_05 WA -
testcase_06 AC 170 ms
92,456 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 164 ms
85,028 KB
testcase_10 WA -
testcase_11 AC 178 ms
96,176 KB
testcase_12 AC 164 ms
85,036 KB
testcase_13 AC 152 ms
85,028 KB
testcase_14 AC 151 ms
85,032 KB
testcase_15 AC 188 ms
99,152 KB
testcase_16 AC 197 ms
99,764 KB
testcase_17 WA -
testcase_18 AC 144 ms
84,136 KB
testcase_19 AC 186 ms
98,852 KB
testcase_20 AC 206 ms
103,172 KB
testcase_21 AC 168 ms
90,368 KB
testcase_22 WA -
testcase_23 AC 227 ms
131,792 KB
testcase_24 AC 188 ms
100,312 KB
testcase_25 AC 211 ms
110,300 KB
testcase_26 WA -
testcase_27 AC 243 ms
132,360 KB
testcase_28 AC 179 ms
108,200 KB
testcase_29 AC 193 ms
109,820 KB
testcase_30 AC 216 ms
120,676 KB
testcase_31 AC 151 ms
85,024 KB
testcase_32 AC 215 ms
117,240 KB
testcase_33 AC 241 ms
141,988 KB
testcase_34 AC 254 ms
141,996 KB
testcase_35 AC 248 ms
141,996 KB
testcase_36 AC 251 ms
141,996 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
from bisect import bisect_left,bisect_right 
import sys,math,itertools,pprint,fractions
sys.setrecursionlimit(10**8)
mod = 998244353
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_1(): return list(map(lambda x:int(x)-1, sys.stdin.readline().split()))
def inplm(): return map(int, sys.stdin.readline().split())
def inpl_1m(): return map(lambda x:int(x)-1, sys.stdin.readline().split())
def err(x): print(x); exit()

n,m = inpl()
a = inpl()
if m == 1:
    err(0)
d = defaultdict(int)
for x in a:
    d[x%m] += 1
res = n
seen = set()
for key in list(d):
    if key in seen:
        continue
    if key == 0:
        res -= d[key]-1
    else:
        seen.add(key)
        seen.add(m-key)
        res -= min(d[key], d[m-key])
print(res)
0