結果
| 問題 | No.33 アメーバがたくさん |
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2022-07-10 14:25:12 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 24 ms / 5,000 ms |
| + 480µs | |
| コード長 | 479 bytes |
| 記録 | |
| コンパイル時間 | 611 ms |
| コンパイル使用メモリ | 82,604 KB |
| 実行使用メモリ | 56,176 KB |
| 最終ジャッジ日時 | 2026-10-10 10:25:16 |
| 合計ジャッジ時間 | 1,605 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 |
ソースコード
n, d, t = map(int, input().split())
pos = {}
X = list(map(int, input().split()))
for x in X:
p = x % d
x //= d
mi = x - t
ma = x + t
if p not in pos:
pos[p] = {}
pos[p][mi] = pos[p].get(mi, 0) + 1
pos[p][ma + 1] = pos[p].get(ma + 1 , 0) - 1
ans = 0
for dic in pos.values():
bef = -1
tot = 0
for k in sorted(dic.keys()):
v = dic[k]
if tot > 0:
ans += k - bef
bef = k
tot += v
print(ans)