Skip to content

Tasks #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Tasks #32

wants to merge 7 commits into from

Conversation

Lynech
Copy link

@Lynech Lynech commented Jan 16, 2025

No description provided.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

There were too many comments to post at once. Showing the first 15 out of 71. Check the log or trigger a new build to see more.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

There were too many comments to post at once. Showing the first 15 out of 71. Check the log or trigger a new build to see more.

#include <iostream>

int main() {
std::cout << "Lol" << std::endl;

Choose a reason for hiding this comment

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

warning: do not use 'std::endl' with streams; use '\n' instead [performance-avoid-endl]

Suggested change
std::cout << "Lol" << std::endl;
std::cout << "Lol" << '\n';

@@ -1,3 +1,6 @@
#include <iostream>

int main() { return 0; }
int main() {
std::cout << "Lol" << std::endl;

Choose a reason for hiding this comment

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

warning: do not use 'std::endl' with streams; use '\n' instead [performance-avoid-endl]

Suggested change
std::cout << "Lol" << std::endl;
std::cout << "Lol" << '\n';


a.UpdateBrAp();

std::vector<std::pair<int, int>> bridges({{1, 2}, {0, 1}});

Choose a reason for hiding this comment

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

warning: variable 'bridges' of type 'std::vector<std::pair<int, int>>' can be declared 'const' [misc-const-correctness]

Suggested change
std::vector<std::pair<int, int>> bridges({{1, 2}, {0, 1}});
std::vector<std::pair<int, int>> const bridges({{1, 2}, {0, 1}});


std::vector<std::pair<int, int>> bridges({{1, 2}, {0, 1}});
EXPECT_EQ(a.GetBr(), bridges);
std::vector<int> articulation_points({2, 1});

Choose a reason for hiding this comment

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

warning: variable 'articulation_points' of type 'std::vector' can be declared 'const' [misc-const-correctness]

Suggested change
std::vector<int> articulation_points({2, 1});
std::vector<int> const articulation_points({2, 1});


a.UpdateBrAp();

std::vector<std::pair<int, int>> bridges({{2, 4}, {0, 1}});

Choose a reason for hiding this comment

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

warning: variable 'bridges' of type 'std::vector<std::pair<int, int>>' can be declared 'const' [misc-const-correctness]

Suggested change
std::vector<std::pair<int, int>> bridges({{2, 4}, {0, 1}});
std::vector<std::pair<int, int>> const bridges({{2, 4}, {0, 1}});


a.UpdateBrAp();

std::vector<std::pair<int, int>> bridges({});

Choose a reason for hiding this comment

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

warning: variable 'bridges' of type 'std::vector<std::pair<int, int>>' can be declared 'const' [misc-const-correctness]

Suggested change
std::vector<std::pair<int, int>> bridges({});
std::vector<std::pair<int, int>> const bridges({});


std::vector<std::pair<int, int>> bridges({});
EXPECT_EQ(a.GetBr(), bridges);
std::vector<int> articulation_points({});

Choose a reason for hiding this comment

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

warning: variable 'articulation_points' of type 'std::vector' can be declared 'const' [misc-const-correctness]

Suggested change
std::vector<int> articulation_points({});
std::vector<int> const articulation_points({});


a.UpdateBrAp();

std::vector<std::pair<int, int>> bridges({{3, 6}});

Choose a reason for hiding this comment

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

warning: variable 'bridges' of type 'std::vector<std::pair<int, int>>' can be declared 'const' [misc-const-correctness]

Suggested change
std::vector<std::pair<int, int>> bridges({{3, 6}});
std::vector<std::pair<int, int>> const bridges({{3, 6}});


std::vector<std::pair<int, int>> bridges({{3, 6}});
EXPECT_EQ(a.GetBr(), bridges);
std::vector<int> articulation_points({3});

Choose a reason for hiding this comment

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

warning: variable 'articulation_points' of type 'std::vector' can be declared 'const' [misc-const-correctness]

Suggested change
std::vector<int> articulation_points({3});
std::vector<int> const articulation_points({3});


a.UpdateBrAp();

std::vector<std::pair<int, int>> bridges({{0, 1}, {0, 2}, {3, 6}});

Choose a reason for hiding this comment

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

warning: variable 'bridges' of type 'std::vector<std::pair<int, int>>' can be declared 'const' [misc-const-correctness]

Suggested change
std::vector<std::pair<int, int>> bridges({{0, 1}, {0, 2}, {3, 6}});
std::vector<std::pair<int, int>> const bridges({{0, 1}, {0, 2}, {3, 6}});

Copy link
Contributor

Choose a reason for hiding this comment

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

расширение не то(

private:
size_t v_num_;
std::vector<std::vector<T>> adj_;
std::vector<int> disc_,
Copy link
Contributor

Choose a reason for hiding this comment

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

1 объявление - 1 строчка, не через запятую

std::vector<std::pair<int, int>> br_; // bridges
std::vector<int> a_p_; // articulation points

void dfs(int u, int p, int& timer) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Dfs

}
}

std::vector<std::pair<int, int>> GetBr() { return br_; }
Copy link
Contributor

Choose a reason for hiding this comment

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

так себе название функции, как и следующей

@@ -0,0 +1,12 @@
У меня две задачи (lca и rmq) оказались очень связанными и интересными. Для того, чтобы реализовать lca я использовал rmq+-1 (что более узкий случай по сравнению с rmq). Для того, чтобы решить задачу rmq+-1 использовал алгоритм Фарака-Колтона и Бендера. Сложность для rmq+-1 составила O(n) на построение (по сравнению с O(nlogn) для общего rmq на разряженных таблицах) и O(1) на нахождения минимума.
Copy link
Contributor

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