Skip to content

Conversation

@uuiduuuiduuuuid
Copy link

Summary

This PR adds/fixes the Li Chao Tree implementation under basm-std/src/collections/.

  • Fixed comparison logic after mid swap (correct handling for max query)
  • Resolved clippy warning (question_mark suggestion)
  • Added comprehensive unit tests for both min/max modes

Changes

  • Implemented LiChaoTree struct supporting min/max envelopes
  • Added #[cfg(test)] unit tests under collections::li_chao_tree::tests
  • Updated collections.rs to re-export the module
  • Verified formatting (cargo fmt) and clippy cleanliness

Motivation

To provide a high-performance convex hull optimization structure
useful for geometry and dynamic programming problems such as
BOJ - 반평면 땅따먹기 (Problem 10256).

Checklist

  • cargo fmt --all passed
  • cargo clippy --all -- -D warnings passed
  • All tests passed (cargo test -p basm-std li_chao_tree)
  • Confirmed with sample problem (BOJ 반평면 땅따먹기)

@kiwiyou
Copy link
Collaborator

kiwiyou commented Nov 19, 2025

안녕하세요, basm-rs에 관심을 가져 주셔서 감사합니다. 현재 구현체는 i64 전 범위를 커버하지 못하는데, 해당 부분 수정이 가능하실까요?

@uuiduuuiduuuuid
Copy link
Author

uuiduuuiduuuuid commented Nov 22, 2025

@kiwiyou Sorry, but I’m busy right now and won’t be able to work on the development/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants