-
Notifications
You must be signed in to change notification settings - Fork 23
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
base: main
Are you sure you want to change the base?
Tasks #32
Conversation
There was a problem hiding this 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.
There was a problem hiding this 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; |
There was a problem hiding this comment.
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]
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; |
There was a problem hiding this comment.
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]
std::cout << "Lol" << std::endl; | |
std::cout << "Lol" << '\n'; |
|
||
a.UpdateBrAp(); | ||
|
||
std::vector<std::pair<int, int>> bridges({{1, 2}, {0, 1}}); |
There was a problem hiding this comment.
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]
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}); |
There was a problem hiding this comment.
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]
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}}); |
There was a problem hiding this comment.
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]
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({}); |
There was a problem hiding this comment.
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]
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({}); |
There was a problem hiding this comment.
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]
std::vector<int> articulation_points({}); | |
std::vector<int> const articulation_points({}); |
|
||
a.UpdateBrAp(); | ||
|
||
std::vector<std::pair<int, int>> bridges({{3, 6}}); |
There was a problem hiding this comment.
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]
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}); |
There was a problem hiding this comment.
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]
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}}); |
There was a problem hiding this comment.
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]
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}}); |
There was a problem hiding this comment.
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_, |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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_; } |
There was a problem hiding this comment.
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) на нахождения минимума. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
докину за это)
No description provided.