結果

問題 No.1972 Modulo Set
ユーザー taiga0629kyoprotaiga0629kyopro
提出日時 2022-06-12 12:14:02
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 342 bytes
コンパイル時間 237 ms
コンパイル使用メモリ 81,524 KB
実行使用メモリ 126,280 KB
最終ジャッジ日時 2023-10-24 05:36:43
合計ジャッジ時間 5,013 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,272 KB
testcase_01 AC 40 ms
53,272 KB
testcase_02 AC 38 ms
53,272 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 56 ms
66,424 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 55 ms
66,668 KB
testcase_14 AC 58 ms
68,740 KB
testcase_15 WA -
testcase_16 AC 106 ms
101,060 KB
testcase_17 AC 70 ms
77,876 KB
testcase_18 AC 39 ms
53,272 KB
testcase_19 AC 100 ms
97,104 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 95 ms
96,168 KB
testcase_23 AC 145 ms
124,600 KB
testcase_24 AC 88 ms
94,328 KB
testcase_25 AC 106 ms
108,596 KB
testcase_26 WA -
testcase_27 AC 145 ms
126,280 KB
testcase_28 AC 86 ms
94,412 KB
testcase_29 AC 105 ms
107,888 KB
testcase_30 AC 125 ms
124,400 KB
testcase_31 AC 56 ms
66,420 KB
testcase_32 AC 119 ms
118,644 KB
testcase_33 AC 160 ms
122,752 KB
testcase_34 AC 165 ms
122,772 KB
testcase_35 AC 162 ms
122,760 KB
testcase_36 AC 163 ms
122,740 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from _collections import defaultdict
n,m=map(int,input().split())
s=set()
a=list(map(int,input().split()))
for i in range(n):a[i]%=m
cnt=defaultdict(int)

ans=0
nod=set()

for x in a:
    cnt[x]+=1
for x in cnt:
    nod.add(x)
    nod.add((m-x)%m)

for x in nod:
    y=(m-x)%m
    if y<x:continue
    ans+=max(cnt[x],cnt[y])
print(ans)





0