結果
問題 | No.1972 Modulo Set |
ユーザー | 8nd5t |
提出日時 | 2022-06-10 21:36:26 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 892 bytes |
コンパイル時間 | 1,021 ms |
コンパイル使用メモリ | 81,700 KB |
実行使用メモリ | 141,648 KB |
最終ジャッジ日時 | 2023-10-21 04:55:44 |
合計ジャッジ時間 | 9,546 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 137 ms
83,772 KB |
testcase_01 | AC | 142 ms
83,772 KB |
testcase_02 | AC | 142 ms
83,772 KB |
testcase_03 | WA | - |
testcase_04 | AC | 165 ms
86,736 KB |
testcase_05 | WA | - |
testcase_06 | AC | 169 ms
91,736 KB |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | AC | 154 ms
84,628 KB |
testcase_10 | WA | - |
testcase_11 | AC | 177 ms
95,812 KB |
testcase_12 | AC | 162 ms
84,640 KB |
testcase_13 | AC | 153 ms
84,624 KB |
testcase_14 | AC | 156 ms
84,632 KB |
testcase_15 | AC | 180 ms
98,760 KB |
testcase_16 | AC | 196 ms
99,364 KB |
testcase_17 | WA | - |
testcase_18 | AC | 140 ms
83,776 KB |
testcase_19 | AC | 194 ms
98,444 KB |
testcase_20 | AC | 199 ms
102,776 KB |
testcase_21 | AC | 169 ms
90,016 KB |
testcase_22 | WA | - |
testcase_23 | AC | 231 ms
131,244 KB |
testcase_24 | AC | 192 ms
99,928 KB |
testcase_25 | AC | 192 ms
109,552 KB |
testcase_26 | WA | - |
testcase_27 | AC | 224 ms
131,964 KB |
testcase_28 | AC | 181 ms
107,804 KB |
testcase_29 | AC | 200 ms
109,428 KB |
testcase_30 | AC | 220 ms
120,276 KB |
testcase_31 | AC | 155 ms
84,624 KB |
testcase_32 | AC | 207 ms
116,836 KB |
testcase_33 | AC | 254 ms
141,596 KB |
testcase_34 | AC | 244 ms
141,584 KB |
testcase_35 | AC | 247 ms
141,584 KB |
testcase_36 | AC | 246 ms
141,648 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() 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)