結果
問題 |
No.1972 Modulo Set
|
ユーザー |
|
提出日時 | 2022-06-28 18:33:13 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 415 bytes |
コンパイル時間 | 137 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 35,428 KB |
最終ジャッジ日時 | 2024-11-21 12:47:46 |
合計ジャッジ時間 | 91,041 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 TLE * 27 |
ソースコード
n,m=list(map(int,input().split())) seq=list(map(int,input().split())) cnt=0 for i in range(len(seq)): seq[i]=seq[i]%m if seq.count(0)>0: cnt+=1 if m%2==0: if seq.count(int(m/2)): cnt+=1 for i in range(1,int(m/2)): cnt+=max(seq.count(i),seq.count(m-i)) else: for i in range(1,int((m-1)/2)+1): cnt+=max(seq.count(i),seq.count(m-i)) print(cnt)