-
Notifications
You must be signed in to change notification settings - Fork 22
Гусев Иван 312 группа #31
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?
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 69. Check the log or trigger a new build to see more.
task_01/src/main.cpp
Outdated
std::vector<node> nodes; | ||
std::vector<int> ans; | ||
|
||
int N=5; |
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 'N' of type 'int' can be declared 'const' [misc-const-correctness]
int N=5; | |
int const N=5; |
task_01/src/main.cpp
Outdated
/*ans = solution(nodes);*/ | ||
|
||
for(int i = ans.size()-1;i>=0;i--){ | ||
std::cout<<ans[i]<<" "; |
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: narrowing conversion from 'size_type' (aka 'unsigned long') to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions]
= ans.size()-1;i>=0;i--){
^
task_01/src/solution.cpp
Outdated
std::vector<int> solution(std::vector<node> nodes){ | ||
std::deque<int> gray; | ||
std::vector<int> ans; | ||
int N = nodes.size(),tmp=0; |
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: narrowing conversion from 'size_type' (aka 'unsigned long') to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions]
int N = nodes.size(),tmp=0;
^
task_01/src/solution.cpp
Outdated
std::vector<int> solution(std::vector<node> nodes){ | ||
std::deque<int> gray; | ||
std::vector<int> ans; | ||
int N = nodes.size(),tmp=0; |
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 'N' of type 'int' can be declared 'const' [misc-const-correctness]
int N = nodes.size(),tmp=0;
^
task_01/src/solution.cpp
Outdated
/*gray.push_back(0);*/ | ||
node *current; | ||
|
||
tmp=0; |
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: Value stored to 'tmp' is never read [clang-analyzer-deadcode.DeadStores]
tmp=0;
^
Additional context
task_01/src/solution.cpp:16: Value stored to 'tmp' is never read
tmp=0;
^
task_01/src/test.cpp
Outdated
std::vector<int> ans; | ||
|
||
int N=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 'N' of type 'int' can be declared 'const' [misc-const-correctness]
int N=3; | |
int const N=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.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 15 out of 68. 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 68. 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 69. Check the log or trigger a new build to see more.
int N = nodes.size(), tmp = 0; | ||
for (int i = 0; i < N; i++) { | ||
nodes[i].id = i; | ||
std::sort(nodes[i].neighbours.begin(), nodes[i].neighbours.end()); |
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.
из-за этого у нас будет сложность большая, в самом худшем поличиться nnlog(n)
ans = solution(nodes); | ||
std::vector<int> assertion = {0, 1, 2}; | ||
ASSERT_TRUE(assertion.size() == ans.size()); |
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.
ASSERT_EQ лучше использовать
#include <utility> | ||
#include <vector> | ||
|
||
static std::vector<int> h, d; |
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.
статические переменные не самая хорошая идея(
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.
кажется пролез лишний файл(
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.