結果
問題 | No.2260 Adic Sum |
ユーザー |
![]() |
提出日時 | 2023-04-07 23:33:49 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 446 ms / 2,000 ms |
コード長 | 325 bytes |
コンパイル時間 | 166 ms |
コンパイル使用メモリ | 82,388 KB |
実行使用メモリ | 179,252 KB |
最終ジャッジ日時 | 2024-10-06 07:22:45 |
合計ジャッジ時間 | 5,670 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
ソースコード
from collections import defaultdictN, P = map(int, input().split())A = list(map(int, input().split()))P2 = Pmaxa = max(A)ans = 0while P2 <= maxa:dic = defaultdict(int)for a in A:dic[a % P2] += 1for v in dic.values():if v > 1:ans += v * (v - 1) // 2P2 *= Pprint(ans)