結果

問題 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
コンパイル時間 511 ms
コンパイル使用メモリ 11,840 KB
実行使用メモリ 36,840 KB
最終ジャッジ日時 2023-10-21 05:05:56
合計ジャッジ時間 6,480 ms
ジャッジサーバーID
(参考情報)
judge10 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,076 KB
testcase_01 AC 30 ms
10,076 KB
testcase_02 AC 29 ms
10,076 KB
testcase_03 AC 56 ms
12,644 KB
testcase_04 AC 71 ms
13,344 KB
testcase_05 WA -
testcase_06 AC 108 ms
16,000 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 35 ms
10,620 KB
testcase_10 WA -
testcase_11 AC 153 ms
18,620 KB
testcase_12 AC 47 ms
11,480 KB
testcase_13 AC 39 ms
11,088 KB
testcase_14 AC 40 ms
11,144 KB
testcase_15 AC 174 ms
18,360 KB
testcase_16 AC 179 ms
20,692 KB
testcase_17 AC 77 ms
14,320 KB
testcase_18 AC 30 ms
10,100 KB
testcase_19 AC 143 ms
20,308 KB
testcase_20 AC 171 ms
20,732 KB
testcase_21 AC 92 ms
14,808 KB
testcase_22 AC 123 ms
20,048 KB
testcase_23 AC 217 ms
25,892 KB
testcase_24 AC 97 ms
18,068 KB
testcase_25 AC 140 ms
24,152 KB
testcase_26 WA -
testcase_27 AC 221 ms
26,036 KB
testcase_28 AC 104 ms
18,088 KB
testcase_29 AC 144 ms
22,732 KB
testcase_30 AC 182 ms
25,080 KB
testcase_31 AC 37 ms
11,008 KB
testcase_32 AC 164 ms
23,912 KB
testcase_33 AC 256 ms
36,840 KB
testcase_34 AC 250 ms
36,840 KB
testcase_35 AC 252 ms
36,840 KB
testcase_36 AC 260 ms
36,840 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