結果

問題 No.1972 Modulo Set
ユーザー chineristACchineristAC
提出日時 2022-06-10 21:41:02
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 562 bytes
コンパイル時間 546 ms
コンパイル使用メモリ 81,448 KB
実行使用メモリ 107,000 KB
最終ジャッジ日時 2023-10-21 04:59:09
合計ジャッジ時間 4,793 ms
ジャッジサーバーID
(参考情報)
judge10 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
55,968 KB
testcase_01 AC 48 ms
55,968 KB
testcase_02 AC 49 ms
55,968 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 59 ms
66,960 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 59 ms
66,956 KB
testcase_14 AC 61 ms
66,960 KB
testcase_15 WA -
testcase_16 AC 102 ms
94,268 KB
testcase_17 AC 74 ms
76,764 KB
testcase_18 AC 47 ms
55,968 KB
testcase_19 AC 94 ms
89,516 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 83 ms
84,628 KB
testcase_23 AC 119 ms
102,504 KB
testcase_24 AC 77 ms
80,840 KB
testcase_25 AC 87 ms
86,800 KB
testcase_26 WA -
testcase_27 AC 120 ms
104,184 KB
testcase_28 AC 74 ms
78,760 KB
testcase_29 AC 84 ms
86,716 KB
testcase_30 AC 96 ms
93,764 KB
testcase_31 AC 60 ms
66,948 KB
testcase_32 AC 90 ms
90,956 KB
testcase_33 AC 126 ms
107,000 KB
testcase_34 AC 127 ms
107,000 KB
testcase_35 AC 125 ms
107,000 KB
testcase_36 AC 128 ms
107,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,random,bisect
from collections import deque,defaultdict,Counter
from heapq import heapify,heappop,heappush
from itertools import cycle, permutations
from math import log,gcd

input = lambda :sys.stdin.readline().rstrip()
mi = lambda :map(int,input().split())
li = lambda :list(mi())

N,M = mi()
A = li()

S = {a%M:0 for a in A}
for a in A:
    a %= M
    S[a] += 1
    
res = 0
for a in S:
    if M-a not in S:
        res += S[a]
    else:
        if a < M-a:
            res += max(S[a],S[M-a])
        elif a==M-a:
            res += 1

print(res)
0