結果

問題 No.2260 Adic Sum
ユーザー pluto77pluto77
提出日時 2023-04-26 16:13:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 204 bytes
コンパイル時間 186 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 28,488 KB
最終ジャッジ日時 2024-04-27 18:40:04
合計ジャッジ時間 18,559 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,496 KB
testcase_01 AC 31 ms
10,496 KB
testcase_02 AC 32 ms
10,624 KB
testcase_03 AC 31 ms
10,752 KB
testcase_04 AC 30 ms
10,496 KB
testcase_05 AC 31 ms
10,624 KB
testcase_06 AC 30 ms
10,624 KB
testcase_07 AC 32 ms
10,496 KB
testcase_08 AC 36 ms
11,008 KB
testcase_09 AC 32 ms
10,752 KB
testcase_10 AC 35 ms
11,136 KB
testcase_11 AC 31 ms
10,752 KB
testcase_12 AC 37 ms
10,880 KB
testcase_13 AC 33 ms
11,136 KB
testcase_14 AC 80 ms
16,456 KB
testcase_15 AC 103 ms
18,972 KB
testcase_16 AC 72 ms
16,804 KB
testcase_17 AC 113 ms
20,664 KB
testcase_18 AC 1,331 ms
28,164 KB
testcase_19 AC 1,402 ms
28,148 KB
testcase_20 AC 931 ms
28,260 KB
testcase_21 AC 948 ms
28,244 KB
testcase_22 AC 792 ms
27,868 KB
testcase_23 AC 589 ms
27,892 KB
testcase_24 AC 1,407 ms
28,140 KB
testcase_25 AC 151 ms
26,180 KB
testcase_26 AC 149 ms
25,852 KB
testcase_27 AC 157 ms
26,308 KB
testcase_28 AC 153 ms
26,092 KB
testcase_29 AC 159 ms
25,948 KB
testcase_30 AC 218 ms
22,156 KB
testcase_31 AC 1,859 ms
22,088 KB
testcase_32 AC 1,876 ms
22,740 KB
testcase_33 AC 214 ms
26,348 KB
testcase_34 AC 637 ms
28,108 KB
testcase_35 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *
n,p=map(int,input().split())
a=list(map(int,input().split()))
res=0
q=p
while q<10**9+3:
 d=defaultdict(int)
 for i in range(n):
  res+=d[a[i]%q]
  d[a[i]%q]+=1
 q*=p
print(res)
0