結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 160 ms
83,780 KB
testcase_01 AC 156 ms
83,780 KB
testcase_02 AC 158 ms
83,784 KB
testcase_03 WA -
testcase_04 AC 175 ms
86,344 KB
testcase_05 WA -
testcase_06 AC 187 ms
92,068 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 173 ms
84,636 KB
testcase_10 WA -
testcase_11 AC 193 ms
95,792 KB
testcase_12 AC 174 ms
84,644 KB
testcase_13 AC 169 ms
84,628 KB
testcase_14 AC 175 ms
84,644 KB
testcase_15 AC 206 ms
98,764 KB
testcase_16 AC 208 ms
99,368 KB
testcase_17 WA -
testcase_18 AC 160 ms
83,780 KB
testcase_19 AC 208 ms
98,456 KB
testcase_20 AC 219 ms
102,772 KB
testcase_21 AC 189 ms
89,976 KB
testcase_22 WA -
testcase_23 AC 260 ms
131,408 KB
testcase_24 AC 208 ms
99,924 KB
testcase_25 AC 226 ms
109,908 KB
testcase_26 WA -
testcase_27 AC 271 ms
131,968 KB
testcase_28 AC 202 ms
107,812 KB
testcase_29 AC 217 ms
109,420 KB
testcase_30 AC 238 ms
120,284 KB
testcase_31 AC 171 ms
84,628 KB
testcase_32 AC 230 ms
116,840 KB
testcase_33 AC 278 ms
141,604 KB
testcase_34 AC 277 ms
141,600 KB
testcase_35 AC 278 ms
141,596 KB
testcase_36 AC 284 ms
141,612 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(1)
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