結果

問題 No.2260 Adic Sum
ユーザー 👑 timitimi
提出日時 2023-04-15 15:15:55
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 234 bytes
コンパイル時間 180 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 293,212 KB
最終ジャッジ日時 2024-04-19 09:28:46
合計ジャッジ時間 28,359 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,196 KB
testcase_01 AC 36 ms
52,224 KB
testcase_02 AC 35 ms
52,352 KB
testcase_03 AC 42 ms
59,392 KB
testcase_04 AC 41 ms
60,160 KB
testcase_05 AC 47 ms
60,416 KB
testcase_06 AC 43 ms
60,160 KB
testcase_07 AC 42 ms
60,160 KB
testcase_08 AC 76 ms
76,032 KB
testcase_09 AC 60 ms
75,264 KB
testcase_10 AC 74 ms
76,160 KB
testcase_11 AC 49 ms
64,768 KB
testcase_12 AC 76 ms
76,032 KB
testcase_13 AC 97 ms
76,416 KB
testcase_14 AC 762 ms
135,392 KB
testcase_15 AC 1,140 ms
202,396 KB
testcase_16 AC 660 ms
125,836 KB
testcase_17 AC 1,335 ms
221,148 KB
testcase_18 AC 1,820 ms
256,748 KB
testcase_19 AC 1,928 ms
271,780 KB
testcase_20 AC 1,972 ms
287,496 KB
testcase_21 AC 1,979 ms
288,088 KB
testcase_22 AC 1,976 ms
288,628 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 AC 1,944 ms
281,856 KB
testcase_27 TLE -
testcase_28 TLE -
testcase_29 TLE -
testcase_30 TLE -
testcase_31 AC 1,778 ms
216,244 KB
testcase_32 AC 1,769 ms
220,840 KB
testcase_33 AC 1,644 ms
285,112 KB
testcase_34 AC 1,579 ms
282,072 KB
testcase_35 AC 1,816 ms
225,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,P=map(int, input().split())
A=list(map(int, input().split()))
ans=0
for i in range(1,100):
  D={}
  PP=pow(P,i)
  for a in A:
    b=a%PP 
    if b not in D:
      D[b]=0
    D[b]+=1
  for d in D:
    ans+=D[d]*(D[d]-1)
print(ans//2)
0