結果
| 問題 | No.1972 Modulo Set |
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2022-06-10 21:30:25 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 251 ms / 2,000 ms |
| コード長 | 419 bytes |
| 記録 | |
| コンパイル時間 | 342 ms |
| コンパイル使用メモリ | 20,828 KB |
| 実行使用メモリ | 43,732 KB |
| 最終ジャッジ日時 | 2026-04-20 17:29:22 |
| 合計ジャッジ時間 | 7,108 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 34 |
ソースコード
import sys
input = sys.stdin.readline
from collections import Counter
N,M=map(int,input().split())
A=list(map(int,input().split()))
X=Counter()
for a in A:
X[a%M]+=1
ANS=0
USE=set()
for x in X:
#print(x,USE)
if x!=M/2 and x!=0 and not(x in USE):
y=M-x
ANS+=max(X[x],X[y])
USE.add(x)
USE.add(y)
elif x==M/2:
ANS+=1
elif x==0:
ANS+=1
print(ANS)
titia