結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,148 KB
testcase_01 AC 29 ms
10,148 KB
testcase_02 AC 26 ms
10,148 KB
testcase_03 AC 44 ms
12,200 KB
testcase_04 AC 53 ms
13,164 KB
testcase_05 WA -
testcase_06 AC 71 ms
16,084 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 29 ms
10,688 KB
testcase_10 WA -
testcase_11 AC 92 ms
18,704 KB
testcase_12 AC 38 ms
11,484 KB
testcase_13 AC 37 ms
11,036 KB
testcase_14 AC 38 ms
11,208 KB
testcase_15 AC 121 ms
18,024 KB
testcase_16 AC 144 ms
19,776 KB
testcase_17 AC 62 ms
13,876 KB
testcase_18 AC 25 ms
10,168 KB
testcase_19 AC 121 ms
19,068 KB
testcase_20 AC 148 ms
19,556 KB
testcase_21 AC 73 ms
14,892 KB
testcase_22 AC 117 ms
19,072 KB
testcase_23 AC 259 ms
23,828 KB
testcase_24 AC 118 ms
18,012 KB
testcase_25 AC 182 ms
23,500 KB
testcase_26 WA -
testcase_27 AC 283 ms
24,928 KB
testcase_28 AC 132 ms
17,916 KB
testcase_29 AC 178 ms
23,600 KB
testcase_30 AC 227 ms
23,884 KB
testcase_31 AC 37 ms
11,072 KB
testcase_32 AC 205 ms
23,716 KB
testcase_33 AC 327 ms
33,736 KB
testcase_34 AC 314 ms
33,736 KB
testcase_35 AC 303 ms
33,736 KB
testcase_36 AC 317 ms
33,736 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
zero=0
for k in d.keys():
    if k==0:
        zero=1
    else:
        ans+=max(d[k],d[m-k])
    d[k]=0
    d[m-k]=0
print(ans+zero)
0