Skip to content

Update main.cpp#14

Open
kindofman wants to merge 1 commit intomasterfrom
kindofman-patch-14
Open

Update main.cpp#14
kindofman wants to merge 1 commit intomasterfrom
kindofman-patch-14

Conversation

@kindofman
Copy link
Copy Markdown
Owner

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

@kindofman kindofman requested a review from ylyubimov December 21, 2019 07:08
Copy link
Copy Markdown
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 балла

Comment thread 14/main.cpp
void add_edge( int u, int v, int w );
int MST() const;
private:
const int v;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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

Comment thread 14/main.cpp
result += current.second;
for (auto sibling : adj[current.first]) {
if ( !visited[sibling.first] ) {
positions_queue.push( sibling );
Copy link
Copy Markdown
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