結果
問題 | No.1972 Modulo Set |
ユーザー |
![]() |
提出日時 | 2022-06-12 12:15:37 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 153 ms / 2,000 ms |
コード長 | 399 bytes |
コンパイル時間 | 225 ms |
コンパイル使用メモリ | 82,236 KB |
実行使用メモリ | 126,888 KB |
最終ジャッジ日時 | 2024-10-05 01:45:31 |
合計ジャッジ時間 | 4,744 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 34 |
ソースコード
from _collections import defaultdictn,m=map(int,input().split())s=set()a=list(map(int,input().split()))for i in range(n):a[i]%=mcnt=defaultdict(int)ans=0nod=set()for x in a:cnt[x]+=1for x in cnt:nod.add(x)nod.add((m-x)%m)for x in nod:y=(m-x)%mif y<x:continueif x==y:ans+=min(1,cnt[x])continueans+=max(cnt[x],cnt[y])print(ans)