message: Update maximum-genetic-difference-query.cpp
diff: @@ -64,7 +64,7 @@ public:
  max_val = max(max_val, queries[i][1]);
  }
  vector<int> result(size(queries));
  - Trie trie(32 - __builtin_clz(max_val));
  + Trie trie(bit_length(max_val));
  iter_dfs(adj, qs, adj[-1][0], &trie, &result);
  return result;
  }
  @@ -97,6 +97,10 @@ private:
  }
  }
  }
  +
  + int bit_length(int x) {
  + return x != 0 ? 32 - __builtin_clz(x) : 1;
  + }
  };
  // Time: O(nlogk + mlogk), k is max(max(vals), n-1)
  @@ -164,7 +168,7 @@ public:
  max_val = max(max_val, queries[i][1]);
  }
  vector<int> result(size(queries));
  - Trie trie(32 - __builtin_clz(max_val));
  + Trie trie(bit_length(max_val));
  dfs(adj, qs, adj[-1][0], &trie, &result);
  return result;
  }
  @@ -189,4 +193,8 @@ private:
  }
  trie->insert(node, -1);
  }
  +
  + int bit_length(int x) {
  + return x != 0 ? 32 - __builtin_clz(x) : 1;
  + }
  };
  