結果
| 問題 | No.2260 Adic Sum |
| コンテスト | |
| ユーザー |
detteiuu
|
| 提出日時 | 2026-08-05 22:39:13 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 325 ms / 2,000 ms |
| + 282µs | |
| コード長 | 315 bytes |
| 記録 | |
| コンパイル時間 | 675 ms |
| コンパイル使用メモリ | 96,096 KB |
| 実行使用メモリ | 201,544 KB |
| 最終ジャッジ日時 | 2026-08-05 22:39:22 |
| 合計ジャッジ時間 | 9,025 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 33 |
ソースコード
from collections import defaultdict
N, P = map(int, input().split())
A = list(map(int, input().split()))
cnt = P
ans = 0
while True:
D = defaultdict(int)
flag = True
for a in A:
ans += D[a%cnt]
D[a%cnt] += 1
if cnt <= a: flag = False
if flag: break
cnt *= P
print(ans)
detteiuu