結果

問題 No.1972 Modulo Set
ユーザー pitPpitP
提出日時 2022-06-10 21:44:00
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 324 bytes
コンパイル時間 200 ms
コンパイル使用メモリ 81,488 KB
実行使用メモリ 106,180 KB
最終ジャッジ日時 2023-10-21 05:00:44
合計ジャッジ時間 5,058 ms
ジャッジサーバーID
(参考情報)
judge10 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
53,312 KB
testcase_01 AC 44 ms
53,312 KB
testcase_02 AC 45 ms
53,312 KB
testcase_03 AC 68 ms
71,312 KB
testcase_04 AC 67 ms
73,240 KB
testcase_05 WA -
testcase_06 AC 79 ms
80,452 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 58 ms
66,348 KB
testcase_10 WA -
testcase_11 AC 94 ms
88,588 KB
testcase_12 AC 63 ms
68,700 KB
testcase_13 AC 59 ms
66,484 KB
testcase_14 AC 59 ms
66,484 KB
testcase_15 AC 102 ms
91,804 KB
testcase_16 AC 108 ms
93,916 KB
testcase_17 AC 73 ms
74,592 KB
testcase_18 AC 45 ms
55,360 KB
testcase_19 AC 98 ms
89,936 KB
testcase_20 AC 110 ms
95,428 KB
testcase_21 AC 76 ms
78,316 KB
testcase_22 AC 92 ms
87,344 KB
testcase_23 AC 134 ms
104,060 KB
testcase_24 AC 83 ms
83,492 KB
testcase_25 AC 101 ms
93,924 KB
testcase_26 WA -
testcase_27 AC 133 ms
104,156 KB
testcase_28 AC 80 ms
84,604 KB
testcase_29 AC 94 ms
91,788 KB
testcase_30 AC 114 ms
103,816 KB
testcase_31 AC 58 ms
64,292 KB
testcase_32 AC 107 ms
100,124 KB
testcase_33 AC 144 ms
106,180 KB
testcase_34 AC 143 ms
106,180 KB
testcase_35 AC 144 ms
106,180 KB
testcase_36 AC 148 ms
106,180 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

d = defaultdict(int)

for num in a:
    d[num] += 1

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

if 0 in a:
    ans += 1

print(ans)
0