結果

問題 No.1972 Modulo Set
ユーザー pitPpitP
提出日時 2022-06-10 21:53:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 325 bytes
コンパイル時間 235 ms
コンパイル使用メモリ 11,892 KB
実行使用メモリ 36,844 KB
最終ジャッジ日時 2023-10-21 05:05:50
合計ジャッジ時間 6,588 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,080 KB
testcase_01 AC 30 ms
10,080 KB
testcase_02 AC 30 ms
10,080 KB
testcase_03 AC 57 ms
12,648 KB
testcase_04 AC 72 ms
13,348 KB
testcase_05 WA -
testcase_06 AC 109 ms
16,004 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 35 ms
10,624 KB
testcase_10 WA -
testcase_11 AC 157 ms
18,624 KB
testcase_12 AC 47 ms
11,484 KB
testcase_13 AC 38 ms
11,092 KB
testcase_14 AC 39 ms
11,148 KB
testcase_15 AC 168 ms
18,364 KB
testcase_16 AC 172 ms
20,696 KB
testcase_17 AC 77 ms
14,324 KB
testcase_18 AC 29 ms
10,104 KB
testcase_19 AC 137 ms
20,312 KB
testcase_20 AC 168 ms
20,736 KB
testcase_21 AC 84 ms
14,812 KB
testcase_22 AC 121 ms
20,052 KB
testcase_23 AC 210 ms
25,896 KB
testcase_24 AC 98 ms
18,072 KB
testcase_25 AC 139 ms
24,156 KB
testcase_26 WA -
testcase_27 AC 221 ms
26,040 KB
testcase_28 AC 101 ms
18,092 KB
testcase_29 AC 140 ms
22,736 KB
testcase_30 AC 179 ms
25,084 KB
testcase_31 AC 37 ms
11,012 KB
testcase_32 AC 166 ms
23,916 KB
testcase_33 AC 248 ms
36,844 KB
testcase_34 AC 254 ms
36,844 KB
testcase_35 AC 250 ms
36,844 KB
testcase_36 AC 251 ms
36,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
n,m = map(int,input().split())
a = list(map(int,input().split()))
b = [num%m for num in a]

d = defaultdict(int)
ans = 0
for num in b:
    if num == 0:
        ans |= 1
    else:
        d[num] += 1

for num in b:
    ans += max(d[num],d[m-num])
    d[num] = 0
    d[m-num] = 0

print(ans)
0