結果
問題 |
No.1972 Modulo Set
|
ユーザー |
![]() |
提出日時 | 2022-06-10 21:55:03 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 332 bytes |
コンパイル時間 | 279 ms |
コンパイル使用メモリ | 82,464 KB |
実行使用メモリ | 92,928 KB |
最終ジャッジ日時 | 2024-09-21 06:14:26 |
合計ジャッジ時間 | 4,061 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 RE * 5 |
ソースコード
import sys input = sys.stdin.readline N,M=map(int,input().split()) A=list(map(int,input().split())) cnt=[0]*M for a in A: cnt[a%M]+=1 ans=0 if cnt[0]>0: ans = 1 for i in range(1,(M+1)//2): if cnt[i] > cnt[M-i]: ans += cnt[i] else: ans += cnt[M-i] if M%2==0 and cnt[M//2]>0: ans += 1 print(ans)