結果

問題 No.2260 Adic Sum
ユーザー flygonflygon
提出日時 2023-04-07 21:34:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,466 ms / 2,000 ms
コード長 460 bytes
コンパイル時間 283 ms
コンパイル使用メモリ 82,444 KB
実行使用メモリ 281,632 KB
最終ジャッジ日時 2024-04-15 23:47:27
合計ジャッジ時間 27,418 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
54,400 KB
testcase_01 AC 48 ms
54,912 KB
testcase_02 AC 51 ms
55,040 KB
testcase_03 AC 52 ms
61,312 KB
testcase_04 AC 54 ms
62,336 KB
testcase_05 AC 55 ms
62,080 KB
testcase_06 AC 55 ms
62,208 KB
testcase_07 AC 55 ms
62,592 KB
testcase_08 AC 85 ms
76,768 KB
testcase_09 AC 70 ms
76,336 KB
testcase_10 AC 80 ms
76,672 KB
testcase_11 AC 64 ms
68,480 KB
testcase_12 AC 85 ms
76,672 KB
testcase_13 AC 97 ms
76,752 KB
testcase_14 AC 531 ms
126,288 KB
testcase_15 AC 810 ms
195,284 KB
testcase_16 AC 450 ms
117,760 KB
testcase_17 AC 904 ms
214,552 KB
testcase_18 AC 1,041 ms
212,236 KB
testcase_19 AC 1,155 ms
217,176 KB
testcase_20 AC 1,181 ms
243,720 KB
testcase_21 AC 1,245 ms
249,688 KB
testcase_22 AC 1,250 ms
267,416 KB
testcase_23 AC 1,384 ms
281,632 KB
testcase_24 AC 1,121 ms
213,152 KB
testcase_25 AC 1,393 ms
275,248 KB
testcase_26 AC 1,358 ms
271,108 KB
testcase_27 AC 1,466 ms
278,768 KB
testcase_28 AC 1,394 ms
272,900 KB
testcase_29 AC 1,413 ms
278,716 KB
testcase_30 AC 1,419 ms
275,560 KB
testcase_31 AC 868 ms
203,780 KB
testcase_32 AC 870 ms
204,096 KB
testcase_33 AC 1,307 ms
279,516 KB
testcase_34 AC 1,192 ms
276,516 KB
testcase_35 AC 957 ms
214,812 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(5*10**5)
input = sys.stdin.readline
from collections import defaultdict, deque, Counter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right
from math import gcd

n,p = map(int,input().split())
a = list(map(int,input().split()))


ans = 0
for 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] += 1
    
print(ans)
0