Skip to content

Conversation

@kindofman
Copy link
Owner

Ссылка на Яндекс.Контест https://contest.yandex.ru/contest/16109/run-report/28947557/

@kindofman kindofman requested a review from ylyubimov December 21, 2019 07:08
Copy link
Collaborator

@ylyubimov ylyubimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Пока 3 балла

void add_edge( int u, int v, int w );
int MST() const;
private:
const int v;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вот это можно заменить на adj.size()

result += current.second;
for (auto sibling : adj[current.first]) {
if ( !visited[sibling.first] ) {
positions_queue.push( sibling );
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно еще удалять из очереди старое значение, если расстояние улучшилось, а то асимптотика растет.

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