Open
Conversation
p-senichenkov
approved these changes
Dec 11, 2025
Collaborator
p-senichenkov
left a comment
There was a problem hiding this comment.
Палиндром: 19/20
Циклический сдвиг: 9/10
| l->len = 0; | ||
| } | ||
|
|
||
| void push(List* l, int a) |
Collaborator
There was a problem hiding this comment.
А что мешает сохранить tail в List и просто добавлять элементы после него?
| int check(List* l) | ||
| { | ||
| Element* current = l->head.next; | ||
| while (current->next != NULL) { |
Collaborator
There was a problem hiding this comment.
Опять же, наверное, удобно было бы хранить указатель на tail.
| { | ||
| int a = 0; | ||
| for (int i = N - 1; i >= 0; i--) { | ||
| a += arr[i] * (int)pow(2, N - 1 - i); |
Collaborator
There was a problem hiding this comment.
Не надо лишний раз работать с вещественными числами. Строго говоря, здесь можно получить неожиданные результаты (скорее всего, их не будет из-за оптимизаций компилятора. Попробуйте позапускать с -O0).
Есть масса других способов возвести двойку в степень и умножить на 0 или 1.
| return a; | ||
| } | ||
|
|
||
| int biggest(int* arr, int N) |
Collaborator
There was a problem hiding this comment.
nit: В условии сказано, что на вход подаётся булевый массив, а не массив int.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.