Skip to content

Commit

Permalink
binary-trie-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gandalfr-KY committed Mar 28, 2024
1 parent 522d6a5 commit 3e684ae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cpp/binary-trie.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ template <unsigned int d> class BinaryTrie {
cur_ptr->affect_xor();
NodePtr &nxt_ptr = cur_ptr->children[cur_ptr->get_bit(n)];
if (!nxt_ptr) {
return nullptr;
return 0;
}
cur_ptr = nxt_ptr;
}
Expand All @@ -80,7 +80,7 @@ template <unsigned int d> class BinaryTrie {
* @note 存在しない要素を指定したとき、何も起こらない
*/
void erase(unsigned long long n) const {
int cnt = count(n);
unsigned int cnt = count(n);
if (cnt == 0)
return;
NodePtr cur_ptr = root_ptr;
Expand Down Expand Up @@ -121,7 +121,7 @@ template <unsigned int d> class BinaryTrie {
* @brief 昇順でn番目の要素を探索 (O(d))
* @note nがtrie木のサイズ以上な場合、assert
*/
unsigned long long nth_element(int n) const {
unsigned long long nth_element(unsigned int n) const {
assert(n < size());
unsigned long long ret = 0;
NodePtr cur_ptr = root_ptr;
Expand Down

0 comments on commit 3e684ae

Please sign in to comment.