Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //iterate until there are no elements
- int u, v, c;
- while(not pq.empty()){
- pq.max(u,v,c);
- sides[u] = not sides[u];
- sides[v] = not sides[v];
- //uptate cost or delete
- int cost = get_cost(u, v, neighbours, neighbours_position, sides);
- if(cost > 0) pq.assign(u, v, cost);
- else pq.erase(u, v);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement