結果

問題 No.1972 Modulo Set
ユーザー tonyu0tonyu0
提出日時 2022-06-10 23:17:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 279 bytes
コンパイル時間 262 ms
コンパイル使用メモリ 11,884 KB
実行使用メモリ 33,704 KB
最終ジャッジ日時 2023-10-21 05:43:22
合計ジャッジ時間 7,104 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,128 KB
testcase_01 AC 30 ms
10,128 KB
testcase_02 AC 30 ms
10,128 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 36 ms
10,656 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 43 ms
11,008 KB
testcase_14 AC 43 ms
11,176 KB
testcase_15 WA -
testcase_16 AC 162 ms
19,744 KB
testcase_17 AC 72 ms
13,844 KB
testcase_18 AC 31 ms
10,148 KB
testcase_19 AC 146 ms
19,036 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 138 ms
19,040 KB
testcase_23 AC 300 ms
23,796 KB
testcase_24 AC 134 ms
17,980 KB
testcase_25 AC 191 ms
23,472 KB
testcase_26 WA -
testcase_27 AC 311 ms
24,900 KB
testcase_28 AC 142 ms
17,884 KB
testcase_29 AC 201 ms
23,572 KB
testcase_30 AC 274 ms
23,852 KB
testcase_31 AC 45 ms
11,044 KB
testcase_32 AC 247 ms
23,684 KB
testcase_33 AC 350 ms
33,704 KB
testcase_34 AC 355 ms
33,704 KB
testcase_35 AC 353 ms
33,704 KB
testcase_36 AC 346 ms
33,704 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():
    if k==0:
        continue
    ans+=max(d[k],d[m-k])
    d[k]=d[m-k]=0
print(ans)
0