結果

問題 No.1972 Modulo Set
ユーザー tonyu0tonyu0
提出日時 2022-06-10 23:26:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 249 bytes
コンパイル時間 82 ms
コンパイル使用メモリ 11,752 KB
実行使用メモリ 33,664 KB
最終ジャッジ日時 2023-10-21 05:46:18
合計ジャッジ時間 6,630 ms
ジャッジサーバーID
(参考情報)
judge10 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,088 KB
testcase_01 AC 29 ms
10,088 KB
testcase_02 AC 29 ms
10,088 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 34 ms
10,616 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 41 ms
10,964 KB
testcase_14 AC 43 ms
11,136 KB
testcase_15 WA -
testcase_16 AC 157 ms
19,704 KB
testcase_17 AC 69 ms
13,804 KB
testcase_18 AC 29 ms
10,112 KB
testcase_19 AC 142 ms
18,992 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 131 ms
19,000 KB
testcase_23 AC 281 ms
23,752 KB
testcase_24 AC 129 ms
17,940 KB
testcase_25 AC 188 ms
23,428 KB
testcase_26 WA -
testcase_27 AC 296 ms
24,856 KB
testcase_28 AC 134 ms
17,840 KB
testcase_29 AC 196 ms
23,528 KB
testcase_30 AC 262 ms
23,812 KB
testcase_31 AC 40 ms
11,000 KB
testcase_32 AC 232 ms
23,644 KB
testcase_33 AC 339 ms
33,664 KB
testcase_34 AC 344 ms
33,664 KB
testcase_35 AC 356 ms
33,664 KB
testcase_36 AC 343 ms
33,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
n,m=map(int,input().split())
a=list(map(lambda x : int(x) % m,input().split()))
d=defaultdict(int)
for b in a:
    d[b]+=1
    d[m-b]
ans=0
for k in d.keys():
    ans+=max(d[k],d[m-k])
    d[k]=d[m-k]=0
print(ans)
0