結果

問題 No.1972 Modulo Set
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2022-06-10 22:28:20
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 429 bytes
コンパイル時間 608 ms
コンパイル使用メモリ 81,620 KB
実行使用メモリ 107,044 KB
最終ジャッジ日時 2023-10-21 05:26:27
合計ジャッジ時間 4,638 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,468 KB
testcase_01 AC 41 ms
53,468 KB
testcase_02 AC 40 ms
53,468 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 51 ms
64,380 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 48 ms
62,248 KB
testcase_14 AC 51 ms
64,388 KB
testcase_15 WA -
testcase_16 AC 95 ms
93,200 KB
testcase_17 AC 63 ms
74,180 KB
testcase_18 AC 38 ms
53,468 KB
testcase_19 AC 79 ms
85,348 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 75 ms
83,744 KB
testcase_23 AC 107 ms
101,756 KB
testcase_24 AC 66 ms
78,272 KB
testcase_25 AC 73 ms
84,212 KB
testcase_26 WA -
testcase_27 AC 96 ms
100,512 KB
testcase_28 AC 60 ms
74,128 KB
testcase_29 AC 67 ms
82,084 KB
testcase_30 AC 78 ms
90,852 KB
testcase_31 AC 45 ms
62,312 KB
testcase_32 AC 74 ms
88,372 KB
testcase_33 AC 112 ms
107,044 KB
testcase_34 AC 110 ms
107,044 KB
testcase_35 AC 110 ms
107,044 KB
testcase_36 AC 113 ms
107,044 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int,input().split())
dic = {}
A = list(map(int,input().split()))
for a in A:
    dic[a%m] = dic.get(a%m,0) + 1
    
ans = 0
done = set()
for key,value in dic.items():
    if key in done:
        continue
    if m-key in dic:
        if m-key == key:
            ans += 1
        else:
            val2 = dic[m-key]
            ans += max(value,val2)
            done.add(m-key)
    else:
        ans += value
print(ans)
0