結果

問題 No.1972 Modulo Set
ユーザー Omura ShunsukeOmura Shunsuke
提出日時 2022-06-11 17:14:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
MLE  
実行時間 -
コード長 350 bytes
コンパイル時間 117 ms
コンパイル使用メモリ 11,848 KB
実行使用メモリ 814,784 KB
最終ジャッジ日時 2023-10-22 02:53:29
合計ジャッジ時間 9,104 ms
ジャッジサーバーID
(参考情報)
judge13 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,044 KB
testcase_01 AC 30 ms
10,044 KB
testcase_02 AC 33 ms
10,044 KB
testcase_03 AC 45 ms
12,364 KB
testcase_04 AC 51 ms
13,068 KB
testcase_05 AC 54 ms
13,916 KB
testcase_06 AC 68 ms
15,984 KB
testcase_07 AC 90 ms
19,096 KB
testcase_08 AC 57 ms
14,684 KB
testcase_09 AC 36 ms
10,864 KB
testcase_10 AC 51 ms
13,316 KB
testcase_11 AC 90 ms
18,604 KB
testcase_12 AC 40 ms
11,384 KB
testcase_13 AC 61 ms
15,500 KB
testcase_14 AC 55 ms
12,908 KB
testcase_15 AC 107 ms
18,192 KB
testcase_16 AC 125 ms
19,692 KB
testcase_17 AC 60 ms
13,780 KB
testcase_18 AC 34 ms
10,656 KB
testcase_19 AC 116 ms
19,764 KB
testcase_20 AC 133 ms
19,728 KB
testcase_21 AC 66 ms
14,796 KB
testcase_22 AC 113 ms
19,240 KB
testcase_23 AC 443 ms
56,264 KB
testcase_24 AC 392 ms
53,544 KB
testcase_25 AC 490 ms
96,456 KB
testcase_26 AC 131 ms
21,324 KB
testcase_27 AC 582 ms
97,768 KB
testcase_28 MLE -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
A = list(map(int,input().split()))


D = {}
for i in range(M):
    D[i] = 0

for i in range(N):
    D[A[i] % M] += 1
        
ans = 0


for i in range(1,M//2+1):
    if i == M-i:
        if D[i]:
            ans += 1
    else:
        ans += max(D[i],D[M-i])
    #print(i,ans)
if D[0]:
    ans += 1
print(ans)
#print(D)
0