Explore tweets tagged as #binaryheap
@Freol
frol.near
1 year
Contributing to the #rustlang compiler was a pleasure. I am happy to see my tiny extension to the API is finally in stable Rust 1.80 release. I thought we would need BinaryHeap::as_slice for borsh-rs implementation, but that turned out to be not needed there 😅
3
1
24
@fredine
Eric Fredine
2 years
You can use Reverse in Rust to convert the standard library BinaryHeap to a min heap. It's a struct tuple so getting your data out feels a bit weird. Used here to merge k linked lists sorted in ascending order.
0
0
5
@m_ou_se
Mara
3 years
It's possible to put containers like BTreeSet<T> and BinaryHeap<T> into an inconsistent state by using a T with a broken Ord implementation. For 'trusted' types with a correct Ord implementation (e.g. i32), BinaryHeap<i32> is now guaranteed to always be in consistent state. 7/11
1
1
21
@RaillyHugo
Hunter ♠️
1 year
> day 8 - low level + math journey + bonus today's progress (~3h): > rust 🦀: • started Chapter 8: Common Collections • covered 8.1: Storing Lists of Values with Vectors • studied rust docs: HashMap, Vec, VecDeque, BinaryHeap > math academy 🧮: • completed 8 lessons (80/64
0
0
19
@ekusiadadus
⛄ 絶望ドメイン (貧血症)⛄
2 years
Rust で、TopK欲しいなってなって プライオリティーキュー実装見ていたの��けれど、BinaryHeap だと ティムソートされているらしい というか、Rust で f64 型にたいして BinaryHeap って使えないのか... f64 は Ord トレイトを実装していないから Opus は Tupple Wrap してきて、自分より頭良い
0
0
2
@purasiibo
pura ton
2 years
BinaryHeap が壊れてる。どうして…
0
0
0
@drmingdrmer
drdr.xp
2 years
看文档写 binaryHeap push的时间复杂度是O(1), 想想好像还真是🤔. 以前面试都无脑说O(log(n))的 https://t.co/vC0ZSQFPXc
0
0
3
@paruma184
ぱるま
2 years
min_heap: BinaryHeap<Reverse<usize>> = ... ↑ Priority Queue で小さい順に取り出すの、こうやって書けるのか! (画像みたいな構造体を作るという、めっちゃめんどいことをしてた) Rustで競技プログラミング スターターキット - Qiita https://t.co/viZ3SvBUfR
0
0
0
@giwiyou
kiwiyou キイユー
1 year
어쩌다 보니 틀린 코드가 성능 1위를 해버렸다 (BinaryHeap을 이용한 Dijkstra, 중간 과정에서 힙을 제대로 유지하지 않음)
1
0
7
@hossie
ほっしー
3 years
ABC303 お疲れさまでした。5完ですが微妙…… A: やるだけ B: set に両隣の組を入れて n*(n-1)/2 から個数を引く C: シミュレーションするだけ D: 実装後 TLE 解消に 40分+5 TLE 😢 この手の無駄が出がちな BinaryHeap ってコツがあるのかな…… 無理やり E: 星の中心は 3個隣を辿り続ければ OK
0
0
7
@nebocco27
ねぼこ
3 years
BinaryHeap なぜデカい順に……
1
0
9
@hossie
ほっしー
1 year
ABC363 お疲れさまでした。ギリギリ5完。全然早解き回ではなく。 A: 100-r%100 B: そのまま実装 C: 全探索で 1947ms ギリ! この文字列は Rust 泣かせ D: 上半分桁を考えて下半分は反転コピー。バグりやすい。本当に 350点? E: BinaryHeap に海に隣接したマスを詰める。h=1, w=1 考慮漏れで 1WA。
0
0
5
@tayu_kyopro
tayu
1 year
A, 頑張って切り上げ B, 愚直に C, 全探索したけどだいぶTLきつくないか? D, 最難関。桁ごとに数え上げて桁数特定したら https://t.co/fAzHsHZVvJで頑張る E, 海に面するところをBinaryHeapに突っ込む F, メモ化再帰で頑張る G, Q=1でも解き方わかりませんが…ナニコレ
3
0
33
@timClicks
Tim McNamara
2 years
Making a practical priority queue from Rust's std::collections::BinaryHeap
1
5
33
@hossie
ほっしー
1 year
AtCoder362お疲れさまでした。Unrated 4完。 A: matchで3通り調べる B: 三平方の定理 C: ΣLi≦0≦ΣRi なら答えあり。答えが複数ある問題はテストしにくくて苦手です D: pathfinding の dijkstra_all で、と思ったら TLE...… HashMap 遅い…… BinaryHeap で書き直し E: バグにはまって終了
0
0
1
@_QiToY
sudove
2 years
BinaryHeapのiter()って順不同なのか……(1敗)
1
0
0
@sb_syzygy
sb
3 years
BinaryHeapとVecを合わせるとかがまるいのかな
0
0
0
@tayu_kyopro
tayu
3 years
A、やる B、やる C、やる D、やる E、HashSet1本とBinaryHeap2本でやったが、なんとK==Nで壊れるというチンパンプレーに気づかず死 F、頑張って計算して座圧してセグ木で殴れるはずなんだけどサンプルが合わず死。4secとみてO(MN^2)を投げてみたがダメだった
2
0
10