結果
問題 | No.1972 Modulo Set |
ユーザー | 8nd5t |
提出日時 | 2022-06-10 21:39:29 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 936 bytes |
コンパイル時間 | 202 ms |
コンパイル使用メモリ | 81,668 KB |
実行使用メモリ | 141,608 KB |
最終ジャッジ日時 | 2023-10-21 04:58:20 |
合計ジャッジ時間 | 9,499 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 168 ms
83,784 KB |
testcase_01 | AC | 162 ms
83,776 KB |
testcase_02 | AC | 163 ms
83,784 KB |
testcase_03 | WA | - |
testcase_04 | AC | 185 ms
86,196 KB |
testcase_05 | WA | - |
testcase_06 | AC | 192 ms
92,068 KB |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | AC | 179 ms
84,632 KB |
testcase_10 | WA | - |
testcase_11 | AC | 197 ms
95,784 KB |
testcase_12 | AC | 180 ms
84,644 KB |
testcase_13 | AC | 175 ms
84,632 KB |
testcase_14 | AC | 180 ms
84,640 KB |
testcase_15 | AC | 208 ms
98,764 KB |
testcase_16 | AC | 217 ms
99,372 KB |
testcase_17 | WA | - |
testcase_18 | AC | 164 ms
83,784 KB |
testcase_19 | AC | 214 ms
99,240 KB |
testcase_20 | AC | 222 ms
102,764 KB |
testcase_21 | AC | 192 ms
89,972 KB |
testcase_22 | WA | - |
testcase_23 | AC | 259 ms
131,396 KB |
testcase_24 | AC | 211 ms
99,920 KB |
testcase_25 | AC | 223 ms
109,920 KB |
testcase_26 | WA | - |
testcase_27 | AC | 260 ms
131,968 KB |
testcase_28 | AC | 199 ms
107,816 KB |
testcase_29 | AC | 216 ms
109,432 KB |
testcase_30 | AC | 238 ms
120,284 KB |
testcase_31 | AC | 170 ms
84,632 KB |
testcase_32 | AC | 231 ms
116,836 KB |
testcase_33 | AC | 276 ms
141,604 KB |
testcase_34 | AC | 277 ms
141,604 KB |
testcase_35 | AC | 276 ms
141,588 KB |
testcase_36 | AC | 285 ms
141,608 KB |
ソースコード
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 n == 1: err(1) 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)