結果
問題 | No.2260 Adic Sum |
ユーザー |
|
提出日時 | 2023-04-07 21:34:13 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,374 ms / 2,000 ms |
コード長 | 460 bytes |
コンパイル時間 | 307 ms |
コンパイル使用メモリ | 82,220 KB |
実行使用メモリ | 281,752 KB |
最終ジャッジ日時 | 2024-10-06 07:07:41 |
合計ジャッジ時間 | 24,906 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
ソースコード
import syssys.setrecursionlimit(5*10**5)input = sys.stdin.readlinefrom collections import defaultdict, deque, Counterfrom heapq import heappop, heappushfrom bisect import bisect_left, bisect_rightfrom math import gcdn,p = map(int,input().split())a = list(map(int,input().split()))ans = 0for i in range(1,60):d = defaultdict(int)now = pow(p,i)for i in range(n):ans += d[a[i] % now]d[a[i] % now] += 1print(ans)