結果
問題 | No.2260 Adic Sum |
ユーザー |
|
提出日時 | 2023-04-08 16:02:48 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 666 ms / 2,000 ms |
コード長 | 352 bytes |
コンパイル時間 | 193 ms |
コンパイル使用メモリ | 82,400 KB |
実行使用メモリ | 215,680 KB |
最終ジャッジ日時 | 2024-10-06 07:27:49 |
合計ジャッジ時間 | 6,591 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
ソースコード
N,P = map(int,input().split())A = list(map(int,input().split()))l = []C = 10 ** 9u = Pwhile u <= C:l.append(u)u *= Pfrom collections import defaultdictd = [defaultdict(int) for _ in range(len(l))]ans =0for a in A:for i in range(len(l)):p = l[i]r = a % pans += d[i][r]d[i][r] += 1print(ans)