結果

問題 No.1972 Modulo Set
ユーザー 👑 KazunKazun
提出日時 2021-08-20 23:22:14
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 242 bytes
コンパイル時間 327 ms
コンパイル使用メモリ 81,768 KB
実行使用メモリ 107,360 KB
最終ジャッジ日時 2023-10-21 06:04:08
合計ジャッジ時間 5,284 ms
ジャッジサーバーID
(参考情報)
judge9 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
53,452 KB
testcase_01 AC 44 ms
53,452 KB
testcase_02 AC 42 ms
53,452 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 58 ms
66,500 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 57 ms
66,620 KB
testcase_14 AC 59 ms
66,636 KB
testcase_15 WA -
testcase_16 AC 101 ms
93,780 KB
testcase_17 AC 69 ms
74,504 KB
testcase_18 AC 42 ms
55,500 KB
testcase_19 AC 92 ms
89,404 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 88 ms
87,384 KB
testcase_23 AC 129 ms
104,188 KB
testcase_24 AC 79 ms
83,620 KB
testcase_25 AC 94 ms
94,048 KB
testcase_26 WA -
testcase_27 AC 130 ms
104,284 KB
testcase_28 AC 78 ms
84,740 KB
testcase_29 AC 91 ms
91,924 KB
testcase_30 AC 109 ms
103,952 KB
testcase_31 AC 56 ms
64,428 KB
testcase_32 AC 100 ms
100,260 KB
testcase_33 AC 138 ms
107,360 KB
testcase_34 AC 140 ms
107,360 KB
testcase_35 AC 141 ms
107,360 KB
testcase_36 AC 142 ms
107,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

N,M=map(int,input().split())

A=list(map(int,input().split()))
D=defaultdict(int)

for a in A:
    D[a%M]+=1

X=0
K=list(D.keys())
for a in K:
    b=(M-a)%M
    X+=max(D[a],D[b])
    D[a]=D[b]=0

print(X)
0