結果

問題 No.2260 Adic Sum
ユーザー 👑 H20H20
提出日時 2023-04-07 21:28:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 904 ms / 2,000 ms
コード長 255 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 82,652 KB
実行使用メモリ 229,844 KB
最終ジャッジ日時 2024-04-15 23:42:06
合計ジャッジ時間 18,670 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
53,632 KB
testcase_01 AC 46 ms
54,016 KB
testcase_02 AC 45 ms
53,760 KB
testcase_03 AC 45 ms
53,888 KB
testcase_04 AC 52 ms
61,312 KB
testcase_05 AC 52 ms
61,696 KB
testcase_06 AC 50 ms
61,184 KB
testcase_07 AC 49 ms
61,508 KB
testcase_08 AC 76 ms
76,288 KB
testcase_09 AC 60 ms
70,656 KB
testcase_10 AC 73 ms
76,544 KB
testcase_11 AC 57 ms
64,640 KB
testcase_12 AC 73 ms
76,416 KB
testcase_13 AC 84 ms
76,672 KB
testcase_14 AC 363 ms
115,816 KB
testcase_15 AC 523 ms
150,708 KB
testcase_16 AC 308 ms
109,704 KB
testcase_17 AC 573 ms
160,420 KB
testcase_18 AC 719 ms
218,132 KB
testcase_19 AC 763 ms
211,036 KB
testcase_20 AC 792 ms
209,520 KB
testcase_21 AC 782 ms
202,904 KB
testcase_22 AC 825 ms
200,264 KB
testcase_23 AC 856 ms
197,888 KB
testcase_24 AC 769 ms
210,724 KB
testcase_25 AC 857 ms
222,456 KB
testcase_26 AC 806 ms
215,108 KB
testcase_27 AC 888 ms
226,880 KB
testcase_28 AC 849 ms
222,076 KB
testcase_29 AC 852 ms
229,844 KB
testcase_30 AC 904 ms
223,148 KB
testcase_31 AC 597 ms
196,048 KB
testcase_32 AC 592 ms
197,528 KB
testcase_33 AC 765 ms
224,644 KB
testcase_34 AC 711 ms
190,248 KB
testcase_35 AC 747 ms
210,304 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections
N,P = map(int, input().split())
A = list(map(int, input().split()))
ans = 0
for i in range(1,50):
    p = P**i
    C = collections.Counter()
    for a in A:
        C[a%p]+=1
    for k,v in C.items():
        ans+=v*(v-1)//2

print(ans)
0