結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
10,036 KB
testcase_01 AC 27 ms
10,036 KB
testcase_02 AC 28 ms
10,036 KB
testcase_03 AC 48 ms
12,076 KB
testcase_04 AC 57 ms
13,040 KB
testcase_05 WA -
testcase_06 AC 69 ms
15,960 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 36 ms
10,564 KB
testcase_10 WA -
testcase_11 AC 97 ms
18,580 KB
testcase_12 AC 40 ms
11,360 KB
testcase_13 AC 37 ms
10,912 KB
testcase_14 AC 37 ms
11,084 KB
testcase_15 AC 120 ms
17,900 KB
testcase_16 AC 145 ms
19,652 KB
testcase_17 AC 68 ms
13,752 KB
testcase_18 AC 26 ms
10,056 KB
testcase_19 AC 129 ms
18,944 KB
testcase_20 AC 162 ms
19,432 KB
testcase_21 AC 72 ms
14,768 KB
testcase_22 AC 120 ms
18,948 KB
testcase_23 AC 260 ms
23,704 KB
testcase_24 AC 115 ms
17,888 KB
testcase_25 AC 165 ms
23,376 KB
testcase_26 WA -
testcase_27 AC 289 ms
24,804 KB
testcase_28 AC 139 ms
17,792 KB
testcase_29 AC 186 ms
23,476 KB
testcase_30 AC 253 ms
23,760 KB
testcase_31 AC 39 ms
10,948 KB
testcase_32 AC 226 ms
23,592 KB
testcase_33 AC 331 ms
33,612 KB
testcase_34 AC 330 ms
33,612 KB
testcase_35 AC 335 ms
33,612 KB
testcase_36 AC 332 ms
33,612 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:
    if b==0:
        d[b]=1
    else:
        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