結果

問題 No.1972 Modulo Set
ユーザー ニックネームニックネーム
提出日時 2022-06-10 21:41:00
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 217 bytes
コンパイル時間 96 ms
コンパイル使用メモリ 11,720 KB
実行使用メモリ 26,088 KB
最終ジャッジ日時 2023-10-21 04:59:04
合計ジャッジ時間 5,780 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,048 KB
testcase_01 AC 28 ms
10,048 KB
testcase_02 AC 28 ms
10,048 KB
testcase_03 AC 38 ms
11,556 KB
testcase_04 AC 41 ms
12,388 KB
testcase_05 AC 44 ms
13,048 KB
testcase_06 AC 54 ms
14,576 KB
testcase_07 AC 71 ms
16,808 KB
testcase_08 AC 49 ms
13,432 KB
testcase_09 AC 32 ms
10,328 KB
testcase_10 AC 42 ms
12,644 KB
testcase_11 AC 68 ms
16,772 KB
testcase_12 AC 34 ms
10,912 KB
testcase_13 AC 43 ms
10,768 KB
testcase_14 AC 40 ms
10,792 KB
testcase_15 AC 74 ms
16,376 KB
testcase_16 AC 84 ms
16,568 KB
testcase_17 AC 45 ms
12,208 KB
testcase_18 AC 29 ms
10,100 KB
testcase_19 AC 79 ms
15,268 KB
testcase_20 AC 84 ms
16,404 KB
testcase_21 AC 49 ms
12,836 KB
testcase_22 AC 79 ms
14,404 KB
testcase_23 AC 266 ms
22,060 KB
testcase_24 AC 239 ms
17,564 KB
testcase_25 AC 294 ms
20,000 KB
testcase_26 AC 90 ms
18,480 KB
testcase_27 AC 352 ms
24,124 KB
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 AC 403 ms
26,088 KB
testcase_34 AC 392 ms
26,088 KB
testcase_35 AC 397 ms
26,088 KB
testcase_36 AC 392 ms
26,088 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
cnt = [0]*m
for v in map(int, input().split()): cnt[v%m] += 1
ans = 0
for i in range(m//2+1):
    if i*2%m == 0: ans += min(cnt[i], 1)
    else: ans += max(cnt[i], cnt[m-i])
print(ans)
0