結果
| 問題 |
No.2260 Adic Sum
|
| コンテスト | |
| ユーザー |
timi
|
| 提出日時 | 2023-04-15 15:15:55 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 234 bytes |
| コンパイル時間 | 537 ms |
| コンパイル使用メモリ | 81,996 KB |
| 実行使用メモリ | 288,500 KB |
| 最終ジャッジ日時 | 2024-10-11 01:58:23 |
| 合計ジャッジ時間 | 42,704 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 TLE * 9 |
ソースコード
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)
timi