Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
adamant-pwn committed Nov 21, 2024
1 parent 1db7e8e commit 2ef9572
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cp-algo/graph/base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace cp_algo::graph {
graph(int n, int v0 = 0): v0(v0), adj(n) {}

void add_edge(node_index u, edge_t e) {
adj.push(u, size(edges));
adj.push(u, (edge_index)size(edges));
edges.push_back(e);
if constexpr (undirected) {
adj.push(e.to, size(edges));
Expand Down Expand Up @@ -51,7 +51,7 @@ namespace cp_algo::graph {
}
auto const& incidence_lists() const {return adj;}
edge_t const& edge(edge_index e) const {return edges[e];}
node_index n() const {return adj.size();}
node_index n() const {return (node_index)adj.size();}
edge_index m() const {return size(edges) / 2;}
private:
node_index v0;
Expand Down
2 changes: 1 addition & 1 deletion cp-algo/structures/stack_union.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace cp_algo::structures {

void push(int v, datatype const& vdata) {
next.push_back(head[v]);
head[v] = std::size(next) - 1;
head[v] = (int)std::size(next) - 1;
data.push_back(vdata);
}
template<typename... Args>
Expand Down
2 changes: 1 addition & 1 deletion cp-algo/structures/treap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace cp_algo::structures::treap {
struct node {
using treap = node*;
meta _meta;
int prior = random::rng();
int prior = (int)random::rng();
size_t size = 1;
treap children[2] = {nullptr, nullptr};
enum subtree {L, R};
Expand Down

0 comments on commit 2ef9572

Please sign in to comment.